/* ---------- Reset & tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg:        #0a0d12;
  --bg-2:      #0d1117;
  --surface:   #121821;
  --surface-2: #161d27;
  --line:      #1f2733;
  --line-2:    #2a3340;
  --text:      #e6e8ec;
  --text-dim:  #a4adbb;
  --muted:     #6d7787;
  --accent:    #d4a460;   /* sand / amber */
  --accent-2:  #b8884a;
  --warn:      #c9603e;
  --ok:        #6dab87;
  --radius:    4px;

  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1200px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(212,164,96,.35); color: #fff; }

/* ---------- Background atmosphere ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(800px 400px at 80% -10%, rgba(212,164,96,.10), transparent 60%),
    radial-gradient(700px 500px at 10% 20%, rgba(80,120,160,.06), transparent 60%);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(10px);
  background: rgba(10,13,18,.65);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; letter-spacing: .14em;
  font-size: 14px;
}
.brand-mark { color: var(--accent); font-size: 16px; transform: translateY(-1px); }
.brand-word { font-family: var(--font-display); }
.brand-x { color: var(--accent); }
.nav-links {
  display: flex; align-items: center; gap: 26px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em;
}
.nav-links a {
  color: var(--text-dim); text-decoration: none; transition: color .15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--line-2);
  padding: 8px 14px; border-radius: var(--radius);
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

@media (max-width: 760px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) clamp(20px, 5vw, 56px);
}
.section-tinted {
  max-width: none;
  background: linear-gradient(180deg, rgba(255,255,255,.012), rgba(255,255,255,0));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-tinted > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-tinted .section-head,
.section-tinted .halves,
.section-tinted .audit-grid,
.section-tinted .team,
.section-tinted .team-foot,
.section-tinted .halves-foot { padding-left: clamp(20px, 5vw, 56px); padding-right: clamp(20px, 5vw, 56px); }

.section-head { max-width: 880px; margin-bottom: 56px; }
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 14px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 18px;
}
.section-head .lede {
  font-size: 17px; color: var(--text-dim); max-width: 720px;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 14vw, 160px) clamp(20px, 5vw, 56px) clamp(80px, 10vw, 120px);
}
.hero-meta { margin-bottom: 24px; }
.tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em;
  color: var(--accent);
  padding: 7px 14px;
  border: 1px solid rgba(212,164,96,.35);
  border-radius: 999px;
  background: rgba(212,164,96,.06);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0 0 28px;
  max-width: 16ch;
}
.accent { color: var(--accent); }
.hero-sub {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--text-dim);
  max-width: 62ch;
  margin: 0 0 36px;
}
.hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 64px;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #16110a;
  border: 1px solid var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-stats > div {
  padding: 22px 22px 22px 0;
  border-right: 1px solid var(--line);
}
.hero-stats > div:last-child { border-right: 0; }
.hero-stats > div:not(:first-child) { padding-left: 22px; }
.hero-stats dt {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px;
}
.hero-stats dd {
  margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 500;
  color: var(--text);
}
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats > div:nth-child(2) { border-right: 0; }
  .hero-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- Problem (grid-2) ---------- */
.grid-2 {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px;
}
@media (max-width: 880px) { .grid-2 { grid-template-columns: 1fr; gap: 32px; } }
.prose p { color: var(--text-dim); margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 600; }

.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
}
.callout-row {
  display: grid; grid-template-columns: 16px 1fr; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.callout-row:last-child { border-bottom: 0; padding-bottom: 0; }
.callout-row:first-child { padding-top: 0; }
.callout-row span {
  color: var(--accent); font-family: var(--font-mono); transform: translateY(2px);
}
.callout-row p { margin: 0; color: var(--text-dim); }
.callout strong { color: var(--text); }

/* ---------- Cards-3 (principles) ---------- */
.cards-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 880px) { .cards-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card header { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.card-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  letter-spacing: .12em;
}
.card h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
  margin: 0; letter-spacing: -.005em;
}
.card p { margin: 0; color: var(--text-dim); }
.card em { color: var(--accent); font-style: normal; }

