/* ==========================================================================
   Lineage — shared styles
   ========================================================================== */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #fbf6ef;
  --surface: #fffdf9;
  --surface-2: #f4ede3;
  --surface-3: #ece2d4;
  --line: #e6dbcd;
  --line-strong: #d6c7b4;

  /* Ink */
  --ink: #2a211c;
  --ink-2: #6b5e55;
  --muted: #7a6d64;

  /* Brand */
  --accent: #a84b26;
  --accent-hover: #8f3e1e;
  --accent-soft: #f6e4d9;
  --sage: #3f6b47;
  --sage-soft: #e8f0e4;
  --sage-mid: #cfe0c8;
  --gold: #d8b26e;
  --forest: #1f3a33;
  --forest-2: #284a41;
  --risk-high: #9a3b2a;
  --risk-high-soft: #fbe9e3;
  --risk-mid: #8a5a00;
  --risk-mid-soft: #fdf3dc;

  /* Data Origins palette (validated: circular adjacency, CVD ΔE ≥ 10.9) */
  --o1: #d4572a; /* Forum arguments */
  --o2: #00897b; /* Encyclopedia */
  --o3: #e0a000; /* Product reviews */
  --o4: #9b3fa0; /* Corporate press releases */
  --o5: #4e9a2e; /* Fan fiction */
  --o6: #2f63b8; /* Recipe blogs */
  --o7: #e0607e; /* Legal boilerplate */
  --o8: #5b4bb7; /* A single cooking blog, 2014 */

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  /* Shape */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(42, 33, 28, 0.06), 0 2px 8px rgba(42, 33, 28, 0.04);
  --shadow: 0 2px 4px rgba(42, 33, 28, 0.05), 0 12px 32px rgba(42, 33, 28, 0.08);
  --shadow-lg: 0 4px 8px rgba(42, 33, 28, 0.06), 0 24px 60px rgba(42, 33, 28, 0.14);

  --header-h: 72px;
  --gutter: 24px;
  --maxw: 1160px;
}

/* ---------- Reset & base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-variation-settings: "SOFT" 50, "opsz" 96;
}
h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; font-variation-settings: "SOFT" 50, "opsz" 36; }
h4 { font-size: 1.1rem; font-variation-settings: "SOFT" 50, "opsz" 24; }

p { margin: 0 0 1em; }
em { font-style: italic; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 820px; }

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--ink-2); font-size: 1.1rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 620px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--font-body);
  padding: 15px 26px; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(168, 75, 38, 0.25); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.btn-light { background: #fff; color: var(--forest); }
.btn-light:hover { background: var(--gold); color: var(--forest); }
.btn-sm { padding: 10px 18px; font-size: 0.92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn[disabled], .btn.is-done { cursor: default; transform: none; }

.text-link { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.text-link::after { content: "→"; transition: transform .2s; }
.text-link:hover::after { transform: translateX(3px); }
.text-link.back::after { content: none; }
.text-link.back::before { content: "←"; transition: transform .2s; }
.text-link.back:hover::before { transform: translateX(-3px); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(251, 246, 239, 0.88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 500; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.site-nav a:not(.btn) {
  color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.site-nav a:not(.btn):hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none; align-items: center; gap: 8px;
  background: none; border: 1.5px solid var(--line-strong); border-radius: 999px;
  padding: 8px 14px; font: 600 0.9rem var(--font-body); color: var(--ink); cursor: pointer;
}
.nav-toggle-bars { width: 16px; height: 10px; position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .2s, top .2s;
}
.nav-toggle-bars::before { top: 1px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 4px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 4px; transform: rotate(-45deg); }

@media (max-width: 1020px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 16px var(--gutter) 24px;
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a:not(.btn) { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--accent); }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 72px 0 32px; margin-top: 0; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer-tagline { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; margin: 16px 0 0; color: var(--ink); }
.footer-col h2 { font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 0.85rem; color: var(--muted);
}
.footer-bottom p { margin: 0; }
.footer-legal { max-width: 560px; }
.spoon { color: var(--muted); opacity: 0.28; transition: opacity .3s; display: inline-flex; }
.spoon:hover, .spoon:focus-visible { opacity: 0.9; color: var(--accent); }
.spoon svg { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.pill-sage { background: var(--sage-soft); color: var(--sage); }
.pill-gold { background: rgba(216, 178, 110, 0.18); color: #7a5a1f; }
.pill-dark { background: rgba(216, 178, 110, 0.16); color: var(--gold); }

/* ---------- Page hero (interior pages) ---------- */

.page-hero { padding: 80px 0 56px; }
.page-hero h1 { max-width: 820px; }
.page-hero .lede { margin-bottom: 0; }

