/* ============================================================
   BASE · global primitives shared by every component
   Tokenized — no hardcoded brand values. Ports across brands.
   Component-specific styling lives in each component's .scss.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ============================================================
   MOTION LAYER (Phase 5, locked — not CMS-editable)
   The `motion` class is added to <html> by an inline head script
   ONLY when JS runs and the visitor has not asked for reduced
   motion. So: no-JS and reduce-motion visitors get the fully
   visible, un-animated page (these rules simply never apply).
   The LCP block (main > :first-child) is never hidden.
   ============================================================ */
html.motion main > *:not(:first-child) {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
html.motion main > *.is-visible {
  opacity: 1;
  transform: none;
}
/* CloudCannon Visual Editor: never hide blocks (scroll-reveal can't run in the
   editor canvas). `cc-live` is set once and persists through CC's re-renders,
   so it wins over the reveal hidden-state regardless of per-block .is-visible. */
html.cc-live main > * { opacity: 1 !important; transform: none !important; transition: none !important; }
/* Scroll-reveal needs ~15% of a block visible at once; a section taller than
   ~6x the viewport (e.g. the full podcast episode archive) can never meet that,
   so the observer never fires and it stays hidden. Keep such long sections
   always visible. */
html.motion main > .podcast-archive { opacity: 1 !important; transform: none !important; }
/* Nav shadow-settle: subtle lift once the page scrolls. */
.nav { transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease); }
.nav.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10); }

body {
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Type */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 400; line-height: 1.05; letter-spacing: -0.015em; }
h1 { font-size: var(--type-h1); }
h2 { font-size: var(--type-h2); }
h3 { font-size: var(--type-h3); line-height: 1.15; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: var(--type-eyebrow);
  font-weight: 600;
  opacity: 0.7;
  text-wrap: balance; /* even out wrapped lines; alignment left to each context */
}
.eyebrow-chart { color: var(--color-accent); opacity: 1; }
.eyebrow-sage { color: var(--color-surface-1); opacity: 1; }

/* Layout */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
section { position: relative; padding: var(--section-pad) 0; }

/* Buttons */
.btn-group { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px;
  font-family: var(--font-sans);
  font-size: 0.86rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-std), box-shadow var(--dur-fast) var(--ease-std), background-color var(--dur-fast) var(--ease-std), border-color var(--dur-fast) var(--ease-std);
}
.btn-chart { background: var(--color-accent); color: var(--color-ink); }
.btn-chart:hover { background: #d4ec3a; transform: translateY(-1px); }
.btn-sage { background: var(--color-surface-1); color: var(--color-on-dark); }
.btn-sage:hover { background: var(--color-surface-2); transform: translateY(-1px); }
.btn-ghost-light { background: transparent; color: var(--color-on-dark); border-color: rgba(237,236,237,0.4); }
.btn-ghost-light:hover { background: rgba(237,236,237,0.08); border-color: var(--color-on-dark); }
.btn-outline-deep { background: transparent; color: var(--color-ink); border-color: var(--color-ink); }
.btn-outline-deep:hover { background: var(--color-ink); color: var(--color-on-dark); }
.btn-arrow { display: inline-block; flex-shrink: 0; transition: transform var(--dur) var(--ease); }
/* Phones: long labels wrap instead of pushing the page wider than the viewport. */
@media (max-width: 520px) {
  .btn { max-width: 100%; white-space: normal; text-align: center; }
}
.btn:hover .btn-arrow { transform: translateX(4px); }

/* Divider */
.divider { display: flex; align-items: center; justify-content: center; margin: 0 auto; width: 64px; height: 24px; position: relative; }
.divider::before, .divider::after { content: ""; position: absolute; height: 1px; top: 50%; width: 24px; background: currentColor; opacity: 0.4; }
.divider::before { left: 0; }
.divider::after { right: 0; }
.divider .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.divider.sage .dot { background: var(--color-surface-1); }

/* Top nav (content editable via src/_data/navigation.json).
   Two-dropdown mega menu on desktop; hamburger accordion on mobile. Open/close,
   Escape, and outside-click behavior live in the nav script in base.liquid. */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(0,59,49,0.96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--color-on-dark);
  border-bottom: 1px solid rgba(237,236,237,0.08);
}
.nav-inner {
  display: flex; align-items: center; justify-content: flex-start; gap: clamp(28px, 4vw, 52px);
  padding: 14px var(--gutter); max-width: var(--container); margin: 0 auto;
}
.nav-logo img { height: 72px; width: auto; }

