/* ══════════════════════════════════════════════════════════════
   THE FLOAT PRACTICE — BASE STYLESHEET
   Universal brand foundation loaded on every page.
   Includes: reset, :root vars, typography, spotlight,
   buoyant animation with no-JS fallback, nav/footer hooks.
   ══════════════════════════════════════════════════════════════ */

/* Reset — overrides any residual WordPress/Salient body chrome */
html, body { margin: 0 !important; padding: 0 !important; background: #080808 !important; }
* { box-sizing: border-box; }

/* Brand design tokens */
:root {
  --black:        #080808;
  --gold:         #C9A84C;
  --gold-light:   #E8C97A;
  --gold-dim:     rgba(201, 168, 76, 0.32);
  --gold-faint:   rgba(201, 168, 76, 0.18);
  --gold-glow:    rgba(201, 168, 76, 0.06);
  --white:        #F4F0E8;
  --white-dim:    rgba(244, 240, 232, 0.72);
  --white-label:  rgba(255, 255, 255, 0.7);  /* stat labels / small metadata — brighter than --white-faint for AA on small text */
  --white-faint:  rgba(244, 240, 232, 0.55); /* a11y: bumped from 0.28 (2.2:1) to 0.55 (4.7:1) for AA — body copy only, NOT for small metadata */
  --line-faint:   rgba(244, 240, 232, 0.28); /* decorative borders only — NOT for text */
  --line:         rgba(201, 168, 76, 0.18);
  --mouse-x:      50%;
  --mouse-y:      50%;
}

body {
  font-family: 'Jost', sans-serif;
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

a { color: var(--gold); }

/* ── Consciousness Spotlight (cursor-tracked gold glow) ── */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(201,168,76,0.04), transparent 40%);
}

/* ── Edge fade for bottom of viewport ── */
.edge-fade {
  position: fixed;
  left: 0;
  right: 0;
  height: 120px;
  pointer-events: none;
  z-index: 2;
}
.edge-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--black), transparent);
}

/* ── Page wrapper ── */
.tfp-page { position: relative; z-index: 3; }

/* ══════════════════════════════════════════════════════════════
   BUOYANT SCROLL ANIMATION — with no-JS fallback
   Default: VISIBLE (so content is readable without JS)
   When JS loads, tfp-core.js adds `js-enabled` to <html>, which
   flips the default to hidden+translated. Then IntersectionObserver
   adds `.surfaced` to fade each element in as it enters view.
   ══════════════════════════════════════════════════════════════ */
.buoyant { opacity: 1; transform: none; }

html.js-enabled .buoyant {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
html.js-enabled .buoyant.surfaced {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html.js-enabled .buoyant { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ── Thread line divider ── */
.thread-line {
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--gold-faint), transparent);
  margin: 40px auto;
}

/* ── Container (default; pages may override width) ── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

/* ── Footer base ── */
footer { padding: 48px 0; text-align: center; border-top: 1px solid var(--line); }
.footer-logo { margin-bottom: 20px; display: flex; justify-content: center; align-items: center; }
.footer-logo img { height: 28px; opacity: 0.6; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.footer-links a {
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white-dim);
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--gold); }
.footer-legal {
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--white-faint);
  letter-spacing: 1px;
}

