/* ============================================================
   Ancient Holdings — Stoic Engine Program
   Shared design system.  Dark-first "aerospace × stoic" theme.
   ============================================================ */

/* ---- Fonts (Google Fonts, with robust system fallbacks) ---- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---- Design tokens ---- */
:root {
  /* palette */
  --bg:            #080a0f;
  --bg-2:          #0b0e14;
  --panel:         #10151e;
  --panel-2:       #141b26;
  --panel-3:       #1a2231;
  --line:          rgba(255, 255, 255, 0.09);
  --line-strong:   rgba(255, 255, 255, 0.16);

  --ink:           #eef2f8;
  --ink-soft:      #c2cbd8;
  --ink-mute:      #8591a3;
  --ink-faint:     #5d6675;

  /* accents */
  --gold:          #c8a35b;   /* heritage / vision */
  --gold-soft:     #e3c893;
  --cyan:          #58cfe6;   /* energy / electric */
  --cyan-soft:     #9fe6f2;
  --violet:        #8c7bf0;   /* gravitic / exotic */
  --green:         #6cc08a;
  --amber:         #e0a94a;
  --red:           #e0735f;

  /* status */
  --st-settled:    #6cc08a;
  --st-derived:    #58cfe6;
  --st-open:       #e0a94a;
  --st-target:     #8c7bf0;

  /* type */
  --f-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --f-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono:    'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  /* layout */
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  --header-h: 64px;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 18px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(88, 207, 230, 0.10), transparent 60%),
    radial-gradient(900px 560px at 8% 2%, rgba(200, 163, 91, 0.10), transparent 58%),
    radial-gradient(1200px 900px at 50% 118%, rgba(140, 123, 240, 0.08), transparent 60%),
    var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--cyan-soft); }

