/* CrossExamine — public site.
   Palette is lifted from lib/core/theme/app_colors.dart so the site and the
   app read as one product. The two rules from that file hold here too:
   GREEN is every filled button, GOLD is accent only and never a button fill.

   🔴 ONE DELIBERATE DIVERGENCE: the PAGE BACKGROUND is deeper than the app's
   #4FA8E0 → #2F79C4 sky. Measured contrast on the app's gradient:

       gold #D4A843 on #4FA8E0 ....... 1.18  ← fails, badly
       gold #D4A843 on #2F79C4 ....... 2.04  ← fails
       cream #F6F1E4 on #4FA8E0 ...... 2.32  ← fails
       secondary #CFE4F5 on #4FA8E0 .. 2.01  ← fails

   frontend-standards.md predicted exactly this ("gold on sky blue is a far
   weaker pair than gold on near-black"). The app gets away with it because it
   paints text onto NAVY PANELS and PARCHMENT, never onto the sky itself. This
   site puts long-form prose directly on the background, so the background has
   to carry the contrast. The stops below measure:

       gold ......... 3.43 → 4.56 → 5.78   (AA; AA-normal from the second stop)
       cream ........ 6.74 → 8.95 → 11.36  (AA throughout)
       secondary .... 5.82 → 7.72 → 9.80   (AA throughout)

   ⚠️ Do not lighten these back toward the app values without re-measuring.
   The sky tones are kept as tokens below because accents still use them. */

:root {
  --sky-base: #2F79C4;
  --sky-light: #4FA8E0;
  --page-top: #21568A;
  --page-mid: #1A4370;
  --page-base: #153356;
  --primary-blue: #1A3A6B;
  --outline-dark: #12294D;
  --parchment: #F4E9D2;
  --ink: #16232E;
  --action-green: #4CAF6A;
  --action-green-light: #6FC98A;
  --action-green-dark: #2E7D4A;
  --accent-gold: #D4A843;
  --accent-gold-light: #F2C963;
  --accent-gold-dark: #A8792A;
  --text-primary: #F6F1E4;
  --text-secondary: #CFE4F5;
  --hairline: #2D5A8F;

  --radius: 14px;
  --stroke: 3px solid var(--outline-dark);
  --measure: 68ch;
  --shell: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--page-mid);
  background-image: linear-gradient(180deg, var(--page-top) 0%, var(--page-mid) 46%, var(--page-base) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 20px; }

/* ── skip link ───────────────────────────────────────────────────────── */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent-gold); color: var(--ink);
  padding: 10px 18px; border-radius: 0 0 var(--radius) 0; font-weight: 700;
}
.skip:focus { left: 0; }