/* ---------- Halves (Cited Synthesis / Rational Wargame) ---------- */
.halves {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-bottom: 28px;
}
@media (max-width: 880px) { .halves { grid-template-columns: 1fr; } }
.half {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}
.half::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}
.half-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.half h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 2vw, 24px); margin: 0 0 14px; letter-spacing: -.005em;
}
.half > p { color: var(--text-dim); margin: 0 0 20px; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li {
  padding-left: 22px;
  position: relative;
  color: var(--text-dim);
  margin: 8px 0;
  font-size: 14.5px;
}
.ticks li::before {
  content: "→"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-family: var(--font-mono);
}
.halves-foot {
  color: var(--text-dim); font-style: italic;
  max-width: 80ch; margin: 24px auto 0;
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--line);
}

/* ---------- Architecture ---------- */
.arch-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 980px) { .arch-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .arch-grid { grid-template-columns: 1fr; } }
.arch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  transition: border-color .2s ease, background .2s ease;
}
.arch:hover { border-color: var(--accent); }
.arch-id {
  font-family: var(--font-mono);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 600; font-size: 14px;
  margin-bottom: 16px;
}
.arch h3 {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  margin: 0 0 4px; letter-spacing: -.005em;
}
.arch-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 14px;
}
.arch > p:last-child { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- Audit grid ---------- */
.audit-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
@media (max-width: 760px) { .audit-grid { grid-template-columns: 1fr; } }
.audit {
  padding: 32px 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.audit:nth-child(2n) { border-right: 0; }
.audit:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 760px) {
  .audit { border-right: 0; }
  .audit:not(:last-child) { border-bottom: 1px solid var(--line); }
}
.audit h4 {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  margin: 0 0 10px; color: var(--text);
}
.audit p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- Segments ---------- */
.segs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 880px) { .segs { grid-template-columns: 1fr; } }
.seg {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s ease, border-color .2s ease;
}
.seg:hover { transform: translateY(-2px); border-color: var(--line-2); }
.seg header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.seg-id {
  font-family: var(--font-mono); color: var(--accent); font-size: 12px; letter-spacing: .14em;
}
.seg h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0;
}
.seg p { margin: 0; color: var(--text-dim); }

/* ---------- Team ---------- */
.team {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 760px) { .team { grid-template-columns: 1fr; } }
.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: grid; grid-template-columns: 72px 1fr; gap: 22px;
  align-items: start;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(212,164,96,.25), rgba(212,164,96,.05));
  border: 1px solid rgba(212,164,96,.35);
  flex-shrink: 0;
}
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-initials,
.avatar > span {
  font-family: var(--font-display); font-weight: 600; font-size: 22px;
  color: var(--accent);
  letter-spacing: .04em;
}
.person h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 20px; margin: 0 0 4px;
}
.person .role {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px;
}
.person p:last-child { margin: 0; color: var(--text-dim); }
.team-foot {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  color: var(--text-dim); font-size: 14.5px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.team-foot strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 4px; }
@media (max-width: 760px) { .team-foot { grid-template-columns: 1fr; } }

/* ---------- CTA ---------- */
.section-cta {
  padding: clamp(60px, 10vw, 120px) clamp(20px, 5vw, 56px);
}
.cta-card {
  max-width: 900px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(212,164,96,.06), rgba(212,164,96,.02));
  border: 1px solid rgba(212,164,96,.25);
  border-radius: var(--radius);
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
}
.cta-card .kicker { color: var(--accent); }
.cta-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.01em;
  margin: 0 0 14px;
}
.cta-card p {
  color: var(--text-dim);
  max-width: 64ch; margin: 0 auto 30px;
}
.cta-card em { color: var(--accent); font-style: normal; }
.cta-row {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 28px clamp(20px, 5vw, 56px);
}
.foot-row {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.foot-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600;
  letter-spacing: .14em; font-size: 13px;
}
.foot-meta {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.dot { color: var(--line-2); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
