/*
 * Angelia landing — styles
 *
 * Tokens are inlined from packages/theme/tokens.css rather than @imported: a
 * second stylesheet is a second blocking request, and the performance budget
 * in docs/LANDING.md is part of the argument the page is making. Keep the two
 * files in sync; every value below carries its computed WCAG ratio.
 *
 * HARD RULE: --ichor (#eebc15) is 1.57:1 on --pentelic. It gilds edges and
 * seals. It is NEVER text on a light surface. See docs/BRAND.md.
 *
 * Dark-first: ichor is AAA (9.95:1) on Nyx and unusable as text on marble, so
 * dark is the mode the metaphor was designed for.
 */

/* ── tokens: dark (default) ─────────────────────────────────── */
:root {
  --ichor:    #eebc15;   /* 9.95:1 on nyx — AAA */
  --tyrian:   #58326f;
  --laurel:   #2c8136;

  --pentelic: #f4f1ea;
  --nyx:      #0e1a22;
  --aegean:   #10394f;
  --ink:      #1a1614;
  --lethe:    #586672;

  --surface:        var(--nyx);
  --surface-raised: #16242e;
  --surface-sunken: #0a1319;
  --border:         #24333e;
  --border-strong:  #3a4c59;

  --text:           var(--pentelic);  /* 15.65:1 AAA */
  --text-secondary: #b9c4cc;          /*  9.71:1 AAA */
  --text-muted:     #8a99a4;          /*  6.03:1 AA  */
  --text-accent:    #b795d1;          /*  6.92:1 AA  */

  --ichor-edge: var(--ichor);
  --ichor-text: var(--ichor);         /*  9.95:1 — gold IS text on dark */
  --divine-surface: #1e2630;
  --aegis-edge:     #b795d1;
  --aegis-surface:  #211b2a;
  --verified:       #52b788;          /*  7.14:1 AAA */

  --radius:    0.5rem;
  --radius-lg: 0.875rem;
  --gild:      3px;

  --font-display: "Cardo", "Gentium Plus", Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;

  --wrap: 68rem;
  --step: clamp(3rem, 7vw, 5.5rem);
}

/* ── tokens: light ──────────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --surface:        var(--pentelic);
    --surface-raised: #fbf9f5;
    --surface-sunken: #e9e4d9;
    --border:         #d9d2c4;
    --border-strong:  #b9af9c;

    --text:           var(--ink);      /* 15.93:1 AAA */
    --text-secondary: var(--aegean);   /* 10.82:1 AAA */
    --text-muted:     var(--lethe);    /*  5.23:1 AA  */
    --text-accent:    var(--tyrian);   /*  8.86:1 AAA */

    --ichor-edge: #a87f08;             /*  3.26:1 — non-text UI only */
    --ichor-text: #7a5f04;             /*  5.37:1 AA — gold-family TEXT */
    --divine-surface: #fdf6e0;
    --aegis-edge:     var(--tyrian);
    --aegis-surface:  #f3edf7;
    --verified:       #1e5128;         /*  8.23:1 AAA */
  }
}

/* ── reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd, figure { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ichor-edge);
  outline-offset: 3px;
}

code { font-family: var(--font-mono); font-size: 0.9em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -999px;
  background: var(--surface-raised); color: var(--text);
  padding: 0.75rem 1rem; z-index: 10; border-radius: var(--radius);
}
.skip:focus { left: 1rem; top: 1rem; }

/* ── masthead ───────────────────────────────────────────────── */
.masthead {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 5;
}
.masthead-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 0.9rem 0;
}
.wordmark { text-decoration: none; display: inline-flex; align-items: baseline; gap: 0.6rem; }
.wordmark-gr {
  font-family: var(--font-display);
  font-size: 1.3rem; letter-spacing: 0.14em;
  border-bottom: 2px solid var(--ichor-edge); padding-bottom: 2px;
}
.wordmark-la { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.03em; }
.masthead nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.masthead nav a { color: var(--text-secondary); text-decoration: none; font-size: 0.94rem; }
.masthead nav a:hover { color: var(--text); text-decoration: underline; }

/* ── hero ───────────────────────────────────────────────────── */
.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 var(--step); }
.eyebrow {
  font-family: var(--font-display);
  color: var(--ichor-text);
  letter-spacing: 0.13em; text-transform: uppercase;
  font-size: 0.82rem; margin-bottom: 1.1rem;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.2vw, 4.1rem);
  line-height: 1.08; font-weight: 600; letter-spacing: -0.015em;
  margin-bottom: 1.4rem;
}
.lede {
  font-size: clamp(1.06rem, 1.9vw, 1.28rem);
  color: var(--text-secondary); max-width: 46rem; margin-bottom: 2rem;
}
.lede strong { color: var(--text); font-weight: 600; }

.cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.btn {
  display: inline-block; padding: 0.72rem 1.35rem;
  border-radius: var(--radius); text-decoration: none;
  font-weight: 600; font-size: 0.97rem; border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--ichor); color: #241c00; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--ichor-edge); }

.stage-note {
  font-size: 0.93rem; color: var(--text-muted);
  border-left: var(--gild) solid var(--border-strong);
  padding: 0.55rem 0 0.55rem 1rem; max-width: 44rem;
}
.stage-note strong { color: var(--text-secondary); }
.dot {
  display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--ichor); margin-right: 0.45rem; vertical-align: 0.08em;
}