.nav-menu { display: flex; align-items: center; gap: 26px; flex: 1; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-item { position: relative; }
.nav-link {
  font-size: 0.84rem; font-weight: 500; opacity: 0.85; color: inherit;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-link:hover, .nav-link:focus-visible { opacity: 1; }
.nav-caret { font-size: 0.7em; transition: transform var(--dur) var(--ease); }

/* Desktop dropdown: opens on hover, keyboard focus-within, or JS aria-expanded */
.nav-dropdown {
  position: absolute; top: 100%; left: 0; min-width: 264px;
  background: var(--color-ink); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18); padding: 10px;
  display: grid; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 60;
}
.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown,
.nav-toggle[aria-expanded="true"] + .nav-dropdown { opacity: 1; visibility: visible; transform: none; }
.has-dropdown:hover .nav-caret,
.nav-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-dd-link { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 6px; color: var(--color-on-dark); }
.nav-dd-link:hover { background: rgba(237,236,237,0.08); }
.nav-dd-label { font-weight: 600; font-size: 0.9rem; }
.nav-dd-desc { font-size: 0.76rem; opacity: 0.7; }

/* MEGA panel (What We Do): wide links grid + feature rail. Palette discipline —
   accent appears ONLY on the Circle promo; everything else ink/white/sage. */
.nav-mega { min-width: 720px; max-width: calc(100vw - 32px); grid-template-columns: 1.55fr 1fr; gap: 30px; padding: 26px; }
.mega-links { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; }
.mega-link { display: block; padding: 12px 10px 12px 0; border-top: 1px solid rgba(237,236,237,0.12); }
.mega-t { display: block; font-family: var(--font-serif); font-size: 1.1rem; color: #fff; }
.mega-d { display: block; font-size: 0.8rem; color: var(--color-on-dark); opacity: 0.6; margin-top: 3px; }
.mega-rail { display: flex; flex-direction: column; gap: 12px; padding-left: 26px; border-left: 1px solid rgba(237,236,237,0.12); }
.mega-impact { background: rgba(237,236,237,0.05); border: 1px solid rgba(237,236,237,0.14); border-radius: 6px; padding: 16px; }
.mega-impact-lbl { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-on-dark); opacity: 0.5; margin-bottom: 12px; }
.mega-stats { display: flex; gap: 18px; }
.ms-n { font-family: var(--font-serif); font-size: 1.5rem; color: #fff; line-height: 1; display: block; }
.ms-s { font-size: 0.62rem; color: var(--color-on-dark); opacity: 0.6; margin-top: 5px; display: block; }
.mega-promo { display: flex; align-items: center; gap: 14px; border-radius: 6px; padding: 14px 16px; }
.mega-promo--trauma-talk { background: rgba(237,236,237,0.06); border: 1px solid rgba(237,236,237,0.12); }
.mega-promo--trauma-talk .mega-promo-ico { background: #fff; color: var(--color-ink); }
.mega-promo--trauma-talk .mp-t { color: #fff; }
.mega-promo--circle { background: var(--color-accent); color: var(--color-ink); }
.mega-promo--circle .mega-promo-ico { background: var(--color-ink); color: var(--color-accent); }
.mega-promo-ico { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-size: 0.9rem; }
.mp-t { font-family: var(--font-serif); font-size: 1.05rem; display: block; }
.mp-d { font-size: 0.76rem; opacity: 0.72; display: block; margin-top: 2px; }
.mega-promo-arr { margin-left: auto; opacity: 0.8; }

.nav-ctas { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-cta {
  padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; transition: all var(--dur) var(--ease);
}
.nav-cta-chart { background: var(--color-accent); color: var(--color-ink); }
.nav-cta-chart:hover { background: #d4ec3a; transform: translateY(-1px); }
.nav-cta-outline { background: transparent; color: var(--color-on-dark); border-color: rgba(237,236,237,0.4); }
.nav-cta-outline:hover { background: rgba(237,236,237,0.08); border-color: var(--color-on-dark); }

.nav-burger { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 8px; color: inherit; }
.nav-burger span { width: 24px; height: 2px; background: currentColor; transition: transform var(--dur), opacity var(--dur); }

/* ---- Mobile: hamburger opens a full-width accordion panel ---- */
@media (max-width: 900px) {
  .nav-burger { display: inline-flex; order: 3; margin-left: auto; } /* hold right edge (nav-inner is flex-start now) */
  .nav-logo img { height: 52px; }
  .nav-menu {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--color-ink); padding: 12px 20px 24px; box-shadow: 0 12px 32px rgba(0,0,0,0.2);
    max-height: calc(100vh - 72px); overflow-y: auto;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity var(--dur), transform var(--dur);
  }
  .nav.nav-open .nav-menu { transform: none; opacity: 1; visibility: visible; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { border-bottom: 1px solid rgba(237,236,237,0.08); }
  .nav-link { padding: 14px 0; width: 100%; justify-content: space-between; }
  /* Mobile: dropdown is an inline accordion, not an absolute panel */
  .nav-dropdown {
    position: static; min-width: 0; box-shadow: none; background: transparent;
    opacity: 1; visibility: visible; transform: none; padding: 0 0 10px 12px; display: none;
  }
  .nav-toggle[aria-expanded="true"] + .nav-dropdown { display: grid; }
  .nav-ctas { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 16px; }
  .nav-cta { text-align: center; }
  /* Mega collapses to a plain accordion list; the feature rail is desktop-only.
     Keep the accordion show/hide (inherited from .nav-dropdown): collapsed stays
     display:none; expanded renders as a single-column block (not the 2-col grid). */
  .nav-mega { min-width: 0; max-width: none; padding: 0; }
  .nav-toggle[aria-expanded="true"] + .nav-mega { display: block; }
  .mega-links { grid-template-columns: 1fr; }
  .mega-link { padding: 12px 0; }
  .mega-rail { display: none; }
}

/* Forms (Netlify) */
.form-narrow { max-width: 620px; }
.nf-form { display: flex; flex-direction: column; gap: 20px; }
.nf-field { display: flex; flex-direction: column; gap: 8px; }
.nf-field label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.nf-field label span { text-transform: none; font-weight: 400; opacity: 0.6; }
.nf-form input, .nf-form textarea {
  width: 100%; font-family: var(--font-sans); font-size: 1rem;
  padding: 14px 16px; border: 1px solid rgba(0,40,34,0.18);
  border-radius: 10px; background: var(--color-bg); color: var(--color-ink);
}
.nf-form input:focus, .nf-form textarea:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; border-color: transparent; }
.nf-form .btn { align-self: flex-start; margin-top: 4px; cursor: pointer; }
.nf-hp { position: absolute; left: -9999px; }  /* honeypot — off-screen, not display:none */

/* Footer — 4-region (brand + 3 columns + legal strip). Calm palette, no accent. */
.footer { background: var(--color-ink-darker); color: var(--color-on-dark); }
.footer-main {
  max-width: var(--container); margin: 0 auto;
  padding: 56px var(--gutter) 34px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.15fr; gap: 40px;
}
.footer-brand { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.footer-logo img { height: 40px; width: auto; }
.footer-tag { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.35; opacity: 0.85; max-width: 30ch; }
.footer-socials { display: flex; gap: 12px; margin-top: 4px; }
.footer-soc {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(237,236,237,0.22);
  display: flex; align-items: center; justify-content: center; color: var(--color-on-dark); opacity: 0.85;
  transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.footer-soc:hover { opacity: 1; border-color: rgba(237,236,237,0.5); background: rgba(237,236,237,0.06); }
.footer-soc-tx { font-size: 0.62rem; font-weight: 600; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.5; font-weight: 600; margin-bottom: 2px; }
.footer-col a { font-size: 0.9rem; opacity: 0.82; transition: opacity var(--dur) var(--ease); }
.footer-col a:hover { opacity: 1; }
.footer-legal { border-top: 1px solid rgba(237,236,237,0.1); }
.footer-legal-in {
  max-width: var(--container); margin: 0 auto; padding: 18px var(--gutter);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.76rem; opacity: 0.55;
}
@media (max-width: 700px) {
  .footer-main { grid-template-columns: 1fr 1fr; gap: 30px 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-legal-in { flex-direction: column; gap: 6px; }
}

/* ============================================================
   POLISH LAYER (v2) — restrained motion + micro-interaction.
   Reveals/entrances gated on html.motion (JS on, motion allowed);
   html.cc-live force-shows everything in the CloudCannon editor;
   prefers-reduced-motion disables all of it. Transform + opacity only.
   ============================================================ */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* entrances — the settle */
  --ease-in:  cubic-bezier(0.7, 0, 0.84, 0);   /* exits / collapses */
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);    /* hover / interactive */
  --dur-fast: 150ms;
  --dur: 220ms;
  --dur-slow: 320ms;   /* the ceiling */
}

/* Reduced-motion: hard rule — everything instant, final state, no transforms. */
@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;
  }
}

/* Grid stagger: the section reveals opacity-only; its items settle up in sequence
   (nth-child delay, cap ~5). Sections do not stagger against each other. */
html.motion main > .service-cards,
html.motion main > .support-tiers,
html.motion main > .team-grid,
html.motion main > .trail-router,
html.motion main > .faq,
html.motion main > .resources { transform: none; }
html.motion .service-cards .service-card,
html.motion .support-tiers .st-card,
html.motion .team-grid .tg-card,
html.motion .trail-router .route-card,
html.motion .faq .faq-item,
html.motion .resources .rc-cat {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
html.motion .is-visible .service-card,
html.motion .is-visible .st-card,
html.motion .is-visible .tg-card,
html.motion .is-visible .route-card,
html.motion .is-visible .faq-item,
html.motion .is-visible .rc-cat { opacity: 1; transform: none; }
html.motion .is-visible :is(.service-card,.st-card,.tg-card,.route-card,.faq-item,.rc-cat):nth-child(2) { transition-delay: 70ms; }
html.motion .is-visible :is(.service-card,.st-card,.tg-card,.route-card,.faq-item,.rc-cat):nth-child(3) { transition-delay: 130ms; }
html.motion .is-visible :is(.service-card,.st-card,.tg-card,.route-card,.faq-item,.rc-cat):nth-child(4) { transition-delay: 190ms; }
html.motion .is-visible :is(.service-card,.st-card,.tg-card,.route-card,.faq-item,.rc-cat):nth-child(5) { transition-delay: 240ms; }
html.motion .is-visible :is(.service-card,.st-card,.tg-card,.route-card,.faq-item,.rc-cat):nth-child(n+6) { transition-delay: 280ms; }

/* Editor safety (make-or-break): cc-live force-shows the staggered/entrance items too. */
html.cc-live .service-card, html.cc-live .st-card, html.cc-live .tg-card,
html.cc-live .route-card, html.cc-live .faq-item, html.cc-live .rc-cat,
html.cc-live .event-hero .eh-status, html.cc-live .event-hero .eh-title,
html.cc-live .event-hero .eh-lede, html.cc-live .event-hero .eh-meta {
  opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important;
}

/* Buttons: press + hover shadow + focus ring (fast std tokens; hover lift already per-style). */
.btn:hover { box-shadow: 0 8px 22px -10px rgba(0,0,0,0.35); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Cards: hover lift + shadow deepen. */
.st-card, .service-card, .tg-card, .route-card {
  transition: transform var(--dur-fast) var(--ease-std), box-shadow var(--dur-fast) var(--ease-std);
}
.st-card:hover, .service-card:hover, .tg-card:hover, .route-card:hover {
  transform: translateY(-2px); box-shadow: 0 14px 34px -14px rgba(0,0,0,0.24);
}

/* Footer links: underline grows from the left on hover/focus. */
.footer-col a { position: relative; }
.footer-col a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-std);
}
.footer-col a:hover::after, .footer-col a:focus-visible::after { transform: scaleX(1); }

/* Nav mega/dropdowns: open on ease-out, close on ease-in (same delegation JS). */
.nav-dropdown { transition-timing-function: var(--ease-in); }
.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown,
.nav-toggle[aria-expanded="true"] + .nav-dropdown { transition-timing-function: var(--ease-out); }
.nav-caret { transition: transform var(--dur) var(--ease-out); }

/* Accordions (native <details>): unify chevron curve + gentle panel fade on open. */
.rc-chev, .faq-chev { transition: transform var(--dur) var(--ease-std); }
html.motion .rc-cat[open] .rc-cat-body,
html.motion .faq-item[open] .faq-a { animation: fmDetailsIn var(--dur) var(--ease-out) both; }
@keyframes fmDetailsIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Hero motion: retime the crossfades to the tokens; the facade + reduced-motion logic
   (Play/close, autoplay-pause, poster→video, video-hide) is untouched. */
.hero-slider .hs-slide { transition: opacity var(--dur-slow) var(--ease-std); }
.video-hero .vh-video { transition: opacity var(--dur-slow) var(--ease-std); }

/* event-hero: one-time entrance on load (status → title → lede → meta). No loop. */
html.motion .event-hero .eh-status { animation: fmRiseIn var(--dur) var(--ease-out) both; animation-delay: 60ms; }
html.motion .event-hero .eh-title  { animation: fmRiseIn var(--dur) var(--ease-out) both; animation-delay: 120ms; }
html.motion .event-hero .eh-lede   { animation: fmRiseIn var(--dur) var(--ease-out) both; animation-delay: 180ms; }
html.motion .event-hero .eh-meta   { animation: fmRiseIn var(--dur) var(--ease-out) both; animation-delay: 240ms; }
@keyframes fmRiseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   TOPOGRAPHIC MOTIF — tint-able contour texture for bands.
   One masked asset, any color. Set --topo-tint + --topo-op on the
   host section. Default tint = accent (dark bands); use
   --topo-tint: var(--color-surface-1) on light bands. Editable per
   block via the component's show_topo field.
   ============================================================ */
.has-topo { position: relative; isolation: isolate; }
.has-topo > .topo-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--topo-tint, var(--color-accent));
  opacity: var(--topo-op, 0.15);
  -webkit-mask: url('/assets/topo/topo-contours.svg') center / cover no-repeat;
          mask: url('/assets/topo/topo-contours.svg') center / cover no-repeat;
}
.has-topo > *:not(.topo-bg) { position: relative; z-index: 1; }

/* ============================================================
   BADGE WATERMARK — oversized medallion bleeding off a corner,
   very low opacity, tinted via CSS mask (badges have hardcoded
   white fill, so currentColor won't work — mask the shape and let
   background-color provide the tint = the host section's `color`).
   Host needs: position:relative; overflow:hidden; isolation:isolate;
   with content above (z-index:1). Editable per section via `watermark`.
   ============================================================ */
.badge-wm {
  position: absolute; z-index: 0; pointer-events: none; aspect-ratio: 1;
  width: clamp(280px, 42vw, 540px);
  background: currentColor; opacity: var(--wm-op, 0.06);
  -webkit-mask: var(--wm-src) center / contain no-repeat;
          mask: var(--wm-src) center / contain no-repeat;
}
.badge-wm[data-corner="br"] { right: -90px; bottom: -120px; }
.badge-wm[data-corner="tr"] { right: -90px; top: -120px; }
.badge-wm[data-corner="bl"] { left: -90px; bottom: -120px; }
.badge-wm[data-corner="tl"] { left: -90px; top: -120px; }

/* ============================================================
   TRAUMA TALK — reusable video facade (.tt-player) + episode pages.
   Player: 16:9, rounded, poster cover, accent play disc. Behavior
   is the delegated tt-player script in base.liquid.
   ============================================================ */
.tt-player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--color-ink); }
.tt-play { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.tt-play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tt-play-glyph {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent); color: var(--color-ink); border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35); transition: transform var(--dur-fast, 150ms) var(--ease-std, ease);
}
.tt-play-glyph svg { width: 34px; height: 34px; margin-left: 4px; }
.tt-play:hover .tt-play-glyph, .tt-play:focus-visible .tt-play-glyph { transform: scale(1.06); }
.tt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Episode pages */
.episode { padding: clamp(32px, 5vw, 56px) 0 clamp(56px, 8vw, 96px); }
/* Anchored to the site gutter: .container's left edge is the nav logo's left
   edge, so the column lines up with the header (and the hub). The text keeps a
   readable measure by capping each child instead of centering the column. */
