/* Work Less Golf More — design tokens & shared styles
   ------------------------------------------------------------------
   Two layers of tokens:
   1. RAW brand colours (forest, cream, gold, etc.) — same in both themes.
      These represent fixed brand identity; never re-coloured per theme.
   2. SEMANTIC tokens (bg/surface/text/border/shadow) — theme-aware.
      Components should prefer these. The [data-theme="dark"] block at
      the bottom overrides just the semantic ones, so brand-coloured
      panels (footer, hero, COTW, premium cards) stay forest-green in
      either mode.
   ------------------------------------------------------------------ */

:root {
  /* Raw brand palette — stable */
  --c-ink: #0d2818;
  --c-forest-900: #0d2818;
  --c-forest-800: #14391f;
  --c-forest-700: #1a4a2a;
  --c-forest-600: #246b3c;
  --c-moss: #5a7a52;
  --c-cream: #f5f1e8;
  --c-cream-soft: #faf7ef;
  --c-paper: #ffffff;
  --c-gold: #c9a961;
  --c-gold-dark: #a88c4d;
  --c-fairway: #7ba05b;
  --c-flag-red: #b8413a;
  --c-stone: #efeae0;
  --c-stone-2: #e3ddd0;
  --c-muted: #6b7164;

  /* Semantic tokens (light defaults) */
  --c-bg:            var(--c-cream);
  --c-bg-soft:       var(--c-cream-soft);
  --c-surface:       var(--c-paper);
  --c-surface-soft:  var(--c-cream-soft);
  --c-surface-stone: var(--c-stone);
  --c-surface-stone-2: var(--c-stone-2);

  --c-text:        var(--c-ink);
  --c-text-strong: var(--c-forest-900);   /* used for headings — flips in dark */
  --c-text-soft:   var(--c-forest-800);
  --c-text-muted:  var(--c-muted);
  --c-text-on-dark: var(--c-cream);

  /* Brand-tinted "dark surface" — stays dark in both themes (footer, COTW, hero) */
  --c-brand-bg:    var(--c-forest-900);
  --c-brand-bg-2:  var(--c-forest-800);

  /* Borders / dividers — alpha tints that flip from forest-on-light to cream-on-dark */
  --c-border:        var(--c-border);
  --c-border-strong: var(--c-border-strong);
  --c-border-soft:   var(--c-border-soft);
  --c-overlay-hover: var(--c-overlay-hover);

  /* Header backdrop (translucent body bg) */
  --c-header-bg:     rgba(245, 241, 232, 0.92);
  --c-bottomnav-bg:  rgba(245, 241, 232, 0.96);
  --c-drawer-bg:     var(--c-cream);

  --font-display: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px var(--c-border-soft), 0 1px 1px rgba(13, 40, 24, 0.04);
  --shadow-md: 0 6px 18px -8px var(--c-border-strong), 0 2px 6px var(--c-border-soft);
  --shadow-lg: 0 24px 48px -20px rgba(13, 40, 24, 0.28), 0 8px 16px -8px rgba(13, 40, 24, 0.12);

  --max-w: 1180px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

/* ------------------------------------------------------------------
   DARK THEME
   ------------------------------------------------------------------ */
[data-theme="dark"] {
  /* Re-point semantic tokens at a near-black palette */
  --c-bg:            #0a0a0a;
  --c-bg-soft:       #111312;
  --c-surface:       #15181a;
  --c-surface-soft:  #1a1d1f;
  --c-surface-stone: #1f2421;
  --c-surface-stone-2: #262b27;

  --c-text:        #f0ede3;
  --c-text-strong: #f5f1e8;       /* headings flip to cream */
  --c-text-soft:   rgba(245, 241, 232, 0.82);
  --c-text-muted:  rgba(245, 241, 232, 0.55);

  /* Brand-bg gets slightly lighter than page bg so it still reads as an
     "elevated dark surface" (footer, COTW, hero panels) instead of merging
     into the body */
  --c-brand-bg:    #0e1413;
  --c-brand-bg-2:  #131c18;

  /* Borders flip polarity — cream alpha on dark */
  --c-border:        rgba(245, 241, 232, 0.08);
  --c-border-strong: rgba(245, 241, 232, 0.18);
  --c-border-soft:   rgba(245, 241, 232, 0.06);
  --c-overlay-hover: rgba(245, 241, 232, 0.06);

  --c-header-bg:     rgba(10, 10, 10, 0.85);
  --c-bottomnav-bg:  rgba(10, 10, 10, 0.92);
  --c-drawer-bg:     #15181a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 18px -8px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, 0.7), 0 8px 16px -8px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; }

.font-display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em; }
.font-body { font-family: var(--font-body); }
.tracking-wider-2 { letter-spacing: 0.18em; }

/* Outfit is a geometric sans — tighter spacing reads more premium at display sizes */
.hero h1,
.section h2,
.cotw h3,
.profile-hero h1,
.auth-shell h1,
.prose h2,
.spec-value {
  letter-spacing: -0.025em;
  font-weight: 700;
}
.card-title,
.site-footer h4,
.now-playing,
.font-display {
  font-feature-settings: 'ss01' on, 'cv11' on;
}

/* Layout */
/* Page gutter: 24px baseline on phones, 28px tablet, 36px desktop.
   max() with env(safe-area-inset) honours iPhone notch / rounded corners. */
.wrap {
  max-width: var(--max-w); margin: 0 auto;
  padding-left:  max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
.wrap-narrow {
  max-width: 760px; margin: 0 auto;
  padding-left:  max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
@media (min-width: 700px) {
  .wrap, .wrap-narrow { padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1024px) {
  .wrap, .wrap-narrow { padding-left: 40px; padding-right: 40px; }
}

/* Belt-and-braces: nothing should ever force horizontal page scrolling. */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--c-header-bg);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--c-border);
  padding-top: var(--safe-top);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-header .logo { height: 36px; width: auto; display: block; }
.drawer .logo { height: 34px; width: auto; display: block; }

/* Dual-logo swap: render both, show the one that matches the active theme.
   Avoids a flash of swapped img src on theme toggle. */
.logo-swap { display: inline-block; line-height: 0; }
.logo-swap .logo-on-dark  { display: none; }
.logo-swap .logo-on-light { display: block; }
[data-theme="dark"] .logo-swap .logo-on-light { display: none; }
[data-theme="dark"] .logo-swap .logo-on-dark  { display: block; }

/* Theme toggle button — moon in light mode (the action "switch to dark"),
   sun in dark mode (the action "switch back to light"). */
.theme-toggle { position: relative; }
.theme-toggle .theme-toggle-icon { display: inline-flex; }
.theme-toggle .theme-toggle-sun  { display: none; }
.theme-toggle .theme-toggle-moon { display: inline-flex; }
[data-theme="dark"] .theme-toggle .theme-toggle-sun  { display: inline-flex; }
[data-theme="dark"] .theme-toggle .theme-toggle-moon { display: none; }

/* Drawer variant — full-width labeled toggle styled like the nav links above */
.drawer .drawer-theme-link {
  background: transparent; border: none;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em; text-align: left;
  padding: 6px 0; color: var(--c-text-strong);
  border-bottom: 1px solid var(--c-border);
  width: 100%; cursor: pointer;
}
.drawer .drawer-theme-link .theme-toggle-icon svg {
  width: 22px; height: 22px;
}
.drawer .drawer-theme-link .drawer-theme-label { display: none; }
.drawer .drawer-theme-link .theme-label-to-dark  { display: inline; }
[data-theme="dark"] .drawer .drawer-theme-link .theme-label-to-dark  { display: none; }
[data-theme="dark"] .drawer .drawer-theme-link .theme-label-to-light { display: inline; }

.nav-desktop { display: none; gap: 28px; }
.nav-desktop a {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-soft);
  padding: 8px 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.nav-desktop a:hover { border-bottom-color: var(--c-gold); }
.nav-desktop a.active { border-bottom-color: var(--c-gold); }
.btn-icon {
  background: transparent; border: none; padding: 8px; color: var(--c-text-strong);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { background: var(--c-border-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1.5px solid transparent;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--c-forest-900); color: var(--c-cream);
}
.btn-primary:hover { background: var(--c-forest-700); }
.btn-gold {
  background: var(--c-gold); color: var(--c-forest-900);
  box-shadow: 0 6px 18px -8px rgba(201, 169, 97, 0.55);
}
.btn-gold:hover { background: var(--c-gold-dark); color: var(--c-cream); }
.btn-ghost {
  background: transparent; color: var(--c-text-strong); border-color: var(--c-border-strong);
}
.btn-ghost:hover { background: var(--c-overlay-hover); border-color: var(--c-forest-700); }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-block { width: 100%; }

/* Forms */
.field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
}
.field-label {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-text-soft); font-weight: 600;
}
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 16px;                /* 16px+ avoids iOS Safari auto-zoom on focus */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.searchbar input { font-size: 16px; }
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--c-forest-600);
  box-shadow: 0 0 0 3px rgba(36, 107, 60, 0.12);
}
.field-help { font-size: 12px; color: var(--c-text-muted); }

