/* ==========================================================================
   MetaIndex — "The Composition Gauge" direction
   Fonts self-hosted from ../assets/fonts/ (shared with other products).
   No build step.
   ========================================================================== */

@font-face {
  font-family: "Zilla Slab";
  src: url("../assets/fonts/zilla-slab-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zilla Slab";
  src: url("../assets/fonts/zilla-slab-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zilla Slab";
  src: url("../assets/fonts/zilla-slab-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zilla Slab";
  src: url("../assets/fonts/zilla-slab-400italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../assets/fonts/work-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../assets/fonts/work-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../assets/fonts/work-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../assets/fonts/work-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* clinical chart paper */
  --paper: #f7f4ec;
  --paper-deep: #efe9d9;
  --panel: #fdfcf8;

  /* sage — structural primary */
  --sage: #24392f;
  --sage-deep: #152219;
  --sage-mid: #4c6f5b;
  --sage-mute: #7d9586;
  --sage-hairline: rgba(36, 57, 47, 0.18);
  --sage-hairline-strong: rgba(36, 57, 47, 0.28);

  /* clay — the one warm signal (lean-mass marker + primary CTA) */
  --clay: #bd6a3c;
  --clay-deep: #8a4a27;
  --clay-soft: #f1ddc5;
  --clay-glow: rgba(189, 106, 60, 0.28);

  /* fat-mass marker, used only inside the gauge legend */
  --slate: #93806d;

  /* text */
  --ink: #1d251f;
  --ink-dim: #4c5950;
  --ink-faint: #7a8880;

  --font-display: "Zilla Slab", Georgia, serif;
  --font-body: "Work Sans", ui-sans-serif, system-ui, sans-serif;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius-panel: 14px;
  --radius-control: 8px;

  --ease-gauge: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--clay-soft); color: var(--sage-deep); }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease-gauge), transform 0.7s var(--ease-gauge); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Scroll-driven choreography (progressive enhancement)
   Browsers without animation-timeline keep the IntersectionObserver fade
   above; script.js skips attaching that observer once this is supported,
   so only one system ever drives a given element.
   ========================================================================== */

.scroll-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 3px;
  height: 100vh;
  background: var(--sage-hairline);
  z-index: 60;
  pointer-events: none;
}
.scroll-rail__fill {
  position: absolute;
  inset: 0;
  background: var(--clay);
  transform: scaleY(0);
  transform-origin: top;
}

@supports (animation-timeline: scroll(root)) {
  .scroll-rail__fill {
    animation: rail-fill linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes rail-fill {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@supports (animation-timeline: view()) {
  html.scroll-driven .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: none;
    animation: scroll-reveal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 35%;
  }
  html.scroll-driven .tray-table tbody tr {
    animation: scroll-row-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 65%;
  }
  html.scroll-driven .meter-arc--lean {
    animation: lean-draw linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 55%;
  }
  html.scroll-driven .meter-arc--fat {
    animation: fat-draw linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 55%;
  }
}
@keyframes scroll-reveal-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scroll-row-in {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes lean-draw {
  from { stroke-dashoffset: 754; }
  to { stroke-dashoffset: 264; }
}
@keyframes fat-draw {
  from { stroke-dashoffset: 754; }
  to { stroke-dashoffset: 490; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-rail { display: none; }
  html.scroll-driven .reveal,
  html.scroll-driven .tray-table tbody tr {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  html.scroll-driven .meter-arc--lean { animation: none !important; stroke-dashoffset: 264 !important; }
  html.scroll-driven .meter-arc--fat { animation: none !important; stroke-dashoffset: 490 !important; }
}

/* ==========================================================================
   Disclosure bar
   ========================================================================== */

.disclosure-bar {
  background: var(--sage-deep);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0.65rem var(--gutter);
}
.disclosure-bar__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1rem;
}
.disclosure-bar__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--clay-soft);
  letter-spacing: 0.01em;
}
.disclosure-bar__text { margin: 0; font-size: 0.8rem; line-height: 1.5; color: rgba(247,244,236,0.72); }
.disclosure-bar__text strong { color: var(--paper); }

/* ==========================================================================
   Hero — the composition gauge console
   ========================================================================== */

.gauge {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(ellipse 70% 60% at 85% 20%, rgba(189,106,60,0.1), transparent 60%),
    linear-gradient(170deg, var(--paper) 0%, var(--paper-deep) 100%);
  border-bottom: 1px solid var(--sage-hairline);
  overflow: hidden;
}
.gauge-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas: "intro meter" "copy meter";
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.gauge-col--intro { grid-area: intro; display: flex; flex-direction: column; gap: 1.1rem; }
.gauge-col--copy { grid-area: copy; display: flex; flex-direction: column; gap: 1.1rem; }
.gauge-col--meter { grid-area: meter; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }

.hero-headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--sage-deep);
}
.hero-sub { margin: 0; max-width: 44ch; font-size: 1.08rem; line-height: 1.6; color: var(--ink-dim); }

.highlight-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.highlight-row { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.98rem; color: var(--ink-dim); }
.highlight-row__mark { flex: none; width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; }
.highlight-row__mark circle { fill: none; stroke: var(--sage-mid); stroke-width: 1.4; }
.highlight-row__mark path { stroke: var(--clay); stroke-width: 1.8; fill: none; }

.cta-block { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; margin-top: 0.4rem; }
.cta-block--center { align-items: center; margin-top: 2rem; text-align: center; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius-control);
  padding: 0.95rem 1.7rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-gauge), box-shadow 160ms var(--ease-gauge), background 160ms var(--ease-gauge);
}
.btn--primary {
  color: var(--paper);
  background: var(--clay);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 10px 22px -10px var(--clay-glow);
}
.btn--primary:hover { background: var(--clay-deep); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(0,0,0,0.08), 0 14px 26px -10px var(--clay-glow); }
.btn--secondary {
  color: var(--sage-deep);
  background: transparent;
  border: 1.5px solid var(--sage-hairline-strong);
}
.btn--secondary:hover { border-color: var(--sage-mid); background: rgba(36,57,47,0.05); }
.btn--large { padding: 1.1rem 2.1rem; font-size: 1.05rem; }
.btn__arrow { font-size: 0.85em; opacity: 0.8; transition: transform 160ms var(--ease-gauge); }
.btn:hover .btn__arrow { transform: translateX(3px); }
:focus-visible { outline: 2.5px solid var(--clay); outline-offset: 3px; }