/* ── Global focus indicator (WCAG 2.4.7) ── */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Skip-to-content link, hidden until focused */
.tfp-skip {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 10000;
  padding: 12px 20px;
  background: var(--gold, #c9a84c);
  color: #080808;
  font: 600 14px/1 'Inter', system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top 0.2s ease;
}
.tfp-skip:focus,
.tfp-skip:focus-visible {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Button reset for video lightbox triggers (a11y K1) ── */
.video-grid-item,
.documentary-video,
.video-thumb {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

/* ── Unified stat typography (Phase 7) ──
   Global typography-only rule for all stat values sitewide.
   Per-component sizing/color/spacing stays on scoped rules in each page.
   .stat-label-long is intentionally excluded — narrative text labels stay Cormorant. */
.stat-value {
  font-family: 'Jost', sans-serif;
  font-weight: 700;
}
.stat-label {
  color: var(--white-label);
}

/* ── Responsive container ── */
@media (max-width: 1024px) { .container { padding: 0 32px; } }
@media (max-width: 768px)  { .container { padding: 0 24px; } .footer-links { flex-wrap: wrap; gap: 20px; } }
@media (max-width: 480px)  { .container { padding: 0 20px; } }

/* ══════════════════════════════════════════════════════════════
   SCROLL-SPY TOC (Phase 8 / B1)
   Opt-in via <body data-toc="auto"> or "auto-deep".
   Zero layout shift: body[data-toc] selectors activate on first
   paint, before js/tfp-toc.js runs, so the gutter is reserved
   from the start on desktop.
   ══════════════════════════════════════════════════════════════ */

/* Anchor offset so fixed header doesn't cover target headings. */
body[data-toc] .tfp-article :is(h1, h2, h3, h4, h5, h6) {
  scroll-margin-top: 120px;
}

/* --- Default (mobile/tablet <1200px): accordion "On this page" --- */
body[data-toc] .tfp-toc {
  display: block;
  margin: 0 0 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(201, 168, 76, 0.02);
}
body[data-toc] .tfp-toc-label { display: none; } /* desktop-only label */
body[data-toc] .tfp-toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--white);
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}
body[data-toc] .tfp-toc-toggle:hover { color: var(--gold); }
body[data-toc] .tfp-toc-chevron {
  transition: transform 0.3s ease;
  flex: 0 0 auto;
  margin-left: 12px;
}
body[data-toc] .tfp-toc.is-open .tfp-toc-chevron { transform: rotate(180deg); }

body[data-toc] .tfp-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
body[data-toc] .tfp-toc.is-open .tfp-toc-list {
  max-height: 2000px;
  padding: 4px 20px 16px;
  border-top: 1px solid var(--line);
}
body[data-toc] .tfp-toc-item { margin: 0; }
body[data-toc] .tfp-toc-link {
  display: block;
  padding: 8px 0 8px 12px;
  border-left: 2px solid transparent;
  color: var(--white-label);
  font-family: 'Jost', sans-serif;
  font-size: 0.86rem;
  font-weight: 300;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, padding-left 0.2s ease;
}
body[data-toc] .tfp-toc-link:hover { color: var(--white); }
body[data-toc] .tfp-toc-link.is-active {
  color: var(--white);
  border-left-color: var(--gold);
  padding-left: 16px;
}
body[data-toc="auto-deep"] .tfp-toc-h3 .tfp-toc-link {
  padding-left: 28px;
  font-size: 0.8rem;
}
body[data-toc="auto-deep"] .tfp-toc-h3 .tfp-toc-link.is-active {
  padding-left: 32px;
}

/* --- Desktop ≥1200px: sticky left-gutter sidebar via CSS grid --- */
@media (min-width: 1200px) {
  body[data-toc] .tfp-article {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 60px;
    max-width: 1180px;
    margin: 0 auto;
    align-items: start;
  }
  body[data-toc] .tfp-article-body {
    min-width: 0;
    grid-column: 2;
  }
  body[data-toc] .tfp-toc {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    border-radius: 0;
  }
  body[data-toc] .tfp-toc-toggle { display: none; }
  body[data-toc] .tfp-toc-label {
    display: block;
    color: var(--white-label);
    font-family: 'Jost', sans-serif;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-left: 12px;
  }
  body[data-toc] .tfp-toc-list {
    max-height: none;
    overflow: visible;
    padding: 0;
    border-top: none;
    border-left: 1px solid var(--line);
  }
  body[data-toc] .tfp-toc.is-open .tfp-toc-list {
    padding: 0;
    border-top: none;
  }
}

/* Respect reduced-motion preferences for TOC transitions. */
@media (prefers-reduced-motion: reduce) {
  body[data-toc] .tfp-toc-link,
  body[data-toc] .tfp-toc-list,
  body[data-toc] .tfp-toc-chevron {
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