/* Cards */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-body { padding: 16px 18px 18px; }
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--c-stone-2) center/cover no-repeat;
  overflow: hidden;
}
.card-thumb .thumb-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb .badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(13, 40, 24, 0.85); color: var(--c-cream);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 10px; border-radius: var(--radius-pill); backdrop-filter: blur(6px);
}
.card-thumb .badge-gold { background: var(--c-gold); color: var(--c-forest-900); }
.card-thumb .fav {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid; place-items: center;
  border: none; color: var(--c-text-soft);
}
.card-thumb .fav.is-fav { color: var(--c-flag-red); }
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.15;
  color: var(--c-text-strong);
  margin: 0 0 6px;
}
.card-meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: var(--c-text-muted);
}
.card-meta .dot { width: 3px; height: 3px; background: currentColor; border-radius: 50%; flex-shrink: 0; }
/* Inline icon + text spans — the global `svg { display: block }` rule otherwise
   pushes the text under the icon. Force them to sit on one line, together. */
.card-meta > span,
.profile-hero .meta-row > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.card-meta > span > svg,
.profile-hero .meta-row > span > svg {
  display: inline-block;
  flex-shrink: 0;
}

/* Pills / tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.pill-cream { background: var(--c-surface-stone); color: var(--c-text-soft); }
.pill-green { background: rgba(36, 107, 60, 0.12); color: var(--c-forest-700); }
.pill-gold  { background: rgba(201, 169, 97, 0.18); color: var(--c-gold-dark); }
.pill-red   { background: rgba(184, 65, 58, 0.12); color: var(--c-flag-red); }

/* Rating stars */
.stars { display: inline-flex; gap: 2px; color: var(--c-gold); }
.stars svg { width: 14px; height: 14px; }

