/* ── Tokens & base (identical across all 9 landing pages) ─────────────────── */
/* Light default ("Blonde") — a first-time visitor with no stored theme
   preference sees this. Real WCAG contrast computed against --bg (#eee6d2)
   for every pairing below; --text-faint and --accent-light both differ from
   the originally proposed values because those failed 4.5:1 at their real
   used-as-text sizes (3.62:1 and 3.68:1) — see the audit for the exact
   numbers. */
:root {
  --bg: #eee6d2;
  --paper: #6b4a1a;         /* 6.45:1 on --bg */
  --accent: #8b5a1f;        /* 4.72:1 on --bg */
  --accent-light: #805522;  /* 5.21:1 on --bg (corrected from #a06a2a, which measured 3.68:1 — the site's most-used token, incl. real link text) */
  --text: #2e1c0f;          /* 13.10:1 on --bg */
  --text-dim: #6b5540;      /* 5.63:1 on --bg — real body-paragraph color per the audit */
  --text-faint: #6e5c44;    /* 5.15:1 on --bg (corrected from #8a7355, which measured 3.62:1) */
  --serif: 'Playfair Display', Georgia, serif;
  --body: 'Lora', Georgia, serif;
  /* Confirmed universal-but-untokenized colors (repeated as raw hex on every page) */
  --accent-foreground: #ffffff; /* 5.87:1 on --accent — the dark-theme value (#1a0e05) only manages 3.23:1 against this lighter accent, fails 4.5:1 */
  --logo-gradient-start: #d8b888;
  --logo-gradient-end: #6a4420;
  /* --accent's RGB triplet, for alpha-blended uses (rgba(var(--accent-rgb), X)) —
     a hex custom property can't be used inside rgba() directly, so this was
     being re-typed as raw numbers at every call site instead. */
  --accent-rgb: 139, 90, 31;
  /* The site's one "elevated card surface" background, confirmed used 12 times
     across marketing.css and the 9 pages' own remaining page-local styles. */
  --surface-elevated: linear-gradient(145deg, rgba(250,247,240,0.95), rgba(244,239,225,0.98));
  /* Border tokens derive from --accent-rgb, so they adapt automatically to
     whichever theme is active without needing their own per-theme entry. */
  --border: rgba(var(--accent-rgb), 0.15);
  --border-bright: rgba(var(--accent-rgb), 0.4);
  /* Matches the app's own light --surface exactly (client/src/styles/animations.css). */
  --surface: #f4efe1;
  --nav-bg: var(--surface);
  /* .proof / .features-section / footer / .indiv-teaser each have their own
     distinct dark-mode value (see [data-theme="dark"] below) for fidelity;
     light mode unifies them into one subtle warm-white tint instead —
     composited over --bg (#eee6d2) this reads as a barely-there lightening
     (~#f5f0e4), matching --surface-elevated's tone family instead of the
     flat gray a dark-rgba-at-medium-alpha would produce here. */
  --section-band-proof: rgba(250,247,240,0.6);
  --section-band-features: rgba(250,247,240,0.6);
  --section-band-footer: rgba(250,247,240,0.6);
  --section-band-teaser: rgba(250,247,240,0.6);
  /* Matches --nav-bg's light approach: a flat solid --surface instead of a
     translucent dark overlay. */
  --search-bg: var(--surface);
}

/* ── Dark theme ─────────────────────────────────────────────────────────────
   Override for anyone who explicitly chooses dark via the toggle.
   --logo-gradient-start/-end intentionally NOT overridden — the brand mark
   keeps fixed colors regardless of site theme.
   --border/--border-bright intentionally NOT overridden — they already
   follow --accent-rgb (above), so they adapt automatically. */