.episode-inner > * { max-width: 760px; }
.episode-inner > .episode-related, .episode-inner > .episode-lead { max-width: 1040px; }
.episode [id] { scroll-margin-top: 96px; }
@media (min-width: 900px) { .episode [id] { scroll-margin-top: 170px; } }
.episode-crumb { font-size: 0.82rem; opacity: 0.7; margin-bottom: 24px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.episode-crumb a:hover { opacity: 1; text-decoration: underline; }
.episode-crumb .is-current { opacity: 0.55; }
.episode-head h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.08; margin: 12px 0 14px; }
.episode-dek { font-size: 1.15rem; line-height: 1.5; opacity: 0.85; max-width: 60ch; }
.episode-video { margin: 28px 0 8px; }
.episode-body { margin: 32px 0; line-height: 1.7; }
.episode-body p { margin-bottom: 1em; }
.episode-takeaways { background: var(--color-bg-warm, #E3E2E1); border-radius: var(--radius); padding: 24px 28px; margin: 28px 0; }
.episode-takeaways h2 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; margin-bottom: 12px; }
.episode-takeaways ul { padding-left: 1.1em; }
.episode-takeaways li { margin-bottom: 6px; line-height: 1.5; }
.episode-author { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; margin-top: 12px; }
.episode-answer { font-size: 1.22rem; line-height: 1.55; font-weight: 500; margin: 22px 0 4px; max-width: 62ch; }
.episode-faq { margin: 36px 0; }
.episode-faq h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-bottom: 16px; }
.episode-faq dt { font-weight: 600; line-height: 1.4; margin-top: 18px; }
.episode-faq dd { margin: 6px 0 0; line-height: 1.6; opacity: 0.9; }
.tt-transcript { margin: 28px 0; border-top: 1px solid rgba(0,59,49,0.14); padding-top: 22px; }
.tt-transcript > summary { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-sage, #4f7264); cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 9px; }
.tt-transcript > summary::-webkit-details-marker { display: none; }
.tt-transcript > summary::before { content: "＋"; font-size: 0.95rem; line-height: 1; }
.tt-transcript[open] > summary::before { content: "－"; }
.tt-transcript-body { margin-top: 22px; line-height: 1.72; max-width: 68ch; }
.tt-transcript-body h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.24rem; margin: 26px 0 8px; }
.tt-transcript-body p { margin-bottom: 1em; }
/* Episode hub — related episodes, resources, and the closing lead band. */
.episode-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 44px 0 18px; }
.episode-related h2, .episode-resources h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 0; }
.episode-seeall { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; white-space: nowrap; }
.episode-seeall:hover { opacity: 1; }
/* Reuse the landing .tt-card look — those cards are built for a dark context
   (color: inherit on a dark card bg), so set the on-dark text context here. */