/* Hero */
.hero {
  position: relative;
  min-height: 560px;
  display: flex; align-items: flex-end;
  background: radial-gradient(120% 80% at 30% 30%, #2d5b3e 0%, #14391f 60%, #0d2818 100%);
  color: var(--c-cream);
  overflow: hidden;
}
/* Background video fades in once the first frame is decoded so the gradient
   underneath never punches through as a flash. No poster image — we used to
   have one but it bled through and looked like a static overlay. */
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity .8s ease;
}
.hero-bg.is-ready { opacity: 1; }
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(13,40,24,0.35) 0%, rgba(13,40,24,0.55) 50%, rgba(13,40,24,0.92) 100%),
    linear-gradient(90deg,  var(--c-border-strong) 0%, rgba(13,40,24,0)    50%);
  z-index: 1;
}
.hero-inner {
  position: relative; z-index: 2; width: 100%;
  padding: 80px max(24px, env(safe-area-inset-right)) 56px max(24px, env(safe-area-inset-left));
}
@media (min-width: 700px) {
  .hero-inner { padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1024px) {
  .hero-inner { padding-left: 40px; padding-right: 40px; }
}
.eyebrow {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1.02;
  margin: 0 0 16px;
  letter-spacing: -0.015em;
}
.hero h1 em { font-style: normal; color: var(--c-gold); font-weight: 700; }
.hero p.lead {
  font-size: 17px; max-width: 540px; color: rgba(245, 241, 232, 0.88);
  margin: 0 0 28px;
}

/* Search bar */
.searchbar {
  background: var(--c-surface);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 18px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  max-width: 560px;
}
.searchbar input {
  flex: 1; border: none; outline: none; background: transparent;
  font: inherit; color: var(--c-text); padding: 10px 0;
}
.searchbar input::placeholder { color: var(--c-text-muted); }

/* Section header */
/* Section spacing — vertical only. Horizontal padding stays with .wrap so the
   `.section.wrap` combination doesn't clobber its gutter (this was the
   long-standing reason text on a few pages sat flush to the screen edge). */
.section       { padding-top: 56px; padding-bottom: 56px; }
.section-tight { padding-top: 36px; padding-bottom: 36px; }
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 6px; color: var(--c-text-strong);
}
.section .section-sub { color: var(--c-text-muted); margin: 0 0 28px; max-width: 600px; }
.section-head-row {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}