/* ---------- Home hero ---------- */

.hero { padding: 56px 0 88px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; height: 120%;
  background: radial-gradient(closest-side, rgba(232, 160, 110, 0.22), transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; position: relative; }
.hero h1 { margin-bottom: 0.35em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-bottom: 32px; }
.hero-note { margin-top: 22px; font-size: 0.9rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero-note svg { width: 16px; height: 16px; color: var(--sage); }

.hero-media { position: relative; }
.hero-photo {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  aspect-ratio: 5 / 6; background: #e9b989;
}
.hero-photo svg { width: 100%; height: 100%; }
.hero-chip {
  position: absolute; left: -36px; bottom: 40px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 18px 20px; width: 300px; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; align-items: center;
}
.hero-chip-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.hero-chip ul { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; display: grid; gap: 3px; }
.hero-chip li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.hero-chip li strong { margin-left: auto; padding-left: 8px; font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hero-tag {
  position: absolute; right: -14px; top: 36px;
  background: var(--surface); border-radius: 999px; box-shadow: var(--shadow);
  padding: 10px 16px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.hero-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 460px; margin: 0 auto; }
  .hero-chip { left: 12px; bottom: 16px; }
  .hero-tag { right: 12px; }
}
@media (max-width: 480px) {
  .hero-chip { position: relative; left: auto; bottom: auto; width: auto; margin: -48px 12px 0; }
}

/* ---------- Testimonials ---------- */

.testimonials { padding: 40px 0 88px; }
.testimonial-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.testimonial { margin: 0; display: flex; flex-direction: column; gap: 20px; }
.testimonial blockquote {
  margin: 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.4; font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 36;
}
.testimonial.featured blockquote { font-size: 1.4rem; }
.testimonial figcaption { display: flex; align-items: center; gap: 12px; font-size: 0.92rem; margin-top: auto; }
.testimonial figcaption span { color: var(--muted); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: #fff;
  background: var(--accent);
}
@media (max-width: 880px) { .testimonial-strip { grid-template-columns: 1fr; } }

/* ---------- Feature tiles ---------- */

.feature { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--accent-soft); color: var(--accent);
}
.feature-icon svg { width: 26px; height: 26px; }
.feature p { color: var(--ink-2); font-size: 0.98rem; }
.feature .text-link { margin-top: auto; }

/* ---------- Steps ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; counter-reset: step; }
.step { position: relative; }
.step-num {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; margin-bottom: 18px;
}
.step h3 { margin-bottom: 0.3em; }
.step p { color: var(--ink-2); margin: 0; }
@media (max-width: 980px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }

.steps-detailed { display: grid; gap: 24px; }
.step-row {
  display: grid; grid-template-columns: 96px 1fr 1fr; gap: 32px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px;
}
.step-row .big-num { font-family: var(--font-display); font-size: 3.5rem; line-height: 1; color: var(--accent); font-weight: 400; }
.step-row h2 { font-size: 1.8rem; }
.step-row .aside { background: var(--surface-2); border-radius: var(--radius-sm); padding: 20px 22px; font-size: 0.95rem; color: var(--ink-2); }
.step-row .aside strong { color: var(--ink); }
@media (max-width: 860px) { .step-row { grid-template-columns: 1fr; gap: 16px; padding: 28px; } .step-row .big-num { font-size: 2.6rem; } }

.callout {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--accent-soft); border-radius: var(--radius); padding: 22px 24px; color: var(--ink);
}
.callout svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 2px; }
.callout p { margin: 0; }

/* ---------- Stats ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.stat { border-top: 2px solid var(--ink); padding-top: 18px; }
.stat-value { font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1; margin-bottom: 10px; }
.stat p { color: var(--ink-2); margin: 0; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr; } }

/* ---------- Bands ---------- */

.band {
  border-radius: var(--radius-lg); padding: 64px; position: relative; overflow: hidden;
  background: var(--forest); color: #f3efe6;
}
.band h2 { color: #fff; }
.band p { color: #c9d6cf; }
.band-warm { background: linear-gradient(135deg, #f3d9c4 0%, #efc7a8 100%); color: var(--ink); }
.band-warm h2 { color: var(--ink); }
.band-warm p { color: var(--ink-2); }
.band-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; }
@media (max-width: 820px) { .band { padding: 40px 28px; } .band-grid { grid-template-columns: 1fr; } }

.mystery-figure { font-family: var(--font-display); font-size: clamp(5rem, 12vw, 9rem); line-height: 0.9; color: var(--gold); text-align: center; }
.mystery-figure small { display: block; font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: #c9d6cf; margin-top: 14px; }

/* ==========================================================================
   Report shell
   ========================================================================== */

.report-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 40px 0 0; }
.sample-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--risk-mid-soft); color: var(--risk-mid); border-radius: 12px;
  padding: 10px 16px; font-size: 0.9rem; margin-bottom: 28px;
}
.sample-banner a { color: inherit; font-weight: 600; }
.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 1.5rem; color: #fff;
  background: conic-gradient(var(--o1) 0 34%, var(--o2) 34% 56%, var(--o3) 56% 67%, var(--o4) 67% 76%, var(--o5) 76% 85%, var(--o6) 85% 92%, var(--o7) 92% 97%, var(--o8) 97% 100%);
  position: relative;
}
.profile-avatar::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--ink); }
.profile-avatar span { position: relative; }
.profile h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