/* ── header ──────────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary-blue);
  border-bottom: var(--stroke);
  position: sticky; top: 0; z-index: 50;
}
.site-header .shell {
  display: flex; align-items: center; gap: 18px;
  min-height: 66px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.wordmark {
  font-size: 1.22rem; font-weight: 800; letter-spacing: .2px;
  color: var(--text-primary); text-decoration: none; margin-right: auto;
}
.wordmark span { color: var(--accent-gold); }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-header nav a {
  color: var(--text-secondary); text-decoration: none;
  padding: 7px 12px; border-radius: 9px; font-size: .95rem; font-weight: 600;
}
.site-header nav a:hover, .site-header nav a:focus-visible { background: #22497F; color: var(--text-primary); }
.site-header nav a[aria-current="page"] { color: var(--accent-gold); background: #14315C; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; font: inherit; font-weight: 800; cursor: pointer;
  padding: 13px 26px; border-radius: 12px; text-decoration: none; text-align: center;
  color: #08281A; background: var(--action-green);
  background-image: linear-gradient(180deg, var(--action-green-light), var(--action-green));
  border: var(--stroke); border-bottom-width: 5px; border-bottom-color: var(--action-green-dark);
}
.btn:hover { background-image: linear-gradient(180deg, #82D69B, var(--action-green-light)); }
.btn:active { transform: translateY(2px); border-bottom-width: 3px; }
.btn-quiet {
  color: var(--text-primary); background: transparent; background-image: none;
  border: var(--stroke); border-bottom-width: 5px; border-bottom-color: var(--outline-dark);
}
.btn-quiet:hover { background: #1C4278; background-image: none; }

/* ── panels ──────────────────────────────────────────────────────────── */
.paper {
  background: var(--parchment); color: var(--ink);
  border: var(--stroke); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 46px);
}
.paper a { color: #17457F; }
.paper h1, .paper h2, .paper h3 { color: #0F2F5C; }

/* ── sections ────────────────────────────────────────────────────────── */
section { padding: 54px 0; }
h1, h2, h3 { line-height: 1.22; margin: 0 0 .5em; }
h1 { font-size: clamp(2.05rem, 5.4vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.05rem); color: var(--accent-gold); font-weight: 800; }
h3 { font-size: 1.14rem; font-weight: 800; }
p { max-width: var(--measure); }
.lede { font-size: clamp(1.05rem, 2.1vw, 1.28rem); color: var(--text-secondary); }
.center-note { text-align: center; color: var(--text-secondary); font-size: .95rem; }

.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .1em;
  font-size: .74rem; font-weight: 800; color: var(--ink);
  background: var(--accent-gold); padding: 5px 12px; border-radius: 999px;
  border: 2px solid var(--accent-gold-dark); margin-bottom: 18px;
}

/* ── hero ────────────────────────────────────────────────────────────── */
.hero { padding-top: 56px; padding-bottom: 26px; }
.hero p.lede { margin-bottom: 26px; }

/* ── early access form ───────────────────────────────────────────────── */
.signup { margin-top: 8px; max-width: 560px; }
.signup form { display: flex; gap: 10px; flex-wrap: wrap; }
.signup label.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.signup input[type="email"] {
  flex: 1 1 250px; font: inherit; padding: 13px 15px;
  border-radius: 12px; border: var(--stroke);
  background: var(--parchment); color: var(--ink);
}
.signup input[type="email"]:focus-visible { outline: 3px solid var(--accent-gold); outline-offset: 2px; }
.signup .note { font-size: .87rem; color: var(--text-secondary); margin-top: 10px; }
.form-status { margin-top: 12px; font-weight: 700; min-height: 1.4em; }
.form-status[data-state="ok"] { color: var(--accent-gold-light); }
.form-status[data-state="error"] { color: #FFD2C9; }

/* ── grids ───────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(268px, 100%), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.card { background: var(--primary-blue); border: var(--stroke); border-radius: var(--radius); padding: 22px; }
.card h3 { color: var(--accent-gold); margin-bottom: .35em; }
.card p { color: var(--text-secondary); font-size: .97rem; margin: 0; max-width: none; }
.card .tag {
  display: inline-block; font-size: .71rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-secondary);
  border: 2px solid var(--hairline); border-radius: 999px;
  padding: 3px 9px; margin-bottom: 10px;
}

/* ── stats ───────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(168px, 100%), 1fr)); gap: 16px; }
.stat { text-align: center; padding: 18px 12px; background: #163460; border: var(--stroke); border-radius: var(--radius); }
.stat b { display: block; font-size: 1.65rem; color: var(--accent-gold); }
.stat span { font-size: .86rem; color: var(--text-secondary); }

/* ── pricing ─────────────────────────────────────────────────────────── */
.tiers { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); align-items: start; }
.tier { background: var(--primary-blue); border: var(--stroke); border-radius: var(--radius); padding: 26px; }
.tier.featured { border-color: var(--accent-gold); }
.tier h3 { color: var(--accent-gold); font-size: 1.3rem; margin-bottom: 2px; }
.tier .price { font-size: 2.4rem; font-weight: 800; line-height: 1.15; }
.tier .price small { font-size: .92rem; font-weight: 600; color: var(--text-secondary); }
.tier .blurb { color: var(--text-secondary); font-size: .95rem; margin: 6px 0 0; max-width: none; }
.tier ul { list-style: none; padding: 0; margin: 18px 0 22px; }
.tier li { padding: 7px 0 7px 26px; position: relative; color: var(--text-secondary); font-size: .96rem; }
.tier li::before { content: "\2713"; position: absolute; left: 0; color: var(--action-green-light); font-weight: 800; }
.tier li.none { color: #8FB3D6; }
.tier li.none::before { content: "\2014"; color: #7FA5CF; }

.table-wrap { overflow-x: auto; border: var(--stroke); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 560px; background: var(--primary-blue); }
th, td { padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--hairline); font-size: .95rem; }
thead th { background: #14315C; color: var(--accent-gold); font-size: .84rem; text-transform: uppercase; letter-spacing: .05em; }
tbody th { font-weight: 600; color: var(--text-primary); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
td { color: var(--text-secondary); }
td:not(:first-child), thead th:not(:first-child) { text-align: center; }

/* ── legal documents ─────────────────────────────────────────────────── */
.legal { padding-top: 40px; }
.legal .paper h2 { margin-top: 1.9em; font-size: 1.3rem; }
.legal .paper h2:first-of-type { margin-top: 1em; }
.legal .paper ul, .legal .paper ol { padding-left: 22px; }
.legal .paper li { margin-bottom: .45em; max-width: var(--measure); }
/* Legal tables live inside a .table-wrap so they scroll on their own rather
   than pushing the page sideways — found at 375px, where the privacy tables
   overflowed by 91px. The wrapper's dark stroke is wrong on parchment, so it
   is restated here in the parchment palette. */
.legal .table-wrap { border: 2px solid #C9B48A; margin: 12px 0 18px; }
.legal .paper table { background: #FFFFFF80; min-width: 420px; }
.legal .paper thead th { background: #E3D4B4; color: #0F2F5C; }
/* The centring above is for the pricing grid's short "5 / day" cells. Legal
   tables hold sentences, and centred prose is unreadable — restate left. */
.legal .paper th, .legal .paper td {
  border-bottom: 1px solid #C9B48A; color: var(--ink); text-align: left;
}
.updated { font-size: .9rem; color: #4A5B6B; font-style: italic; }
.toc { background: #FFFFFF8C; border: 2px solid #C9B48A; border-radius: 10px; padding: 14px 20px; margin-bottom: 8px; }
.toc ol { margin: 0; }
.toc li { margin-bottom: .25em; }

/* ── faq ─────────────────────────────────────────────────────────────── */
details.faq { border: var(--stroke); border-radius: var(--radius); background: var(--primary-blue); margin-bottom: 12px; }
details.faq summary { cursor: pointer; padding: 16px 22px; font-weight: 800; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "+ "; color: var(--accent-gold); font-weight: 800; }
details.faq[open] summary::before { content: "\2013 "; }
details.faq .body { padding: 0 22px 18px; color: var(--text-secondary); }
details.faq .body p { margin-top: 0; }

/* ── footer ──────────────────────────────────────────────────────────── */
.site-footer { background: var(--outline-dark); border-top: var(--stroke); padding: 40px 0 54px; margin-top: 30px; }
.site-footer .cols { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.site-footer h4 { color: var(--accent-gold); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { color: var(--text-secondary); text-decoration: none; font-size: .94rem; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--text-primary); text-decoration: underline; }
.site-footer .fine { margin-top: 30px; font-size: .87rem; color: #9DBFDF; max-width: var(--measure); }

/* ── focus ───────────────────────────────────────────────────────────── */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent-gold); outline-offset: 3px; border-radius: 6px;
}