/* Grids */
.grid-cards {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
  .nav-desktop { display: flex; }
  .mobile-only { display: none !important; }
  .hero { min-height: 640px; }
}
@media (min-width: 1200px) {
  .grid-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Horizontal scroll rail (mobile-first) — escapes .wrap padding so cards bleed
   to the screen edge, with the same gutter restored as scroll-padding. */
.rail {
  display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 max(24px, env(safe-area-inset-right)) 8px max(24px, env(safe-area-inset-left));
  margin-left: calc(-1 * max(24px, env(safe-area-inset-left)));
  margin-right: calc(-1 * max(24px, env(safe-area-inset-right)));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * {
  flex: 0 0 78%; scroll-snap-align: start;
  max-width: 320px;
}
@media (min-width: 700px) { .rail > * { flex-basis: 46%; max-width: 360px; } }
@media (min-width: 1024px) { .rail { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; }
  .rail > * { flex-basis: auto; max-width: none; }
}

/* Course of the week */
.cotw {
  display: grid; gap: 0;
  background: var(--c-forest-900); color: var(--c-cream);
  border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.cotw .cotw-media {
  aspect-ratio: 16 / 10;
  background: var(--c-forest-800) center/cover no-repeat;
  position: relative;
}
.cotw .cotw-body { padding: 26px 24px 28px; }
.cotw .eyebrow { color: var(--c-gold); margin-bottom: 10px; }
.cotw h3 {
  font-family: var(--font-display); font-size: clamp(28px, 4.5vw, 40px); font-weight: 600;
  line-height: 1.05; margin: 0 0 10px;
}
.cotw p { color: rgba(245, 241, 232, 0.78); margin: 0 0 18px; }
@media (min-width: 900px) {
  .cotw { grid-template-columns: 6fr 5fr; }
  .cotw .cotw-media { aspect-ratio: auto; min-height: 420px; }
  .cotw .cotw-body { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
}

/* Video player block */
.player-shell {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 100%;
}
.player-shell video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}
/* On mobile, swap to portrait orientation — the user has vertical clips for Hole 1 */
@media (max-width: 720px) {
  .player-shell video {
    aspect-ratio: 9 / 16;
    max-height: 70vh;
  }
}
@media (max-width: 720px) {
  .player-shell.portrait video { aspect-ratio: 9 / 16; }
}
.player-overlay {
  position: absolute; inset: auto 0 0 0;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.78) 100%);
  color: #fff; pointer-events: none;
}
.player-overlay .now-playing {
  font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.1;
}
.player-overlay .now-meta { font-size: 12px; color: rgba(255,255,255,0.75); letter-spacing: 0.06em; }

.chapter-rail {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.chapter-rail::-webkit-scrollbar { display: none; }
.chapter {
  flex: 0 0 auto; border: 1.5px solid rgba(13, 40, 24, 0.14);
  background: var(--c-surface); color: var(--c-text-strong);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 13px; font-weight: 600;
  display: inline-flex; gap: 8px; align-items: center;
  transition: all .15s ease;
}
.chapter:hover { border-color: var(--c-forest-600); }
.chapter.is-active {
  background: var(--c-forest-900); color: var(--c-cream); border-color: var(--c-forest-900);
}
.chapter .num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-border); color: var(--c-text-strong);
  font-size: 11px; font-weight: 700;
}
.chapter.is-active .num { background: var(--c-gold); color: var(--c-forest-900); }

/* Course profile hero */
.profile-hero {
  position: relative;
  min-height: 420px;
  color: var(--c-cream);
  background: var(--c-forest-900) center/cover no-repeat;
  overflow: hidden;
}
.profile-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity .8s ease;
}
.profile-hero-bg.is-ready { opacity: 1; }
.profile-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,40,24,0.2) 0%, rgba(13,40,24,0.9) 100%);
  z-index: 1;
}
.profile-hero-inner {
  position: relative; z-index: 2;
  padding: 40px max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left));
}
@media (min-width: 700px) {
  .profile-hero-inner { padding-left: 32px; padding-right: 32px; }
}
.profile-hero h1 {
  font-family: var(--font-display); font-size: clamp(32px, 6vw, 56px); font-weight: 600;
  letter-spacing: -0.01em; margin: 8px 0 8px; line-height: 1.02;
}
.profile-hero .meta-row {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: rgba(245, 241, 232, 0.85);
}