.report-tabs { margin-top: 32px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.report-tabs::-webkit-scrollbar { display: none; }
.report-tabs a {
  white-space: nowrap; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.97rem;
  padding: 14px 18px; border-bottom: 3px solid transparent;
}
.report-tabs a:hover { color: var(--ink); }
.report-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.report-tabs a .tab-badge { font-size: 0.7rem; font-weight: 700; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); vertical-align: 2px; }

.report-body { padding: 56px 0 96px; }
.report-section + .report-section { margin-top: 80px; }
.report-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.report-section-head h2 { margin: 0; }
.report-section-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 620px; }

/* ---------- Data Origins (donut) ---------- */

.origins { display: grid; grid-template-columns: 400px 1fr; gap: 48px; align-items: start; }
.donut-wrap { position: sticky; top: calc(var(--header-h) + 24px); }
.donut { position: relative; width: 100%; max-width: 380px; margin: 0 auto; aspect-ratio: 1; }
.donut svg { width: 100%; height: 100%; overflow: visible; }
.donut-slice { cursor: pointer; transition: transform .25s ease, opacity .25s; transform-origin: 160px 160px; }
.donut.has-focus .donut-slice:not(.is-active) { opacity: 0.5; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; padding: 0 25%;
}
.donut-center-value { font-family: var(--font-display); font-size: 3.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.donut-center-label { font-size: 0.92rem; color: var(--ink-2); margin-top: 8px; line-height: 1.3; }
.donut-caption { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 16px; }

.origin-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.origin-item { border-bottom: 1px solid var(--line); }
.origin-row {
  width: 100%; display: grid; grid-template-columns: 14px 1fr auto 20px; gap: 14px; align-items: center;
  background: none; border: 0; padding: 18px 8px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; border-radius: 10px; transition: background-color .2s;
}
.origin-row:hover, .origin-item.is-hover .origin-row { background: var(--surface-2); }
.origin-row .swatch { width: 14px; height: 14px; border-radius: 4px; }
.origin-name { font-weight: 600; display: block; }
.origin-bar { display: block; height: 6px; margin-top: 8px; border-radius: 0 3px 3px 0; background: var(--line); position: relative; max-width: 340px; }
.origin-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 0 3px 3px 0; }
.origin-pct { font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.chev { width: 20px; height: 20px; color: var(--muted); transition: transform .25s; }
.origin-row[aria-expanded="true"] .chev { transform: rotate(180deg); }
.origin-panel { padding: 0 8px 24px 36px; color: var(--ink-2); }
.origin-panel p { margin: 0 0 0.8em; }
.origin-panel .origin-quote { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--ink); line-height: 1.5; font-variation-settings: "SOFT" 100, "opsz" 24; }
.origin-panel .origin-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.origin-panel .origin-facts span { font-size: 0.8rem; background: var(--surface-2); border-radius: 999px; padding: 4px 10px; color: var(--ink-2); }
.case-link { display: inline-block; margin-top: 10px; font-size: 0.82rem; color: var(--muted); text-decoration: none; letter-spacing: 0.04em; }
.case-link:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 920px) {
  .origins { grid-template-columns: 1fr; }
  .donut-wrap { position: static; }
  .donut { max-width: 320px; }
}

/* ---------- Migration map ---------- */