.cta-microcopy { margin: 0; font-size: 0.82rem; color: var(--ink-faint); }

/* -- composition gauge -- */

.meter-module { position: relative; width: min(100%, 300px); aspect-ratio: 1 / 1; }
.meter-face { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.meter-track { fill: none; stroke: var(--sage-hairline); stroke-width: 14; }
.meter-arc { fill: none; stroke-width: 14; stroke-linecap: round; transform-origin: 150px 150px; }
.meter-arc--lean { stroke: var(--sage-mid); stroke-dasharray: 754 754; stroke-dashoffset: 754; transition: stroke-dashoffset 1.4s var(--ease-gauge); }
.meter-arc--fat { stroke: var(--clay); stroke-dasharray: 754 754; stroke-dashoffset: 754; transition: stroke-dashoffset 1.4s var(--ease-gauge) 0.15s; }
.meter-module.is-active .meter-arc--lean { stroke-dashoffset: 264; }
.meter-module.is-active .meter-arc--fat { stroke-dashoffset: 490; }
.meter-label { font-family: var(--font-body); font-weight: 700; font-size: 0.92rem; }
.meter-label--lean { fill: var(--sage-deep); }
.meter-label--fat { fill: var(--clay-deep); }
.meter-sub { font-family: var(--font-body); font-size: 0.68rem; fill: var(--ink-faint); letter-spacing: 0.04em; }

.meter-readout { display: flex; gap: 1.4rem; }
.meter-readout__item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; color: var(--ink-dim); }
.meter-readout__swatch { width: 0.75rem; height: 0.75rem; border-radius: 50%; flex: none; }
.meter-readout__swatch--lean { background: var(--sage-mid); }
.meter-readout__swatch--fat { background: var(--clay); }

/* ==========================================================================
   Shared section scaffolding
   ========================================================================== */

.section { padding: clamp(3rem, 7vw, 5rem) var(--gutter); }
.section--panel { background: var(--panel); border-top: 1px solid var(--sage-hairline); border-bottom: 1px solid var(--sage-hairline); }
.section__inner { max-width: var(--container); margin: 0 auto; }

.section-heading {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  color: var(--sage-deep);
  max-width: 36ch;
}
.subsection-heading {
  margin: 2.4rem 0 1.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--clay-deep);
}

.prose { max-width: 64ch; display: flex; flex-direction: column; gap: 1rem; }
.prose p { margin: 0; color: var(--ink-dim); }

.fold-intro { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }

.deepen-list { margin: 0; padding-left: 1.2rem; color: var(--ink-dim); display: flex; flex-direction: column; gap: 0.6rem; }
.deepen-list strong { color: var(--sage-deep); }
.deepen-list--num { padding-left: 1.4rem; }

/* ==========================================================================
   Fold 2 — comparison board
   ========================================================================== */

.tray-board {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--radius-panel);
  border: 1px solid var(--sage-hairline-strong);
  background: var(--paper);
}
.tray-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.tray-table th, .tray-table td {
  padding: 0.95rem 1.1rem;
  text-align: left;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--sage-hairline);
  vertical-align: top;
}
.tray-table__axis { color: var(--ink-faint); font-weight: 600; width: 20%; }
.tray-table thead th { font-family: var(--font-display); font-weight: 600; color: var(--sage-deep); border-bottom: 2px solid var(--sage-hairline-strong); }
.tray-table__head--lead { color: var(--clay-deep); }
.tray-table__model { display: block; font-size: 0.78rem; font-weight: 400; opacity: 0.85; }
.tray-table tbody th { color: var(--ink-faint); font-weight: 600; font-size: 0.85rem; }
.tray-table__cell--lead { color: var(--ink); background: rgba(189,106,60,0.07); border-left: 2px solid var(--clay); }
.tray-table td { color: var(--ink-dim); }
.tray-table tbody tr:last-child th, .tray-table tbody tr:last-child td { border-bottom: none; }
.tray-mark { display: inline-flex; vertical-align: -3px; }
.tray-mark--yes { color: var(--sage-mid); }
.tray-mark--no { color: var(--ink-faint); }
.tray-note { display: block; font-size: 0.8rem; color: var(--ink-faint); margin-top: 0.2rem; }

/* ==========================================================================
   Fold 3 — step flow + eligibility strip
   ========================================================================== */

.step-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin: 1.6rem 0 2rem; counter-reset: step; }
.step-card {
  position: relative;
  padding: 1.7rem 1.5rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--sage-hairline-strong);
  border-radius: var(--radius-panel);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.step-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  background: var(--sage-deep);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}
.step-card__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--sage-deep); }
.step-card__text { margin: 0; font-size: 0.92rem; color: var(--ink-dim); }

.eligibility-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding: 1.3rem clamp(1rem, 3vw, 1.7rem);
  background: var(--sage-deep);
  color: var(--paper);
  border-radius: var(--radius-panel);
  margin-bottom: 2rem;
}
.eligibility-strip__item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; flex: 1 1 220px; }
.eligibility-strip__item strong { color: var(--clay-soft); }

/* ==========================================================================
   Fold 4 — FAQ + closing panel
   ========================================================================== */

.faq-list { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 2.4rem; }
.faq-row { background: var(--panel); border: 1px solid var(--sage-hairline-strong); border-radius: var(--radius-control); overflow: hidden; }
.faq-row__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1.05rem 1.3rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--sage-deep);
  font-size: 0.98rem;
}
.faq-row__summary::-webkit-details-marker { display: none; }
.faq-plus { flex: none; width: 22px; height: 22px; position: relative; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; background: var(--clay); transition: transform 0.3s; }
.faq-plus::before { left: 0; top: 50%; width: 100%; height: 2px; transform: translateY(-50%); }
.faq-plus::after { top: 0; left: 50%; height: 100%; width: 2px; transform: translateX(-50%); }
.faq-row[open] .faq-plus::after { transform: translateX(-50%) scaleY(0); }
.faq-row__content { padding: 0 1.3rem 1.3rem; }
.faq-row__content p { margin: 0; color: var(--ink-dim); font-size: 0.94rem; }

.closing-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
}
.closing-panel__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); max-width: 30ch; color: var(--sage-deep); }
.closing-panel__text { margin: 0; max-width: 52ch; color: var(--ink-dim); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--sage-deep); padding: 2rem var(--gutter); color: rgba(247,244,236,0.72); }
.site-footer__inner { max-width: var(--container); margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.site-footer__disclaimer { margin: 0; font-size: 0.78rem; line-height: 1.6; }
.site-footer__links { display: flex; gap: 0.6rem; font-size: 0.78rem; }
.site-footer__links a { text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 681px) { .tray-board { overflow: visible; } }

@media (max-width: 920px) {
  .gauge-grid { grid-template-columns: 1fr; grid-template-areas: "intro" "meter" "copy"; }
  .meter-module { width: min(100%, 240px); }
  .step-flow { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero-headline { font-size: clamp(1.7rem, 7vw, 2.1rem); }
  .eligibility-strip { flex-direction: column; }
}