/* Tabs */
.tabs {
  display: flex; gap: 8px; border-bottom: 1px solid var(--c-border-strong);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent; border: none; padding: 12px 4px;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--c-text-muted); border-bottom: 2px solid transparent;
  white-space: nowrap; margin-right: 18px;
}
.tab.is-active { color: var(--c-text-strong); border-bottom-color: var(--c-gold); font-weight: 600; }

/* Spec grid (course facts) */
.spec-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--c-border);
  border-radius: var(--radius-md); overflow: hidden;
}
@media (min-width: 700px) { .spec-grid { grid-template-columns: repeat(4, 1fr); } }
.spec {
  background: var(--c-surface); padding: 16px 14px;
}
.spec-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-text-muted); }
.spec-value {
  font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--c-text-strong);
  margin-top: 4px;
}

/* Reviews */
.review {
  padding: 18px 0; border-bottom: 1px solid var(--c-border);
}
.review:last-child { border-bottom: 0; }
.review-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-forest-700); color: var(--c-cream);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}
.review-name { font-weight: 600; color: var(--c-text-strong); }
.review-meta { font-size: 12px; color: var(--c-text-muted); }

/* Map placeholder */
.map-placeholder {
  position: relative;
  background:
    linear-gradient(135deg, rgba(36, 107, 60, 0.08) 0%, rgba(201, 169, 97, 0.08) 100%),
    var(--c-stone);
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.map-placeholder::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--c-border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-border-soft) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.6;
}
.map-pin {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -100%);
  color: var(--c-flag-red);
  filter: drop-shadow(0 4px 6px rgba(13, 40, 24, 0.3));
}
.map-placeholder .map-label {
  position: absolute; bottom: 14px; left: 14px;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(6px);
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: 12px; color: var(--c-text-soft);
}

/* Auth / form pages */
.auth-shell {
  max-width: 440px; margin: 0 auto;
  background: var(--c-surface); border-radius: var(--radius-lg);
  padding: 32px 28px; box-shadow: var(--shadow-md);
}
.auth-shell h1 {
  font-family: var(--font-display); font-size: 32px; font-weight: 600;
  letter-spacing: -0.01em; margin: 0 0 6px;
}
.auth-shell .sub { color: var(--c-text-muted); margin: 0 0 24px; }
.divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--c-text-muted); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--c-border-strong);
}

/* Footer */
.site-footer {
  background: var(--c-forest-900); color: rgba(245, 241, 232, 0.78);
  padding: 56px 0 calc(28px + var(--safe-bottom));
  margin-top: 80px;
}
.site-footer h4 {
  font-family: var(--font-display); font-size: 18px; color: var(--c-cream);
  margin: 0 0 12px; font-weight: 600;
}
.site-footer .logo { height: 42px; width: auto; display: block; }
.site-footer a { color: rgba(245, 241, 232, 0.78); }
.site-footer a:hover { color: var(--c-gold); }
.footer-grid {
  display: grid; gap: 32px; grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-bottom {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid rgba(245, 241, 232, 0.1);
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: space-between; font-size: 12px;
  color: rgba(245, 241, 232, 0.55);
}

/* Mobile bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--c-bottomnav-bg);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--c-border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-top: 8px;
  padding-left:   max(8px, env(safe-area-inset-left));
  padding-right:  max(8px, env(safe-area-inset-right));
  padding-bottom: calc(8px + var(--safe-bottom));
  z-index: 50;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--c-text-soft); padding: 6px 4px;
  text-transform: uppercase;
}
.bottom-nav a.active { color: var(--c-gold-dark); font-weight: 700; }
.bottom-nav svg { width: 22px; height: 22px; }
@media (min-width: 980px) { .bottom-nav { display: none; } body { padding-bottom: 0 !important; } }
body { padding-bottom: 72px; }

/* Mobile drawer */
.drawer-bg {
  position: fixed; inset: 0; background: rgba(13, 40, 24, 0.5); z-index: 60; display: none;
}
.drawer-bg.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 84%; max-width: 320px;
  background: var(--c-bg); transform: translateX(100%); transition: transform .25s ease;
  z-index: 61; padding: 20px; display: flex; flex-direction: column; gap: 18px;
  padding-top: calc(20px + var(--safe-top));
}
.drawer.open { transform: translateX(0); }
.drawer a {
  font-family: var(--font-display); font-size: 22px; font-weight: 600;
  padding: 6px 0; color: var(--c-text-strong);
  border-bottom: 1px solid var(--c-border);
}