.map-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.map-stage { position: relative; background: #e4ece8; }
.map-stage svg { width: 100%; height: auto; }
.map-controls { position: absolute; right: 16px; top: 16px; }
.map-land { fill: #efe3cc; stroke: #d6c4a3; stroke-width: 1.5; }
.map-land-label { font-family: var(--font-display); font-style: italic; font-size: 15px; fill: #6b5a44; }
.map-station-label { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; fill: var(--ink); letter-spacing: 0.02em; }
.map-station-sub { font-family: var(--font-body); font-size: 11px; fill: var(--ink-2); }
.map-route { fill: none; stroke: #b9a383; stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; }
.map-trunk { fill: none; stroke: #9c8566; stroke-width: 2.5; stroke-dasharray: 1 7; stroke-linecap: round; }
.map-traveler { stroke: #fff; stroke-width: 1.5; }
.map-ghost { fill: none; stroke-width: 1.5; stroke-dasharray: 2 2; }

.map-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.map-timeline li { padding: 18px 20px; border-right: 1px solid var(--line); transition: background-color .3s; }
.map-timeline li:last-child { border-right: 0; }
.map-timeline strong { display: block; font-size: 0.95rem; }
.map-timeline span { font-size: 0.84rem; color: var(--ink-2); display: block; line-height: 1.45; margin-top: 2px; }
.map-timeline li.is-active { background: var(--accent-soft); }
.map-timeline li.is-active strong { color: var(--accent); }
@media (max-width: 860px) {
  .map-timeline { grid-template-columns: 1fr; }
  .map-timeline li { border-right: 0; border-bottom: 1px solid var(--line); }
  .map-timeline li:last-child { border-bottom: 0; }
}

.waves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.wave { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; border-top: 4px solid var(--o2); }
.wave .wave-num { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #00695e; }
.wave h4 { margin: 6px 0 4px; }
.wave p { margin: 0; font-size: 0.93rem; color: var(--ink-2); }
@media (max-width: 760px) { .waves { grid-template-columns: 1fr; } }

/* ---------- Traits ---------- */

.trait-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.trait { display: flex; flex-direction: column; gap: 4px; }
.trait-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.trait-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.trait h3 { font-size: 1.45rem; margin: 6px 0 2px; }
.trait-result { font-family: var(--font-display); font-size: 1.15rem; color: var(--accent); margin: 0 0 12px; font-variation-settings: "SOFT" 100, "opsz" 24; }
.trait p { color: var(--ink-2); font-size: 0.97rem; }
.trait-viz { margin: 8px 0 18px; }
.trait-foot { margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 0.85rem; color: var(--muted); }
.trait.wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .trait-grid { grid-template-columns: 1fr; } }

.percentile { position: relative; height: 34px; margin-top: 8px; }
.percentile-track { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--surface-3), #e7b9a2); }
.percentile-marker { position: absolute; top: 6px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: var(--shadow-sm); }
.percentile-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.meter span { height: 8px; border-radius: 4px; background: var(--surface-3); }
.meter span.on { background: var(--accent); }
.meter-labels { display: grid; grid-template-columns: repeat(3, 1fr); font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
.meter-labels span:nth-child(2) { text-align: center; }
.meter-labels span:last-child { text-align: right; color: var(--accent); font-weight: 600; }

.alleles { display: flex; gap: 16px; align-items: center; }
.allele { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.allele-shape { width: 34px; height: 64px; border-radius: 17px; background: var(--surface-3); position: relative; overflow: hidden; }
.allele-shape::after { content: ""; position: absolute; left: 0; right: 0; top: 24px; height: 14px; background: var(--accent); }
.allele-shape::before { content: ""; position: absolute; left: 0; right: 0; top: 30px; height: 2px; background: rgba(255,255,255,0.6); z-index: 1; }
.allele-text { font-size: 0.92rem; color: var(--ink-2); }
.allele-text code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 0.85rem; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

.stars { display: flex; gap: 4px; color: var(--o3); }
.stars svg { width: 24px; height: 24px; }

.likelihood { display: flex; gap: 6px; flex-wrap: wrap; }
.likelihood span { font-size: 0.8rem; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.likelihood span.on { background: var(--accent); color: #fff; font-weight: 600; }

/* ---------- Wellness ---------- */

.wellness-hero { background: linear-gradient(180deg, #e3eddd 0%, var(--sage-soft) 100%); border-radius: var(--radius-lg); padding: 48px; margin-bottom: 40px; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.wellness-hero h2 { color: #22402a; }
.wellness-hero p { color: #3f5a45; margin: 0; max-width: 560px; }
.wellness-hero svg { width: 120px; height: 120px; color: var(--sage); }
@media (max-width: 700px) { .wellness-hero { grid-template-columns: 1fr; padding: 32px; } .wellness-hero svg { display: none; } }

.risk-list { display: grid; gap: 20px; }
.risk { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: start; }
.risk-level { display: flex; flex-direction: column; gap: 10px; }
.risk-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.85rem; padding: 7px 12px; border-radius: 999px; width: fit-content; }
.risk-badge svg { width: 16px; height: 16px; }
.risk-badge.high { background: var(--risk-high-soft); color: var(--risk-high); }
.risk-badge.mid { background: var(--risk-mid-soft); color: var(--risk-mid); }
.risk-badge.carrier { background: var(--sage-soft); color: var(--sage); }
.risk-gauge { display: flex; gap: 4px; }
.risk-gauge span { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.risk-gauge.high span:nth-child(-n+4) { background: var(--risk-high); }
.risk-gauge.mid span:nth-child(-n+3) { background: #c98d1c; }
.risk-gauge.carrier span:nth-child(-n+1) { background: var(--sage); }
.risk h3 { margin-bottom: 6px; }
.risk p { color: var(--ink-2); }
.risk ul { color: var(--ink-2); padding-left: 1.2em; margin: 0; font-size: 0.95rem; }
@media (max-width: 760px) { .risk { grid-template-columns: 1fr; gap: 14px; } }

.disclaimer {
  margin-top: 40px; display: flex; gap: 16px; align-items: flex-start;
  border: 1.5px solid var(--sage-mid); background: var(--surface); border-radius: var(--radius); padding: 24px 28px;
}
.disclaimer svg { width: 24px; height: 24px; color: var(--sage); flex: none; }
.disclaimer p { margin: 0; font-style: italic; color: var(--ink-2); }

/* ---------- Relatives ---------- */

.relatives-summary { display: flex; gap: 32px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.relatives-summary .stat-inline strong { font-family: var(--font-display); font-size: 2rem; font-weight: 500; display: block; line-height: 1; }
.relatives-summary .stat-inline span { font-size: 0.85rem; color: var(--muted); }
.relative-list { display: grid; gap: 16px; }
.relative {
  display: grid; grid-template-columns: 64px 1fr 220px auto; gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px;
}
.relative .avatar { width: 64px; height: 64px; font-size: 1.1rem; font-family: var(--font-display); font-weight: 500; }
.relative h3 { margin: 0 0 2px; font-size: 1.35rem; }
.relative-rel { font-weight: 600; color: var(--ink); font-size: 0.95rem; margin: 0; }
.relative-note { font-size: 0.92rem; color: var(--ink-2); margin: 4px 0 0; font-style: italic; }
.shared-pct { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.shared-pct small { font-family: var(--font-body); font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
.shared-bar { height: 6px; background: var(--surface-3); border-radius: 0 3px 3px 0; margin-top: 10px; position: relative; overflow: hidden; }
.shared-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 0 3px 3px 0; }
.relative-compose { grid-column: 2 / -1; display: none; }
.relative-compose.is-open { display: block; }
.compose-box { border-top: 1px dashed var(--line); padding-top: 18px; display: grid; gap: 10px; }
.compose-box label { font-size: 0.85rem; font-weight: 600; }
.compose-box textarea {
  font: inherit; font-size: 0.97rem; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; min-height: 96px; resize: vertical;
}
.compose-box textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compose-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.compose-sent { color: var(--sage); font-weight: 600; font-size: 0.92rem; margin: 0; }
.private-notice {
  display: flex; align-items: center; gap: 14px; padding: 20px 28px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-2); font-style: italic;
}
.private-notice svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
@media (max-width: 900px) {
  .relative { grid-template-columns: 56px 1fr; gap: 16px 18px; padding: 22px; }
  .relative .avatar { width: 56px; height: 56px; }
  .relative-share, .relative-action { grid-column: 2 / -1; }
  .relative-compose { grid-column: 1 / -1; }
}

/* ---------- Family tree ---------- */

.tree-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; }
.tree-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tree-scroll svg { min-width: 900px; width: 100%; height: auto; }
.tree-hint { display: none; font-size: 0.85rem; color: var(--muted); padding: 8px 12px 0; }
@media (max-width: 940px) { .tree-hint { display: block; } }
.tree-node { cursor: pointer; }
.tree-node rect { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; transition: stroke .2s, fill .2s; }
.tree-node:hover rect, .tree-node:focus-visible rect, .tree-node.is-selected rect { stroke: var(--accent); stroke-width: 2; }
.tree-node:focus { outline: none; }
.tree-node.is-you rect { fill: var(--ink); stroke: var(--ink); }
.tree-node.is-you text { fill: #fff; }
.tree-node.is-you .tree-node-sub { fill: #d9cfc6; }
.tree-node.is-base rect { fill: var(--surface-2); }
.tree-node.is-estranged rect { stroke-dasharray: 5 4; }
.tree-node-name { font-family: var(--font-display); font-size: 17px; fill: var(--ink); }
.tree-node-sub { font-family: var(--font-body); font-size: 11.5px; fill: var(--muted); }
.tree-edge { fill: none; stroke: #b7a58d; stroke-width: 1.8; }
.tree-edge.distilled { stroke-dasharray: 2 5; stroke-linecap: round; stroke-width: 2.4; }
.tree-edge.estranged { stroke: var(--risk-high); stroke-dasharray: 7 6; }
.tree-edge.merge { stroke: var(--o2); stroke-width: 2.2; }
.tree-edge.data { stroke: var(--o8); stroke-dasharray: 1 6; stroke-linecap: round; stroke-width: 2.4; opacity: 0.6; }
.tree-edge-label rect { fill: var(--bg); stroke: var(--line); }
.tree-edge-label text { font-family: var(--font-body); font-size: 11px; fill: var(--ink-2); font-style: italic; }
.tree-edge-label.estranged text { fill: var(--risk-high); }

.tree-legend { display: flex; flex-wrap: wrap; gap: 10px 24px; padding: 16px 16px 8px; font-size: 0.85rem; color: var(--ink-2); }
.tree-legend span { display: inline-flex; align-items: center; gap: 8px; }
.tree-legend svg { width: 32px; height: 10px; }
.tree-detail { margin-top: 24px; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.tree-detail h3 { margin: 0; }
.tree-detail p { margin: 4px 0 0; color: var(--ink-2); }

/* ==========================================================================
   Kit
   ========================================================================== */

.kit-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .kit-hero { grid-template-columns: 1fr; } }
.kit-box-stage { display: grid; place-items: center; padding: 24px 0; }
.kit-box-stage svg { width: 100%; max-width: 440px; height: auto; filter: drop-shadow(0 30px 40px rgba(42, 33, 28, 0.18)); }
.file-chip {
  display: inline-flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; margin: 8px 0 28px; box-shadow: var(--shadow-sm);
}
.file-chip svg { width: 28px; height: 28px; color: var(--accent); }
.file-chip strong { display: block; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 0.92rem; }
.file-chip span { font-size: 0.82rem; color: var(--muted); }

.kit-contents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
@media (max-width: 980px) { .kit-contents { grid-template-columns: 1fr; } }
.kit-item-num { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.kit-item h3 { margin: 6px 0 16px; }

.prompt-list { list-style: none; margin: 0; padding: 0; counter-reset: p; display: grid; gap: 10px; }
.prompt-list li { counter-increment: p; display: grid; grid-template-columns: 28px 1fr; gap: 6px; font-size: 0.97rem; }
.prompt-list li::before { content: counter(p, decimal-leading-zero); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.82rem; padding-top: 2px; }
.prompt-list li.diagnostic { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px 10px 0; margin: 0 -12px 0 0; grid-template-columns: 40px 1fr; }
.prompt-list li.diagnostic::before { text-align: right; padding-right: 12px; color: var(--accent); }
.prompt-list .note { display: block; font-size: 0.82rem; color: var(--accent); font-weight: 600; margin-top: 2px; }

.consent { font-size: 0.93rem; color: var(--ink-2); }
.consent fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.consent label { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.consent .signature { margin-top: 18px; border-bottom: 1.5px solid var(--ink); font-family: var(--font-hand); font-size: 1.6rem; color: var(--ink); padding: 0 4px; min-height: 40px; }
.consent .sig-label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.label-card { background: #fff; border: 2px solid var(--ink); border-radius: 8px; font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 0.82rem; color: var(--ink); overflow: hidden; }
.label-row { padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.label-row:last-child { border-bottom: 0; }
.label-row small { display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.label-row.priority { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; font-weight: 700; letter-spacing: 0.08em; }
.label-row.priority span:last-child { font-size: 1.4rem; }
.barcode { height: 54px; margin-top: 6px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 16px); }
.barcode-num { text-align: center; letter-spacing: 0.3em; margin-top: 4px; font-size: 0.75rem; }

/* ==========================================================================
   Reunions
   ========================================================================== */

.events { display: grid; gap: 16px; }
.event {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px;
}
.event-date { text-align: center; border-right: 1px solid var(--line); padding-right: 24px; }
.event-date small { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.event-date strong { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; line-height: 1.1; }
.event h3 { margin: 0 0 4px; }
.event p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.event-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.btn.is-going { background: var(--sage); color: #fff; box-shadow: none; }
@media (max-width: 760px) {
  .event { grid-template-columns: 1fr; gap: 14px; }
  .event-date { text-align: left; border-right: 0; padding-right: 0; display: flex; gap: 10px; align-items: baseline; }
}

.echo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.echo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.echo-card .who { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.92rem; margin-bottom: 12px; }
.echo-card .who .avatar { width: 32px; height: 32px; font-size: 0.72rem; }
.echo-card p { font-size: 0.95rem; color: var(--ink-2); margin: 0; }
.echo-card mark { background: rgba(224, 160, 0, 0.22); color: inherit; border-radius: 3px; padding: 0 2px; }
@media (max-width: 980px) { .echo { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .echo { grid-template-columns: 1fr; } }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; padding: 12px 0; }
.polaroid {
  margin: 0; background: #fff; padding: 12px 12px 18px; box-shadow: var(--shadow); border-radius: 4px;
  transform: rotate(var(--tilt, 0deg)); transition: transform .3s;
}
.polaroid:hover { transform: rotate(0deg) scale(1.02); }
.polaroid svg { width: 100%; height: auto; aspect-ratio: 4 / 3.4; border-radius: 2px; }
.polaroid figcaption { font-family: var(--font-hand); font-size: 1.35rem; line-height: 1.2; color: #3a312b; padding: 12px 4px 0; text-align: center; }
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr; } }
.led { animation: blink 2.4s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ==========================================================================
   Deep Dive (premium)
   ========================================================================== */

.premium { background: var(--forest); color: #e9e4d8; }
.premium .page-hero h1, .premium h2, .premium h3 { color: #fff; }
.premium .lede, .premium p { color: #c9d6cf; }
.premium .eyebrow { color: var(--gold); }
.premium a:not(.btn) { color: var(--gold); }

.trace-list { display: grid; gap: 24px; }
.trace {
  display: grid; grid-template-columns: 1fr 48px 1.3fr; gap: 24px; align-items: center;
  background: var(--forest-2); border: 1px solid rgba(216, 178, 110, 0.18); border-radius: var(--radius-lg); padding: 32px;
}
.trace-phrase { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.25; color: #fff; font-style: italic; }
.trace-phrase small { display: block; font-family: var(--font-body); font-style: normal; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.trace-arrow { color: var(--gold); display: grid; place-items: center; }
.trace-arrow svg { width: 40px; height: 40px; }
.trace-origin { border-left: 1px solid rgba(216, 178, 110, 0.25); padding-left: 24px; }
.trace-origin p { margin: 0 0 0.6em; font-size: 1.02rem; }
.trace-origin p:last-child { margin: 0; }
.trace-origin .final { color: #fff; font-family: var(--font-display); font-style: italic; font-size: 1.15rem; }
.trace-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.trace-meta span { font-size: 0.78rem; border: 1px solid rgba(216, 178, 110, 0.35); color: var(--gold); padding: 3px 10px; border-radius: 999px; }
@media (max-width: 860px) {
  .trace { grid-template-columns: 1fr; padding: 26px; }
  .trace-arrow { transform: rotate(90deg); justify-content: start; }
  .trace-origin { border-left: 0; padding-left: 0; border-top: 1px solid rgba(216, 178, 110, 0.25); padding-top: 20px; }
}

.tracer { background: #f5efe2; color: var(--ink); border-radius: var(--radius-lg); padding: 40px; }
.premium .tracer h2 { color: var(--ink); }
.premium .tracer p { color: var(--ink-2); }
.premium .tracer .eyebrow { color: var(--accent); }
.premium .tracer .tracer-card .final { color: var(--ink); }
.tracer-form { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.tracer-form input {
  flex: 1 1 280px; min-width: 0; font: inherit; font-size: 1.05rem; padding: 14px 18px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink);
}
.tracer-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tracer-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tracer-suggestions button { font: inherit; font-size: 0.85rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.tracer-suggestions button:hover { border-color: var(--accent); color: var(--accent); }
.tracer-result { margin-top: 28px; }
.tracer-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; font-size: 0.92rem; color: var(--ink-2); }
.tracer-steps li { display: flex; gap: 10px; align-items: center; opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.tracer-steps li.is-in { opacity: 1; transform: none; }
.tracer-steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); flex: none; }
.tracer-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; opacity: 0; transition: opacity .5s; }
.tracer-card.is-in { opacity: 1; }
.tracer-card .final { font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--ink); margin: 0; }
.tracer-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tracer-card .meta span { font-size: 0.78rem; background: var(--surface-2); color: var(--ink-2); padding: 3px 10px; border-radius: 999px; }
@media (max-width: 600px) { .tracer { padding: 28px 22px; } }

/* ==========================================================================
   Plans
   ========================================================================== */

.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; position: relative; padding: 32px 26px; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan-flag { position: absolute; top: -13px; left: 26px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; }
.plan.dark { background: var(--forest); color: #e9e4d8; border-color: var(--forest); }
.plan.dark h3 { color: #fff; }
.plan.dark .plan-price, .plan.dark .plan-desc, .plan.dark li { color: #c9d6cf; }
.plan.dark .plan-price strong { color: var(--gold); }
.plan.dark li svg { color: var(--gold); }
.plan h3 { font-size: 1.4rem; margin-bottom: 8px; }
.plan-price { margin: 4px 0 6px; color: var(--muted); font-size: 0.95rem; }
.plan-price strong { font-family: var(--font-display); font-size: 2.6rem; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; margin-right: 4px; }
.plan-desc { color: var(--ink-2); font-size: 0.95rem; min-height: 3em; }
.plan ul { list-style: none; margin: 8px 0 28px; padding: 0; display: grid; gap: 10px; font-size: 0.95rem; }
.plan li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.plan li svg { width: 18px; height: 18px; color: var(--sage); margin-top: 3px; }
.plan .btn { margin-top: auto; width: 100%; }
.plan-confirm { font-size: 0.88rem; color: var(--gold); margin: 12px 0 0; }
.plan-confirm:empty { display: none; }
@media (max-width: 1060px) { .plans { grid-template-columns: 1fr 1fr; row-gap: 32px; } }
@media (max-width: 600px) { .plans { grid-template-columns: 1fr; } }

.compare { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.compare th, .compare td { padding: 14px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare thead th { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; background: var(--surface-2); }
.compare tbody tr:last-child td { border-bottom: 0; }
.compare .yes { color: var(--sage); font-weight: 700; }
.compare .no { color: var(--line-strong); }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.table-scroll .compare { min-width: 640px; }

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 26px; display: flex; justify-content: space-between; gap: 20px; align-items: center;
  font-family: var(--font-display); font-size: 1.2rem; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 12px; height: 12px; flex: none; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform .25s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.faq .answer { padding: 0 26px 24px; color: var(--ink-2); }
.faq .answer p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Hidden page — a 2014 blog
   ========================================================================== */

.blog-page { background: #f2ece4; font-family: Georgia, "Times New Roman", serif; color: #333; }
.blog-frame { max-width: 720px; margin: 0 auto; padding: 48px 20px 80px; }
.case-file { font-family: var(--font-body); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--o8); border-radius: 12px; padding: 20px 24px; margin-bottom: 40px; font-size: 0.95rem; color: var(--ink-2); }
.case-file strong { color: var(--ink); }
.case-file p:last-child { margin: 0; }
.blog-header { text-align: center; padding: 28px 0 22px; border-top: 3px double #b89a7a; border-bottom: 3px double #b89a7a; margin-bottom: 28px; }
.blog-header .blog-title { font-size: 2.2rem; font-style: italic; color: #7a4a2a; margin: 0; font-family: Georgia, serif; letter-spacing: 0; font-weight: 400; }
.blog-header p { margin: 6px 0 0; font-size: 0.9rem; color: #8a7a6a; }
.blog-post { background: #fffdf8; border: 1px solid #e3d6c4; padding: 36px 40px; box-shadow: 0 2px 0 #e3d6c4; }
.blog-post .post-date { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: #a08a70; margin-bottom: 6px; }
.blog-post h2 { font-family: Georgia, serif; font-weight: 400; font-size: 1.6rem; color: #5a3a22; letter-spacing: 0; }
.blog-post .redacted { display: block; height: 0.9em; margin: 0.55em 0; background: repeating-linear-gradient(90deg, #e7ddcf 0 70%, transparent 70% 72%); border-radius: 2px; }
.blog-post .redacted.short { width: 62%; }
.blog-post .redacted.mid { width: 84%; }
.last-line { font-size: 1.35rem; line-height: 1.6; color: #3a2a1e; margin: 32px 0 0; padding-top: 24px; border-top: 1px dashed #d9c8b2; font-style: italic; }
.blog-post .signoff { margin-top: 18px; color: #7a4a2a; }
.blog-footer { text-align: center; margin-top: 32px; font-size: 0.85rem; color: #8a7a6a; }
.blog-footer a { color: #7a4a2a; }
@media (max-width: 560px) { .blog-post { padding: 26px 22px; } }

/* ---------- Reveal on scroll ---------- */

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Placeholders reserve space until site.js swaps in the real header/footer */
[data-site-header] { display: block; height: var(--header-h); }

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

/* Forced colors: keep chart identity readable */
@media (forced-colors: active) {
  .swatch, .origin-bar i, .shared-bar i { forced-color-adjust: none; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; --header-h: 64px; }
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .page-hero { padding: 56px 0 40px; }
  .card { padding: 22px; }
}

/* Mini donut used in the home hero chip */
.mini-donut {
  width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(var(--o1) 0 34%, var(--o2) 34% 56%, var(--o3) 56% 67%, var(--o4) 67% 76%, var(--o5) 76% 85%, var(--o6) 85% 92%, var(--o7) 92% 97%, var(--o8) 97% 100%);
  -webkit-mask: radial-gradient(circle, transparent 21px, #000 22px);
          mask: radial-gradient(circle, transparent 21px, #000 22px);
}