h1, h2, h3, h4 { color: var(--ink); font-family: var(--f-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
strong { color: var(--ink); font-weight: 600; }

::selection { background: rgba(200, 163, 91, 0.3); color: #fff; }

/* ---- Layout helpers ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--line); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); opacity: .7; }

.lede { font-size: clamp(1.02rem, 1.4vw, 1.2rem); color: var(--ink-soft); max-width: 68ch; }
.muted { color: var(--ink-mute); }
.center { text-align: center; }
.center .eyebrow { justify-content: center; }
.center .lede { margin-left: auto; margin-right: auto; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(8, 10, 15, 0.72);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--f-mono); font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink); }
.brand__sub  { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--ink-mute);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  position: relative;
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
}

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  color: var(--ink); border-radius: 8px; width: 40px; height: 36px; cursor: pointer;
  font-size: 18px; align-items: center; justify-content: center;
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding: 92px 0 64px; overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero h1 .accent { color: transparent; background: linear-gradient(100deg, var(--gold-soft), var(--gold) 45%, var(--cyan)); -webkit-background-clip: text; background-clip: text; }
.hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.hero__art { position: relative; aspect-ratio: 1 / 1; }
.hero__art svg { width: 100%; height: 100%; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-body); font-size: 14.5px; font-weight: 600;
  padding: 12px 20px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: all .18s ease; white-space: nowrap;
}
.btn--primary { background: linear-gradient(100deg, var(--gold), var(--gold-soft)); color: #241b07; }
.btn--primary:hover { color: #241b07; transform: translateY(-1px); box-shadow: 0 12px 28px -12px rgba(200, 163, 91, 0.6); }
.btn--ghost { background: rgba(255, 255, 255, 0.03); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { color: var(--ink); border-color: var(--cyan); background: rgba(88, 207, 230, 0.07); }
.btn__arrow { transition: transform .18s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ============================================================
   Stat band
   ============================================================ */
.statband {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-top: 8px;
}
.stat { background: var(--panel); padding: 22px 20px; }
.stat__num { font-family: var(--f-display); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; color: var(--ink); line-height: 1; }
.stat__num .u { font-family: var(--f-mono); font-size: 0.5em; color: var(--gold); font-weight: 500; margin-left: 3px; }
.stat__label { font-size: 12.5px; color: var(--ink-mute); margin-top: 8px; letter-spacing: 0.02em; }

/* ============================================================
   Cards & grids
   ============================================================ */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  transition: border-color .2s ease, transform .2s ease;
}
.card--link:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card__icon {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(200, 163, 91, 0.1); border: 1px solid rgba(200, 163, 91, 0.25);
  color: var(--gold); margin-bottom: 16px;
}
.card__icon svg { width: 22px; height: 22px; }
.card--cyan .card__icon { background: rgba(88, 207, 230, 0.1); border-color: rgba(88, 207, 230, 0.25); color: var(--cyan); }
.card--violet .card__icon { background: rgba(140, 123, 240, 0.1); border-color: rgba(140, 123, 240, 0.25); color: var(--violet); }
.card h3 { font-size: 1.28rem; margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card__more { font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-top: 16px; display: inline-flex; gap: 6px; }
.card--cyan .card__more { color: var(--cyan); }

/* feature row */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.feature--rev .feature__media { order: 2; }
.feature__media { border-radius: var(--radius); overflow: hidden; }

/* ============================================================
   Spec tables
   ============================================================ */
.spec-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.spec-title h3 { font-size: 1.2rem; margin: 0; }
.spec-title .tag { font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .1em; text-transform: uppercase; }

.spec {
  width: 100%; border-collapse: collapse;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  font-size: 14.5px;
}
.spec caption {
  text-align: left; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold); padding: 16px 20px 0;
}
.spec th, .spec td { padding: 11px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec thead th {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 500; background: rgba(255, 255, 255, 0.02);
}
.spec tbody tr:last-child td { border-bottom: none; }
.spec tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.spec td:first-child { color: var(--ink-soft); }
.spec .num, .spec td.num { font-family: var(--f-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.spec .hl { color: var(--gold-soft); font-weight: 600; }
.spec__scroll { overflow-x: auto; border-radius: var(--radius); }

/* comparison emphasis col */
.spec col.col-a { background: rgba(88, 207, 230, 0.03); }
.spec col.col-b { background: rgba(200, 163, 91, 0.04); }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px; border: 1px solid; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--settled { color: var(--st-settled); border-color: rgba(108, 192, 138, 0.35); background: rgba(108, 192, 138, 0.08); }
.pill--derived { color: var(--st-derived); border-color: rgba(88, 207, 230, 0.35); background: rgba(88, 207, 230, 0.08); }
.pill--open    { color: var(--st-open);    border-color: rgba(224, 169, 74, 0.35); background: rgba(224, 169, 74, 0.08); }
.pill--target  { color: var(--st-target);  border-color: rgba(140, 123, 240, 0.35); background: rgba(140, 123, 240, 0.08); }

/* ============================================================
   Callouts
   ============================================================ */
.callout {
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(200, 163, 91, 0.08), transparent 80%);
  padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 24px 0;
}
.callout--cyan { border-color: var(--cyan); background: linear-gradient(90deg, rgba(88, 207, 230, 0.08), transparent 80%); }
.callout--violet { border-color: var(--violet); background: linear-gradient(90deg, rgba(140, 123, 240, 0.08), transparent 80%); }
.callout__k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 6px; }
.callout--cyan .callout__k { color: var(--cyan); }
.callout--violet .callout__k { color: var(--violet); }
.callout p:last-child { margin-bottom: 0; }

/* axiom block (big) */
.axiom {
  display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center;
  background: radial-gradient(500px 200px at 0% 0%, rgba(140, 123, 240, 0.12), transparent), var(--panel);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 28px 32px;
}
.axiom__big { font-family: var(--f-display); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 600; color: var(--violet); line-height: 1; white-space: nowrap; }
.axiom__big .u { font-family: var(--f-mono); font-size: .4em; color: var(--ink-mute); display: block; margin-top: 8px; letter-spacing: .1em; }

/* bullet list */
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-soft); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 10px; height: 10px;
  border: 2px solid var(--gold); border-radius: 50%;
}
.ticks--cyan li::before { border-color: var(--cyan); }
.ticks strong { color: var(--ink); }

/* numbered steps */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { position: relative; padding-left: 46px; counter-increment: s; color: var(--ink-soft); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 13px; color: var(--gold);
  background: rgba(200, 163, 91, 0.08); border: 1px solid rgba(200, 163, 91, 0.25);
}

/* ============================================================
   Figure cards (CAD drawings) — light "drawing sheet"
   ============================================================ */
.figure {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.figure__sheet {
  background:
    linear-gradient(rgba(10, 30, 50, 0.04) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(10, 30, 50, 0.04) 1px, transparent 1px) 0 0 / 22px 22px,
    #f3f5f7;
  padding: 18px; display: grid; place-items: center;
}
.figure__sheet img { mix-blend-mode: multiply; }
.figure__cap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-mute);
}
.figure__cap b { color: var(--ink); font-weight: 600; }
.figure__cap .code { font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .08em; }