/* Utility */
.muted { color: var(--c-text-muted); }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.hide-mobile { display: none; }
@media (min-width: 700px) { .hide-mobile { display: initial; } .show-mobile { display: none; } }

/* Blog */
.article-card { display: flex; flex-direction: column; }
.article-card .card-thumb { aspect-ratio: 3 / 2; }
.article-card .card-body { flex: 1; display: flex; flex-direction: column; }
.article-card h3 { margin-top: 6px; }
.article-card .read-more { margin-top: auto; padding-top: 14px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--c-gold-dark); }

.prose { max-width: 680px; margin: 0 auto; }
.prose p { font-size: 17px; line-height: 1.75; margin: 0 0 18px; color: var(--c-text-soft); }
.prose h2 { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin: 36px 0 14px; }
.prose blockquote {
  border-left: 3px solid var(--c-gold); padding: 6px 0 6px 18px; margin: 24px 0;
  font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--c-text-strong);
  letter-spacing: -0.015em;
}

/* Rankings */
.ranking-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  padding: 14px; background: var(--c-surface); border-radius: var(--radius-md);
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.ranking-rank {
  font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--c-gold-dark);
  text-align: center;
}
.ranking-row .row-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ranking-row .row-title { font-weight: 600; color: var(--c-text-strong); }
.ranking-row .row-sub { font-size: 12px; color: var(--c-text-muted); }

/* Skeleton img fallback */
.thumb-fallback {
  background: linear-gradient(135deg, var(--c-forest-700), var(--c-fairway));
  display: grid; place-items: center; color: var(--c-cream);
  font-family: var(--font-display); font-size: 28px;
}

/* ============================================================
   DARK-MODE polish — edge cases the semantic-token sweep can't
   reach (raw colour values inline in CSS, white opaque overlays,
   inline-style attribute selectors for HTML the refactor missed).
   ============================================================ */
