:root {
  color-scheme: dark;
  --bg: #080c0f;
  --panel: #11191f;
  --panel-soft: #17232b;
  --line: #2b3c46;
  --text: #f2f6f7;
  --muted: #9eb0b9;
  --gold: #f1c84a;
  --gold-soft: #ffe978;
  --cyan: #5be5dc;
  --red: #ee695f;
  --max: 1420px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% -8%, rgba(73, 132, 151, .28), transparent 31rem),
    linear-gradient(180deg, #0a1116 0, var(--bg) 55rem);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }
img { max-width: 100%; }
button, input { font: inherit; }

.shell {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(8, 12, 15, .84);
  backdrop-filter: blur(18px);
}

.topbar .shell {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: .78rem;
}

.topnav {
  display: flex;
  gap: 8px;
}

.topnav a, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 800;
  transition: border-color .2s ease, color .2s ease, transform .2s ease, background .2s ease;
}

.topnav a:hover, .button:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  color: var(--gold-soft);
}

.button.primary {
  color: #101215;
  border-color: var(--gold);
  background: var(--gold);
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.dashboard-hero {
  padding: clamp(72px, 10vw, 140px) 0 58px;
}

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: clamp(34px, 7vw, 100px);
  align-items: end;
}

.dashboard-hero h1,
.journal-hero h1 {
  max-width: 950px;
  margin: 12px 0 18px;
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: .88;
  letter-spacing: -.075em;
}

.dashboard-hero h1 span,
.journal-hero h1 span {
  display: block;
  color: var(--gold-soft);
}

.hero-copy {
  max-width: 720px;
  color: #c6d0d4;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-visual {
  min-height: 420px;
  position: relative;
  overflow: hidden;
  border: 1px solid #52656d;
  border-radius: 30px;
  background:
    linear-gradient(135deg, transparent 0 49.7%, rgba(255,255,255,.17) 50%, transparent 50.3%),
    linear-gradient(135deg, #222c32, #0d1216);
  box-shadow: 0 32px 80px rgba(0,0,0,.46);
}

.texture-pixels {
  position: absolute;
  inset: 0 50% 0 0;
  background: url("./assets/flatline/brick-before.webp") center/cover;
  image-rendering: pixelated;
  filter: saturate(.72) brightness(.78);
}

.texture-detail {
  position: absolute;
  inset: 0 0 0 50%;
  background: url("./assets/flatline/brick-after.webp") center/cover;
  filter: saturate(1.08) contrast(1.08);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.85));
}