/* model/download links list */
.filelist { display: grid; gap: 10px; }
.filerow {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; transition: border-color .18s ease, background .18s ease;
}
.filerow:hover { border-color: var(--line-strong); background: var(--panel-2); }
.filerow__ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(88, 207, 230, 0.1); color: var(--cyan); }
.filerow__ic svg { width: 18px; height: 18px; }
.filerow__meta { flex: 1; min-width: 0; }
.filerow__meta b { color: var(--ink); font-weight: 600; display: block; font-size: 14.5px; }
.filerow__meta span { font-size: 12.5px; color: var(--ink-mute); }
.filerow__type { font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .08em; }

/* embedded interactive viewers (iframes) */
.embed { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #14171a; box-shadow: var(--shadow-soft); }
.embed iframe { display: block; width: 100%; height: clamp(500px, 72vh, 760px); border: 0; background: #14171a; }
.embed__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-mute); background: var(--panel); }
.embed__bar b { color: var(--ink); font-weight: 600; }
.embed__bar a { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; white-space: nowrap; }

/* ============================================================
   Timeline / roadmap
   ============================================================ */
.timeline { position: relative; display: grid; gap: 26px; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--gold), var(--cyan), var(--violet)); opacity: .5; }
.tl { position: relative; }
.tl::before {
  content: ""; position: absolute; left: -34px; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--gold); box-shadow: 0 0 0 4px var(--bg);
}
.tl[data-phase="now"]::before { border-color: var(--cyan); box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(88,207,230,.6); }
.tl[data-phase="far"]::before { border-color: var(--violet); }
.tl__when { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.tl[data-phase="now"] .tl__when { color: var(--cyan); }
.tl[data-phase="far"] .tl__when { color: var(--violet); }
.tl h3 { font-size: 1.22rem; margin: 4px 0 6px; }
.tl p { margin: 0; color: var(--ink-mute); }

/* ============================================================
   Misc
   ============================================================ */
.note { font-size: 13.5px; color: var(--ink-faint); }
.kbd { font-family: var(--f-mono); font-size: 12.5px; background: var(--panel-3); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 7px; color: var(--ink); }
.divider { height: 1px; background: var(--line); border: none; margin: 40px 0; }
.sec-head { max-width: 72ch; margin-bottom: 36px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 40px; margin-top: 20px; background: var(--bg-2); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.site-footer .brand__name { color: var(--ink-soft); }
.foot-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-nav a { color: var(--ink-mute); font-size: 14px; }
.foot-nav a:hover { color: var(--ink); }
.foot-legal { width: 100%; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; font-size: 12.5px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 920px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 420px; margin: 8px auto 0; }
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature--rev .feature__media { order: 0; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .statband { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: rgba(8, 10, 15, 0.96); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line); padding: 10px 16px 16px;
  }
  .nav.open a { padding: 12px 14px; }
  .nav.open a.is-active::after { display: none; }
  .nav-toggle { display: inline-flex; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .section { padding: 54px 0; }
  .axiom { grid-template-columns: 1fr; text-align: left; }
  .foot-legal { flex-direction: column; }
}