.episode-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; color: var(--color-on-dark); }
.episode-resources { margin: 40px 0; }
.episode-resource-list { list-style: none; padding: 0; margin: 16px 0 0; }
.episode-resource-list a { display: inline-flex; gap: 8px; padding: 11px 0; line-height: 1.4; border-bottom: 1px solid rgba(0,59,49,0.10); }
.episode-resource-list li:last-child a { border-bottom: 0; }
.episode-resource-list a:hover { opacity: 0.7; }
.episode-lead { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; border-top: 1px solid rgba(0,59,49,0.14); margin-top: 44px; padding-top: 36px; }
.lead-card { border-radius: var(--radius); padding: 26px 28px; }
.lead-card--primary { background: var(--color-bg-warm, #E3E2E1); }
.lead-card--secondary { border: 1px solid rgba(0,59,49,0.16); }
.lead-eyebrow { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; margin-bottom: 10px; }
.lead-card h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 10px; }
.lead-card h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.2rem; margin: 0 0 8px; }
.lead-card p { line-height: 1.55; opacity: 0.9; margin: 0 0 16px; max-width: 46ch; }
@media (max-width: 720px) {
  .episode-related-grid { grid-template-columns: 1fr 1fr; }
  .episode-lead { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  /* Phones: Watch next becomes a swipeable row instead of six stacked cards. */
  .episode-related-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .episode-related-grid > .tt-card { scroll-snap-align: start; }
}

/* ---- Episode page v2: jump bar, answer callout, accordion, transcript,
   inline capture, share. Mobile-first; desktop refinements in min-width. ---- */
/* One consistent vertical rhythm between the page's sections. The global
   `section` rule pads every section by --section-pad; inside the episode
   column that's dead space, so sections reset it and the rhythm comes from
   margin-top alone (panels re-add their own inner padding below). */
.episode-inner > section { padding-top: 0; padding-bottom: 0; }
.episode-inner > section, .episode-inner > .episode-body { margin-top: clamp(28px, 4vw, 40px); margin-bottom: 0; }
.episode-inner > .episode-body:empty { display: none; }
.ep-section-h { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.15; margin: 0 0 14px; }

/* "In this episode" — one scrollable row on phones, sticky under the nav on desktop. */
.ep-jump { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 10px 0; border-top: 1px solid rgba(0,59,49,0.14); border-bottom: 1px solid rgba(0,59,49,0.14); background: var(--color-bg); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ep-jump::-webkit-scrollbar { display: none; }
.ep-jump-label { flex: 0 0 auto; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.55; }
.ep-jump-list { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex: 0 0 auto; }
.ep-jump-list a { display: inline-block; white-space: nowrap; font-size: 0.84rem; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(0,59,49,0.18); }
.ep-jump-list a:hover, .ep-jump-list a:focus-visible { border-color: var(--color-ink); background: rgba(0,59,49,0.05); }
@media (min-width: 900px) {
  .ep-jump { position: sticky; top: 100px; z-index: 5; }
}

/* Quick answer — reads as THE answer: tinted panel + accent bar. */
.episode-inner > .ep-answer, .episode-inner > .episode-takeaways { padding: 20px 22px; }
.episode-inner > .ep-capture { padding: 24px 22px; }
.episode-inner > .ep-share { padding: 20px 0; }
.episode-inner > .ep-transcript { padding-top: 24px; }
.episode-inner > .episode-lead { padding-top: 32px; }
@media (min-width: 720px) {
  .episode-inner > .ep-answer, .episode-inner > .episode-takeaways { padding: 24px 28px; }
  .episode-inner > .ep-capture { padding: 30px 32px; }
}
.ep-answer { background: var(--color-bg-warm, #E3E2E1); border-left: 4px solid var(--color-surface-1); border-radius: var(--radius); padding: 20px 22px; }
.ep-answer-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-surface-1); margin: 0 0 8px; }
.ep-answer .episode-answer { margin: 0; font-size: clamp(1.12rem, 2.2vw, 1.3rem); }
.episode-video { margin-bottom: 0; }
.episode-takeaways { margin-bottom: 0; }
.tt-noscript { display: inline-block; margin-top: 10px; text-decoration: underline; }

/* Common questions — <details> accordion. */
.ep-faq-list { border-top: 1px solid rgba(0,59,49,0.14); }
.ep-faq-item { border-bottom: 1px solid rgba(0,59,49,0.14); }
.ep-faq-item > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; font-weight: 600; line-height: 1.4; }
.ep-faq-item > summary::-webkit-details-marker { display: none; }
.ep-faq-item > summary::after { content: "＋"; flex: 0 0 auto; color: var(--color-surface-1); }
.ep-faq-item[open] > summary::after { content: "－"; }
.ep-faq-a { padding: 0 0 16px; line-height: 1.6; opacity: 0.9; }

/* Full transcript — a real section, not a footnote toggle. */
.ep-transcript { border-top: 1px solid rgba(0,59,49,0.14); padding-top: 24px; }
.ep-transcript-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.ep-transcript-meta { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; margin: 0 0 14px; }
.ep-transcript-toc ol { list-style: none; counter-reset: tsec; margin: 0 0 18px; padding: 0; display: grid; gap: 2px; }
.ep-transcript-toc li { counter-increment: tsec; }
.ep-transcript-toc a { display: flex; gap: 10px; padding: 6px 0; line-height: 1.35; }
.ep-transcript-toc a::before { content: counter(tsec, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.72rem; opacity: 0.5; padding-top: 3px; }
.ep-transcript-toc a:hover { text-decoration: underline; }
.ep-transcript .tt-transcript { margin: 0; border-top: 0; padding-top: 0; }
.ep-transcript .tt-transcript > summary { padding: 12px 18px; border: 1px solid rgba(0,59,49,0.2); border-radius: 999px; }
.ep-transcript .tt-transcript[open] > summary { margin-bottom: 4px; }
.tt-transcript .when-open { display: none; }
.tt-transcript[open] .when-open { display: inline; }
.tt-transcript[open] .when-closed { display: none; }
.tt-transcript-body h3 { scroll-margin-top: 96px; }
@media (min-width: 900px) { .tt-transcript-body h3 { scroll-margin-top: 170px; } }

/* Inline opt-in at the value moment. */
.ep-capture { background: var(--color-ink); color: var(--color-on-dark); border-radius: var(--radius); padding: 24px 22px; }
.ep-capture h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin: 0 0 8px; }
.ep-capture p { line-height: 1.55; opacity: 0.88; margin: 0 0 14px; max-width: 52ch; }
.ep-capture .lead-eyebrow { color: var(--color-accent); opacity: 1; }
.ep-capture noscript a { color: var(--color-accent); text-decoration: underline; }

/* Share. */
.ep-share { display: grid; gap: 14px; padding: 20px 0; border-top: 1px solid rgba(0,59,49,0.14); border-bottom: 1px solid rgba(0,59,49,0.14); }
.ep-share h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.25rem; margin: 0 0 4px; }
.ep-share p { margin: 0; opacity: 0.8; line-height: 1.5; }
.ep-share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ep-share-link { font: inherit; font-size: 0.86rem; color: inherit; background: none; cursor: pointer; padding: 8px 14px; border: 1px solid rgba(0,59,49,0.22); border-radius: 999px; }
.ep-share-link:hover, .ep-share-link:focus-visible { border-color: var(--color-ink); }
.ep-share-status { font-size: 0.82rem; opacity: 0.7; }
@media (min-width: 720px) {
  .ep-share { grid-template-columns: 1fr auto; align-items: center; }
  .ep-share-actions { justify-content: flex-end; }
}