[data-theme="dark"] {
  --bg: #0c0703;
  --paper: #e8d7a8;
  --accent: #c88c1e;
  --accent-light: #e8b048;
  --text: #f5e8cc;
  --text-dim: #b08040;
  --text-faint: #7a5530;
  --accent-foreground: #1a0e05;
  --accent-rgb: 200, 140, 30;
  /* The site's one "elevated card surface" background, confirmed used 12 times
     across marketing.css and the 9 pages' own remaining page-local styles. */
  --surface-elevated: linear-gradient(145deg, rgba(30,18,8,0.95), rgba(22,13,5,0.98));
  /* Matches the app's own dark --surface exactly (client/src/styles/animations.css). */
  --surface: #160d05;
  /* nav / dropdown-panel / mobile-menu-panel background, unified into one token. */
  --nav-bg: linear-gradient(180deg, rgba(20,11,4,0.97) 0%, rgba(14,8,3,0.92) 100%);
  /* .proof / .features-section / footer each have their own distinct hardcoded
     rgba (different base RGB AND different alpha — not just a shared color at
     different opacities), so dark-mode fidelity is preserved as 3 separate
     tokens rather than unifying them. */
  --section-band-proof: rgba(26,16,8,0.4);
  --section-band-features: rgba(20,11,4,0.5);
  --section-band-footer: rgba(14,8,3,0.6);
  /* .indiv-teaser's own distinct hardcoded value (same base RGB as footer's,
     different alpha). */
  --section-band-teaser: rgba(14,8,3,0.4);
  /* help.html's .search-input — its own distinct hardcoded value (close to
     but not identical to --nav-bg's, so kept as its own token). */
  --search-bg: rgba(26,16,8,0.95);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(180,90,20,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(140,70,10,0.08) 0%, transparent 60%);
  color: var(--text); font-family: var(--body); font-weight: 500;
  line-height: 1.6; overflow-x: hidden; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ── Nav ────────────────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(200,140,30,0.08), 0 4px 24px rgba(0,0,0,0.4);
}
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 21px; color: var(--accent-light); text-shadow: 0 0 24px rgba(200,140,30,0.3); }
.brand-logo { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--logo-gradient-start), var(--logo-gradient-end)); display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3); flex-shrink: 0; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a.text-link { font-size: 15px; color: var(--text-dim); transition: color 0.2s; }
.nav-links a.text-link:hover { color: var(--accent-light); }
.nav-links a.text-link.active { color: var(--accent-light); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn { font-family: var(--serif); font-weight: 600; cursor: pointer; border: none; transition: all 0.18s ease; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.btn-primary { background: linear-gradient(160deg, var(--accent-light) 0%, var(--accent) 100%); color: var(--accent-foreground); padding: 11px 22px; border-radius: 8px; font-size: 15px; border: 1px solid rgba(240,185,70,0.5); box-shadow: 0 1px 0 rgba(255,210,100,0.25) inset, 0 3px 12px rgba(200,140,30,0.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,210,100,0.3) inset, 0 5px 18px rgba(200,140,30,0.5); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: rgba(200,140,30,0.08); color: var(--accent-light); padding: 11px 22px; border-radius: 8px; font-size: 15px; border: 1px solid var(--border-bright); }
.btn-ghost:hover { background: rgba(200,140,30,0.16); transform: translateY(-1px); }

/* ── Resources dropdown ─────────────────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  background: none; border: none; cursor: pointer;
  font-family: var(--body); color: var(--text-dim);
  font-size: inherit; display: flex; align-items: center; gap: 4px;
  transition: color 0.2s;
}
.nav-dropdown-trigger:hover, .nav-dropdown-trigger.active { color: var(--accent-light); }
.nav-caret { font-size: 10px; transition: transform 0.2s; }
.nav-dropdown.open .nav-caret { transform: rotate(180deg); }
.nav-dropdown-panel {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 180px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.nav-dropdown.open .nav-dropdown-panel { display: flex; }
.nav-dropdown-link {
  padding: 8px 12px; border-radius: 6px;
  color: var(--text-dim); font-family: var(--body);
  text-decoration: none; font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-link:hover { background: rgba(200,140,30,0.08); color: var(--accent-light); }
.nav-dropdown-link.active { color: var(--accent-light); }

/* ── Theme toggle ───────────────────────────────────────────────────────── */
/* Always visible at every viewport width (unlike .nav-links' contents) —
   an anonymous visitor should be able to reach it without opening the
   mobile menu. Icon supplied purely via ::before content driven by
   [data-theme], never JS-set text, so it's correct on first paint with
   zero flash — the pre-paint script only needs to stamp the attribute. */
.theme-toggle {
  background: none; border: 1px solid var(--border-bright);
  border-radius: 6px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-light); font-size: 15px; line-height: 1; cursor: pointer;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(var(--accent-rgb), 0.08); }
.theme-toggle::before { content: '\2600'; }
[data-theme="dark"] .theme-toggle::before { content: '\263E'; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 40px 0 32px; background: var(--section-band-footer); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-dim); font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-light); }
.footer-built { color: var(--text-faint); font-size: 14px; font-style: italic; }
.footer-copy { color: var(--text-faint); font-size: 13px; }

/* ── Cookie banner ──────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: linear-gradient(180deg, rgba(26,16,8,0.98), rgba(14,8,3,0.99));
  border-top: 1px solid var(--border-bright);
  box-shadow: 0 -4px 30px rgba(0,0,0,0.5);
  padding: 20px 24px; display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap;
  backdrop-filter: blur(10px);
}
.cookie-banner.hidden { display: none; }
.cookie-text { color: var(--text-dim); font-size: 14px; max-width: 640px; }
.cookie-text a { color: var(--accent-light); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { padding: 9px 20px; font-size: 14px; }

/* ── Mobile nav ─────────────────────────────────────────────────────────── */
.mobile-menu-toggle {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 36px; height: 36px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.mobile-menu-toggle span { display: block; width: 100%; height: 2px; background: var(--accent-light); border-radius: 1px; transition: transform 0.2s, opacity 0.2s; }
.mobile-menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu-panel {
  display: none; flex-direction: column; gap: 4px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-bright);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  padding: 12px 24px 18px;
}
.mobile-menu-panel.open { display: flex; }
.mobile-menu-link { padding: 12px 4px; font-size: 16px; color: var(--text-dim); border-bottom: 1px solid rgba(200,140,30,0.08); }
.mobile-menu-link:nth-last-of-type(2) { border-bottom: none; }
.mobile-menu-cta { margin-top: 10px; width: 100%; }

@media (max-width: 860px) {
  /* .nav-dropdown wraps the Resources <button> trigger + its floating panel —
     a <button>, not an <a>, so the a.text-link rule below never matched it.
     The button stayed visible next to the hamburger on every page at mobile
     widths; the mobile-menu-panel's own flattened items are the real mobile
     nav, so the whole dropdown wrapper is hidden here alongside the links. */
  .nav-links a.text-link, .nav-dropdown { display: none; }
  .nav-links > a.btn { display: none; }
  .mobile-menu-toggle { display: flex; }
}