.hero-stamp {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.hero-stamp span, .hero-stamp em {
  display: block;
  color: #dce5e8;
  font-style: normal;
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-stamp strong {
  display: block;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: .92;
}

.hero-stamp b {
  color: var(--cyan);
  font-size: 1.25rem;
}

.section {
  padding: 34px 0 76px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2,
.article-copy h2 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.section-heading p,
.article-copy p,
.mission-card p,
.shared-note p,
.shared-note small {
  color: var(--muted);
}

.overall-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
  gap: 1px;
}

.overall-grid article {
  min-height: 150px;
  padding: 25px;
  background: var(--panel);
}

.overall-grid span,
.overall-grid em {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.overall-grid strong {
  display: inline-block;
  margin: 8px 10px 0 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.shared-note {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 24px;
  margin-top: 14px;
  padding: 20px 22px;
  border: 1px solid #36525c;
  border-radius: 16px;
  background: rgba(19, 35, 42, .75);
}

.shared-note span {
  color: #8bcade;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.shared-note strong { display: block; font-size: 1.1rem; }
.shared-note p { margin: 8px 0 0; text-align: right; }
.shared-note small { grid-column: 1 / -1; }

.featured-level {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid rgba(241,200,74,.5);
  border-radius: 24px;
  background: linear-gradient(135deg, #19252c, #10171b);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.featured-level > div:first-child {
  min-height: 390px;
  background:
    linear-gradient(180deg, transparent, rgba(0,0,0,.6)),
    url("./assets/flatline/metal-after.webp") center/cover;
}

.featured-copy { padding: clamp(28px, 5vw, 58px); }
.featured-copy h2 { margin: 8px 0; font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: .92; letter-spacing: -.06em; }
.featured-copy p { max-width: 660px; color: var(--muted); }

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #293943;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.progress-track .made { background: var(--gold-soft); }
.progress-track .integrated { background: var(--cyan); }

.featured-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0;
}

.featured-progress span { color: var(--muted); font-size: .76rem; font-weight: 900; text-transform: uppercase; }
.featured-progress strong { display: block; margin: 5px 0 8px; font-size: 1.45rem; }

.mission-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mission-card {
  min-height: 270px;
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--panel-soft), #0e1519);
  text-decoration: none;
}

.mission-card.featured {
  border-color: var(--gold);
  box-shadow: 0 0 50px rgba(241,200,74,.1);
  transition: transform .2s ease, box-shadow .2s ease;
}

.mission-card.featured:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 55px rgba(241,200,74,.16);
}

.mission-head,
.mission-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .76rem;
}

.mission-code { color: var(--gold-soft); font-weight: 950; }
.mission-card h3 { min-height: 2.5em; margin: 13px 0 20px; font-size: 1.22rem; line-height: 1.12; }
.mission-number strong { margin-right: 4px; font-size: 2.1rem; }
.mission-number span { color: var(--muted); }
.mission-card .progress-track { margin: 8px 0; height: 7px; }
.mission-card p { margin: 14px 0; font-size: .9rem; }
.mission-split b { color: var(--text); }
.inventory-pending { color: #a8d7e7 !important; font-weight: 900; }
.mission-action { display: block; margin-top: 18px; color: #71848e; font-size: .78rem; font-weight: 900; }
.featured .mission-action { color: var(--gold-soft); }

.journal-hero {
  padding: clamp(70px, 9vw, 120px) 0 52px;
}

.journal-hero h1 { max-width: 1050px; }
.journal-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 34px;
  align-items: end;
}

.journal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journal-meta span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(32px, 6vw, 90px);
  align-items: start;
}

.article-copy > p:first-of-type {
  color: #dbe4e7;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.article-copy blockquote {
  margin: 34px 0;
  padding: 28px;
  border-left: 3px solid var(--gold);
  border-radius: 0 18px 18px 0;
  background: rgba(241,200,74,.07);
  color: #f3e8b9;
  font-size: 1.15rem;
}

.article-aside {
  position: sticky;
  top: 92px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.article-aside strong { display: block; margin-bottom: 12px; }
.article-aside ol { margin: 0; padding-left: 20px; color: var(--muted); }
.article-aside li + li { margin-top: 8px; }
.article-aside a { color: var(--gold-soft); text-decoration: none; }

.change-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 50px;
  padding: 0;
  list-style: none;
}

.change-list li {
  position: relative;
  padding: 16px 18px 16px 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: #dbe4e7;
}

.change-list li::before {
  content: "✓";
  position: absolute;
  left: 17px;
  color: var(--teal);
  font-weight: 950;
}

.comparison-stack {
  display: grid;
  gap: 34px;
  margin: 35px 0 55px;
}

.comparison-stack-extra {
  display: grid;
  gap: 34px;
}

.comparison-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.comparison {
  --position: 50%;
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background:
    linear-gradient(45deg, #1b2328 25%, transparent 25%, transparent 75%, #1b2328 75%),
    linear-gradient(45deg, #1b2328 25%, #11181c 25%, #11181c 75%, #1b2328 75%);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.comparison img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison .before { image-rendering: pixelated; }
.comparison .after { clip-path: inset(0 0 0 var(--position)); }
.comparison::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: var(--position);
  width: 2px;
  transform: translateX(-1px);
  background: var(--gold-soft);
  box-shadow: 0 0 18px rgba(255,233,120,.8);
  pointer-events: none;
}

.comparison input {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.comparison-label {
  position: absolute;
  z-index: 3;
  top: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(5,8,10,.76);
  font-size: .69rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.comparison-label.before-label { left: 14px; }
.comparison-label.after-label { right: 14px; color: var(--gold-soft); }

.comparison-card figcaption { padding: 22px; }
.comparison-card figcaption strong { display: block; margin-bottom: 5px; font-size: 1.22rem; }
.comparison-card figcaption p { margin: 0; color: var(--muted); }

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 28px 0 50px;
  counter-reset: pipeline;
}

.pipeline article {
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  counter-increment: pipeline;
}

.pipeline article::before {
  content: "0" counter(pipeline);
  display: block;
  margin-bottom: 35px;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .12em;
}

.pipeline strong { display: block; }
.pipeline span { color: var(--muted); font-size: .86rem; }

.pipeline.blog-stats { grid-template-columns: repeat(3, 1fr); }
.pipeline.blog-stats article::before {
  content: "Current build";
  margin-bottom: 24px;
}

.site-footer {
  margin-top: 30px;
  padding: 35px 0 90px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-footer a { color: var(--gold-soft); text-decoration: none; }

@media (max-width: 1050px) {
  .mission-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .dashboard-hero-grid, .featured-level { grid-template-columns: 1fr; }
  .hero-visual { min-height: 360px; }
  .featured-level > div:first-child { min-height: 280px; }
}

@media (max-width: 780px) {
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .topnav a:first-child { display: none; }
  .overall-grid, .mission-grid { grid-template-columns: 1fr 1fr; }
  .shared-note, .article-layout, .journal-deck { grid-template-columns: 1fr; }
  .shared-note p { text-align: left; }
  .article-aside { position: static; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline.blog-stats { grid-template-columns: 1fr; }
  .change-list { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand span:last-child { display: none; }
  .dashboard-hero h1, .journal-hero h1 { font-size: clamp(3.1rem, 17vw, 5.4rem); }
  .hero-visual { min-height: 300px; }
  .hero-stamp { align-items: start; flex-direction: column; }
  .overall-grid, .mission-grid, .pipeline, .featured-progress { grid-template-columns: 1fr; }
  .overall-grid article { min-height: 125px; }
  .comparison { aspect-ratio: 4 / 3; }
  .site-footer .shell { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