/* "Transcript" badge on episode cards (hub + Watch next). */
.tt-thumb-badge { position: absolute; z-index: 2; top: 8px; left: 8px; background: rgba(0,40,34,.9); color: var(--color-on-dark); padding: 3px 7px; border-radius: 2px; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* ============================================================
   ON THE TRAIL BLOG — post pages reuse the episode shell above
   (.episode / .episode-inner / .episode-head / .episode-lead); these
   add long-form body type. The /blog/ index reuses the Trauma Talk
   card (.tt-card) on the same sage band.
   ============================================================ */
.post-hero { width: 100%; height: auto; border-radius: var(--radius); margin: 28px 0 0; }
.post-body { max-width: 68ch; overflow-wrap: break-word; }
.post-body h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); line-height: 1.15; margin: 40px 0 12px; }
.post-body h3 { font-size: clamp(1.2rem, 2.2vw, 1.4rem); margin: 32px 0 10px; }
.post-body ul, .post-body ol { padding-left: 1.3em; margin: 0 0 1em; }
.post-body li { margin-bottom: 10px; }
.post-body a { text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { opacity: 0.7; }
.post-body blockquote { border-left: 3px solid var(--color-surface-1); padding: 4px 0 4px 20px; margin: 24px 0; font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.5; }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-back { display: inline-flex; gap: 8px; }

.blog-list { background: var(--color-surface-1); color: var(--color-on-dark); padding: var(--section-pad) 0; }
.blog-list .tt-card { cursor: pointer; }
.blog-list .tt-q { font-size: 1.25rem; }
.blog-card-more { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }

/* ============================================================
   POLISH LAYER (v2) — additions: stat count-up + one ambient hero.
   Same contract as the rest of this layer: gated on html.motion, so a
   no-JS or reduced-motion visitor gets the final, static, visible state.
   ============================================================ */

/* Count-up targets. tabular-nums keeps every intermediate value the same
   advance width, and the JS pins min-width before animating — between them
   the number can't reflow its neighbours while counting (zero CLS). */
.ig-stat .num,
.road-stat .num,
.hc-cred-num,
.meth-card-h .num { font-variant-numeric: tabular-nums; }

/* The ONE ambient hero treatment: a very slow drift on the interior-page
   hero image. Transform only, inside an overflow:hidden frame, so nothing
   reflows. Deliberately NOT paired with a hero-text fade — the brief allows
   one, and fading the H1 would put the LCP element behind an animation.
   video-hero is excluded: it already moves. */
@keyframes fmHeroDrift {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}
html.motion .page-hero .page-hero-media img {
  animation: fmHeroDrift 24s var(--ease-std) infinite alternate both;
  will-change: transform;
}

/* Belt and braces: the global reduced-motion rule above neutralises
   durations, but state it explicitly for the ambient loop. */
@media (prefers-reduced-motion: reduce) {
  html.motion .page-hero .page-hero-media img { animation: none !important; transform: none !important; }
}