[data-theme="dark"] .map-placeholder {
  background:
    linear-gradient(135deg, rgba(36, 107, 60, 0.22) 0%, rgba(201, 169, 97, 0.14) 100%),
    var(--c-surface-stone);
  border-color: var(--c-border);
}
[data-theme="dark"] .map-placeholder .map-label {
  background: rgba(21, 24, 26, 0.85);
  color: var(--c-text-soft);
}
[data-theme="dark"] .map-pin {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

/* Tinted pills — brighten the text in dark mode so it stays readable */
[data-theme="dark"] .pill-green {
  background: rgba(123, 160, 91, 0.18);
  color: #b8d4a0;
}
[data-theme="dark"] .pill-cream {
  background: var(--c-surface-stone);
  color: var(--c-text);
}

/* The translucent searchbar pill goes a touch lighter than surface so it
   reads as elevated even on a video background. */
[data-theme="dark"] .searchbar { background: rgba(245, 241, 232, 0.96); color: var(--c-ink); }
[data-theme="dark"] .searchbar input { color: var(--c-ink); }
[data-theme="dark"] .searchbar input::placeholder { color: #6b7164; }

/* The "How it works" inline-styled premium card on the homepage uses a
   hard-coded forest-900 bg + cream text. Stays as-is in both modes — no
   override needed — but the LIGHT-tier card adjacent needs to pick up
   surface in dark mode (its inline `background: var(--c-paper)` was
   refactored already). */

/* Catch-all for any HTML inline style that still hardcodes a forest-text
   colour the refactor missed. Use [style*=] sparingly — it's a fallback
   safety net, not the primary mechanism. */
[data-theme="dark"] [style*="color:var(--c-forest-900)"],
[data-theme="dark"] [style*="color: var(--c-forest-900)"] {
  color: var(--c-text-strong) !important;
}
[data-theme="dark"] [style*="color:var(--c-forest-800)"],
[data-theme="dark"] [style*="color: var(--c-forest-800)"] {
  color: var(--c-text-soft) !important;
}
[data-theme="dark"] [style*="color:var(--c-forest-700)"],
[data-theme="dark"] [style*="color: var(--c-forest-700)"] {
  color: #b5cdc0 !important;
}

/* `<a href style="color:var(--c-forest-700);font-weight:600;">` link pattern
   used inside body text on a few pages needs to brighten in dark mode. */
[data-theme="dark"] a[style*="color:var(--c-forest-700)"] {
  color: #c4dccd !important;
}

/* Subtle background panels with inline rgba(36,107,60,0.12) (success-tinted
   chips on contact form success state) — bump for contrast */
[data-theme="dark"] [style*="rgba(36,107,60,0.12)"],
[data-theme="dark"] [style*="rgba(36, 107, 60, 0.12)"] {
  background: rgba(123, 160, 91, 0.22) !important;
}

/* Course profile "no tour" CTA + premium upgrade card use gradient bgs that
   include forest alpha; in dark mode lift them */
[data-theme="dark"] .video-cta {
  background: linear-gradient(135deg, rgba(36, 107, 60, 0.18), rgba(201, 169, 97, 0.16));
  border-color: var(--c-border-strong);
}

/* Header backdrop blur — darken the saturated effect in dark mode so the
   blur doesn't cream-tint the dark UI underneath */
[data-theme="dark"] .site-header {
  backdrop-filter: saturate(120%) blur(14px);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
}

/* Field inputs in dark mode — subtle lighter surface so they read as
   interactive against the slightly-darker page bg */
[data-theme="dark"] .field-input,
[data-theme="dark"] .field-select,
[data-theme="dark"] .field-textarea {
  background: var(--c-surface-soft);
  border-color: var(--c-border-strong);
  color: var(--c-text);
}
[data-theme="dark"] .field-input:focus,
[data-theme="dark"] .field-select:focus,
[data-theme="dark"] .field-textarea:focus {
  border-color: #5a8a6e;
  box-shadow: 0 0 0 3px rgba(123, 160, 91, 0.18);
}

/* Chapter rail chips — dark surface with cream text and subtle gold accent
   on active. Looks coherent with the chapter video player UI. */
[data-theme="dark"] .chapter { background: var(--c-surface-soft); }
[data-theme="dark"] .chapter:hover { border-color: var(--c-gold); }
[data-theme="dark"] .chapter .num { background: var(--c-border); color: var(--c-text); }
[data-theme="dark"] .chapter.is-active .num { background: var(--c-gold); color: var(--c-forest-900); }

/* Tabs sticky bar background flips */
[data-theme="dark"] .tabs { border-bottom-color: var(--c-border); }

/* Range input track colour for filter sliders */
[data-theme="dark"] input[type="range"] { accent-color: #b8d4a0; }
[data-theme="dark"] input[type="checkbox"] { accent-color: #b8d4a0; }
[data-theme="dark"] input[type="radio"]    { accent-color: #b8d4a0; }

/* Stars / rating colour stays gold — no override needed */

/* The premium gradient cards on the homepage ("Parkland", "Drone tour")
   use inline `background: linear-gradient(135deg,#246b3c,#14391f)`. They
   already render dark; no override needed in dark mode. */

/* Auth split brand pane — the hero image with green overlay reads fine in
   either theme since the overlay is dark green */

/* Chip + ghost-button hover states in dark mode */
[data-theme="dark"] .chip:hover { background: var(--c-surface-stone-2); }
[data-theme="dark"] .btn-ghost:hover {
  background: var(--c-overlay-hover);
  border-color: var(--c-border-strong);
}

/* Topic / cat / filter chip selected state — invert in dark so it reads
   like a highlight, not a "darker dark" */
[data-theme="dark"] .topic.is-on,
[data-theme="dark"] .cat-chip.is-on,
[data-theme="dark"] .chip.is-on,
[data-theme="dark"] .acct-tab.is-active {
  background: var(--c-cream);
  color: var(--c-forest-900);
  border-color: var(--c-cream);
}
[data-theme="dark"] .tab.is-active {
  color: var(--c-cream);
}

/* Bottom-nav active link — gold-on-cream in light, gold-on-dark in dark.
   The gold token reads fine on both, but we lighten very slightly so it
   has the same eye-catch */
[data-theme="dark"] .bottom-nav a.active { color: var(--c-gold); }

/* Drawer link borders inherit --c-border so they flip automatically.
   The links themselves use --c-text-strong (refactored). Good. */

/* The "How it works" pitch tier card with the gold border in light mode
   keeps the gold border in dark — it actually pops more against dark bg */

/* About page coverage region cards — they used var(--c-paper) which became
   var(--c-surface). Counts (.count) inside use --c-gold-dark which reads
   fine on dark too. */