/* ── sections ───────────────────────────────────────────────── */
.section { padding-block: var(--step); border-top: 1px solid var(--border); }
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.15; font-weight: 600; margin-bottom: 1rem;
}
h3 { font-size: 1.06rem; margin-bottom: 0.5rem; letter-spacing: -0.005em; }
.section-lede {
  color: var(--text-secondary); max-width: 46rem; margin-bottom: 2.4rem;
  font-size: 1.03rem;
}

/* ── the demo timeline ──────────────────────────────────────── */
.demo {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.6vw, 1.8rem);
  display: grid; gap: 0.85rem;
}
.msg {
  background: var(--surface-raised);
  border-left: var(--gild) solid transparent;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  max-width: 42rem;
}
.msg--divine {
  background: var(--divine-surface);
  border-left-color: var(--ichor-edge);
}
.msg-who {
  font-size: 0.79rem; font-weight: 700; letter-spacing: 0.045em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.3rem;
}
.msg--divine .msg-who { color: var(--ichor-text); }
.seal {
  font-size: 0.66rem; letter-spacing: 0.09em;
  border: 1px solid var(--ichor-edge); border-radius: 99px;
  padding: 0.06rem 0.42rem; margin-left: 0.45rem;
}
.msg-body { color: var(--text); }
.msg-body code {
  background: var(--surface-sunken); padding: 0.08rem 0.32rem;
  border-radius: 4px; border: 1px solid var(--border);
}

/* ── Aegis gate ─────────────────────────────────────────────── */
.aegis {
  background: var(--aegis-surface);
  border: 1px solid var(--aegis-edge);
  border-left-width: var(--gild);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  max-width: 42rem;
}
.aegis-head {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 0.83rem; letter-spacing: 0.075em;
  text-transform: uppercase; color: var(--text-accent); margin-bottom: 0.9rem;
}
.aegis-mark { font-size: 1.05rem; }
.aegis-facts { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.aegis-facts > div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; }
.aegis-facts dt { color: var(--text-muted); font-size: 0.85rem; }
.aegis-facts dd { margin: 0; font-size: 0.93rem; }
.aegis-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.aegis-actions .btn { padding: 0.42rem 0.95rem; font-size: 0.88rem; }
.btn-approve { background: var(--verified); color: var(--surface); }
.btn-deny, .btn-modify { border-color: var(--border-strong); color: var(--text-secondary); }
.aegis-note {
  font-size: 0.85rem; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 0.75rem;
}

.caption {
  font-size: 0.86rem; color: var(--text-muted);
  margin-top: 1rem; max-width: 42rem;
}

/* ── cards ──────────────────────────────────────────────────── */
.cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.35rem; background: var(--surface-raised);
}
.card p { color: var(--text-secondary); font-size: 0.96rem; }

/* ── truth table ────────────────────────────────────────────── */
.truth { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.truth th {
  text-align: left; font-size: 0.78rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-muted);
  padding-bottom: 0.65rem; border-bottom: 1px solid var(--border-strong);
}
.truth td { padding: 0.8rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.truth td:last-child { text-align: right; white-space: nowrap; }
.pill {
  display: inline-block; font-size: 0.79rem; font-weight: 600;
  padding: 0.14rem 0.6rem; border-radius: 99px; border: 1px solid;
}
.pill-done { color: var(--verified); border-color: var(--verified); }
.pill-wip  { color: var(--ichor-text); border-color: var(--ichor-edge); }
.pill-todo { color: var(--text-muted); border-color: var(--border-strong); }

/* ── two column ─────────────────────────────────────────────── */
.two-col { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }
.two-col p { color: var(--text-secondary); margin-bottom: 1rem; max-width: 34rem; }
.two-col strong { color: var(--text); }
.claim-box {
  border: 1px solid var(--ichor-edge); border-left-width: var(--gild);
  border-radius: var(--radius-lg); padding: 1.35rem; background: var(--divine-surface);
}
.claim-box h3 { color: var(--ichor-text); }
.claim-kicker { color: var(--text) !important; font-weight: 600; margin-bottom: 0 !important; }

/* ── follow ─────────────────────────────────────────────────── */
.signup { display: flex; gap: 0.6rem; flex-wrap: wrap; max-width: 30rem; margin-bottom: 1rem; }
.signup input {
  flex: 1 1 15rem; padding: 0.72rem 0.95rem; font: inherit; font-size: 0.97rem;
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.signup input::placeholder { color: var(--text-muted); }
.fineprint { font-size: 0.86rem; color: var(--text-muted); max-width: 38rem; }

/* ── footer ─────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.5rem 1.75rem; margin-top: var(--step); }
.footer-in { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-mark {
  font-family: var(--font-display); letter-spacing: 0.14em;
  font-size: 1.05rem; margin-bottom: 0.4rem;
}
.footer-note { font-size: 0.87rem; color: var(--text-muted); max-width: 27rem; }
.site-footer nav { display: flex; gap: 1.3rem; align-items: flex-start; flex-wrap: wrap; }
.site-footer nav a { color: var(--text-secondary); font-size: 0.92rem; text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; }
.footer-legal {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}
