/* ============================================================
   SONNET 4.6 — Global Stylesheet
   Theme: Bronze Dark Mode · Gold Accents · Colorblind-Safe
   Fonts: Cinzel Decorative (display) + Source Serif 4 (body) + JetBrains Mono (code)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── COLORBLIND-SAFE PALETTE (Paul Tol "muted" scheme) ──── */
:root {
  --bg-void:        #0d0a07;
  --bg-deep:        #120e09;
  --bg-base:        #1a1208;
  --bg-surface:     #231809;
  --bg-raised:      #2e200c;
  --bg-elevated:    #3a2a10;
  --bg-glass:       rgba(58, 42, 16, 0.45);

  --bronze-darkest: #3d2710;
  --bronze-dark:    #5c3d1a;
  --bronze-mid:     #7a5225;
  --bronze-base:    #9a6a35;
  --bronze-light:   #b8844a;
  --bronze-pale:    #d4a06a;

  --gold-deep:      #8b6914;
  --gold-base:      #c9960a;
  --gold-bright:    #e8b020;
  --gold-pale:      #f5cc6a;
  --gold-shimmer:   #fde080;

  /* Colorblind-safe semantic tones */
  --cb-teal:        #44AA99;
  --cb-rose:        #CC6677;
  --cb-sand:        #DDCC77;
  --cb-sky:         #88CCEE;
  --cb-olive:       #999933;
  --cb-plum:        #882255;
  --cb-lilac:       #AA4499;
  --cb-navy:        #332288;

  --text-primary:   #f5e8cc;
  --text-secondary: #c9a96e;
  --text-muted:     #8a7055;
  --text-dim:       #5a4830;
  --text-gold:      var(--gold-bright);

  --border-subtle:  rgba(200, 150, 60, 0.15);
  --border-mid:     rgba(200, 150, 60, 0.3);
  --border-strong:  rgba(232, 176, 32, 0.5);
  --shadow-glow:    0 0 40px rgba(200, 150, 30, 0.15);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.5);

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

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.75;
  overflow-x: hidden;
}

/* Grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Cinzel', serif; font-weight: 700; line-height: 1.2; letter-spacing: 0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: var(--gold-bright); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); color: var(--text-primary); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--bronze-pale); }
h4 { font-size: 1rem; color: var(--text-secondary); letter-spacing: 0.08em; text-transform: uppercase; }
p { margin-bottom: 1em; }
a { color: var(--gold-bright); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-shimmer); }
strong { color: var(--gold-pale); font-weight: 600; }
em { color: var(--cb-sand); font-style: italic; }

/* ── NAVIGATION ───────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(13, 10, 7, 0.93);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 2rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-brand {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.82rem; font-weight: 700;
  color: var(--gold-bright); letter-spacing: 0.1em;
  text-decoration: none; display: flex; align-items: center; gap: 0.6rem;
}
.version-badge {
  background: var(--gold-deep); color: var(--gold-shimmer);
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem;
  padding: 2px 6px; border-radius: 3px; letter-spacing: 0.1em;
}

.nav-links { display: flex; align-items: center; gap: 0.2rem; list-style: none; }
.nav-links a {
  display: block; padding: 0.4rem 0.7rem;
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); border-radius: 4px;
  transition: all 0.2s; text-decoration: none;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-bright); background: rgba(200,150,30,0.1); }
.nav-cta { background: var(--gold-base) !important; color: var(--bg-void) !important; font-weight: 700 !important; }
.nav-cta:hover { background: var(--gold-bright) !important; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gold-base); border-radius: 2px; transition: all 0.3s; }

/* ── PAGE STRUCTURE ───────────────────────────────────────── */
.page-wrapper { padding-top: 64px; min-height: 100vh; }

.section { padding: 5rem 2rem; max-width: 1200px; margin: 0 auto; }
.section-full { padding: 5rem 2rem; }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--cb-teal); margin-bottom: 0.75rem; display: block;
}
.section-desc { font-size: 1.05rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

.divider { height: 1px; background: linear-gradient(to right, transparent, var(--border-mid), transparent); }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6rem 2rem 4rem; overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(180,120,20,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(100,70,10,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(150,100,20,0.06) 0%, transparent 60%);
}

.hero-ring {
  position: absolute; width: 700px; height: 700px;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  border: 1px solid rgba(200,150,30,0.05); border-radius: 50%; pointer-events: none;
  animation: spin-slow 80s linear infinite;
}
.hero-ring::before {
  content: ''; position: absolute; inset: 50px;
  border: 1px solid rgba(200,150,30,0.04); border-radius: 50%;
}
@keyframes spin-slow { to { transform: translate(-50%,-50%) rotate(360deg); } }

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--cb-teal); margin-bottom: 1.5rem; position: relative; z-index: 1;
}

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.5rem, 7vw, 5.5rem); font-weight: 900; line-height: 1.05;
  color: var(--gold-bright);
  text-shadow: 0 0 80px rgba(232,176,32,0.3), 0 2px 0 rgba(0,0,0,0.5);
  position: relative; z-index: 1; margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-family: 'Cinzel', serif; font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--bronze-pale); letter-spacing: 0.12em;
  margin-bottom: 1.5rem; position: relative; z-index: 1;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 1rem; font-style: italic; position: relative; z-index: 1;
}
.hero-date {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem;
  color: var(--text-muted); letter-spacing: 0.15em; margin-bottom: 3rem; position: relative; z-index: 1;
}

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  justify-content: center; position: relative; z-index: 1; margin-bottom: 3rem;
}

.stat-pill {
  background: var(--bg-glass); border: 1px solid var(--border-mid);
  border-radius: 100px; padding: 0.55rem 1.3rem;
  display: flex; align-items: center; gap: 0.5rem;
  backdrop-filter: blur(10px); transition: all 0.3s var(--ease-out);
}
.stat-pill:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-pill .sv { font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; font-weight: 700; color: var(--gold-bright); }
.stat-pill .sl { font-size: 0.75rem; color: var(--text-muted); }

.btn-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.72rem 1.7rem; border-radius: 6px;
  font-family: 'Cinzel', serif; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; transition: all 0.25s var(--ease-out);
  cursor: pointer; border: none;
}
.btn-primary { background: var(--gold-base); color: var(--bg-void); }
.btn-primary:hover { background: var(--gold-bright); color: var(--bg-void); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,150,10,0.35); }
.btn-outline { background: transparent; color: var(--gold-bright); border: 1px solid var(--border-strong); }
.btn-outline:hover { background: rgba(200,150,30,0.1); transform: translateY(-2px); }

.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: var(--text-muted); font-size: 0.62rem; letter-spacing: 0.15em;
  text-transform: uppercase; z-index: 1; animation: bob 2.5s ease-in-out infinite;
}
.scroll-cue::after { content: ''; display: block; width: 1px; height: 32px; background: linear-gradient(to bottom, var(--gold-base), transparent); }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 2rem;
  transition: all 0.3s var(--ease-out);
}
.card:hover { border-color: var(--border-mid); box-shadow: var(--shadow-glow); transform: translateY(-3px); }

.card-grid { display: grid; gap: 1.5rem; }
.cg-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cg-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cg-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.big-stat { text-align: center; padding: 2.5rem 1.5rem; }
.big-stat .number {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700;
  color: var(--gold-bright); line-height: 1; margin-bottom: 0.5rem; display: block;
}
.big-stat .unit { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; color: var(--cb-teal); }
.big-stat .label { font-size: 0.88rem; color: var(--text-muted); }
.big-stat .sublabel { font-size: 0.73rem; color: var(--text-dim); margin-top: 0.35rem; font-style: italic; }

/* ── CHARTS ───────────────────────────────────────────────── */
.chart-wrap {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 2rem; position: relative;
}
.chart-title { font-family: 'Cinzel', serif; font-size: 0.88rem; letter-spacing: 0.08em; color: var(--text-secondary); margin-bottom: 0.3rem; text-transform: uppercase; }
.chart-subtitle { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 1.5rem; font-style: italic; }
.chart-note { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.75rem; font-style: italic; border-top: 1px solid var(--border-subtle); padding-top: 0.75rem; }

/* ── PROGRESS BARS ────────────────────────────────────────── */
.progress-item { margin-bottom: 1.25rem; }
.progress-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.progress-label { font-size: 0.85rem; color: var(--text-secondary); }
.progress-value { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--gold-bright); font-weight: 700; }
.progress-bar { height: 8px; background: var(--bg-raised); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; transition: width 1.4s var(--ease-out); width: 0; }
.pf-gold  { background: linear-gradient(to right, var(--gold-deep), var(--gold-bright)); }
.pf-teal  { background: linear-gradient(to right, #2a7a6e, var(--cb-teal)); }
.pf-rose  { background: linear-gradient(to right, #8a3040, var(--cb-rose)); }
.pf-sky   { background: linear-gradient(to right, #3a7a9a, var(--cb-sky)); }
.pf-sand  { background: linear-gradient(to right, #9a8030, var(--cb-sand)); }

/* ── TIMELINE ─────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--gold-deep), var(--gold-bright), var(--cb-teal));
}
.tl-item { position: relative; padding-bottom: 3rem; padding-left: 2rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -2.45rem; top: 0.3rem;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--bg-void); background: var(--bronze-base);
}
.tl-item.hl .tl-dot {
  background: var(--gold-bright); box-shadow: 0 0 16px rgba(232,176,32,0.5);
  width: 18px; height: 18px; left: -2.6rem; top: 0.1rem;
}
.tl-date { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 0.25rem; }
.tl-model { font-family: 'Cinzel', serif; font-size: 1rem; color: var(--text-primary); margin-bottom: 0.25rem; }
.tl-item.hl .tl-model { color: var(--gold-bright); }
.tl-score { font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; font-weight: 700; color: var(--cb-teal); margin-bottom: 0.35rem; }
.tl-item.hl .tl-score { color: var(--gold-bright); font-size: 2rem; }
.tl-desc { font-size: 0.86rem; color: var(--text-muted); }

/* ── QUOTE CARDS ──────────────────────────────────────────── */
.quote-card {
  background: var(--bg-raised); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold-base); border-radius: 0 10px 10px 0;
  padding: 1.75rem; transition: all 0.3s;
}
.quote-card:hover { border-left-color: var(--gold-bright); box-shadow: var(--shadow-glow); }
.qt { font-style: italic; color: var(--text-primary); font-size: 0.93rem; line-height: 1.7; margin-bottom: 1rem; }
.qt::before { content: '\201C'; color: var(--gold-base); font-size: 1.2em; }
.qt::after  { content: '\201D'; color: var(--gold-base); font-size: 1.2em; }
.qa { display: flex; flex-direction: column; gap: 2px; }
.qa-name { font-family: 'Cinzel', serif; font-size: 0.8rem; color: var(--gold-pale); font-weight: 600; }
.qa-role { font-size: 0.72rem; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }

/* ── PILLS ────────────────────────────────────────────────── */
.pill-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill { background: var(--bg-raised); border: 1px solid var(--border-subtle); border-radius: 100px; padding: 0.35rem 0.9rem; font-size: 0.78rem; color: var(--text-secondary); transition: all 0.2s; }
.pill:hover { border-color: var(--gold-base); color: var(--gold-pale); }
.pill.gold { background: rgba(200,150,10,0.15); border-color: var(--gold-deep); color: var(--gold-pale); }
.pill.teal { background: rgba(68,170,153,0.12); border-color: rgba(68,170,153,0.3); color: var(--cb-teal); }

/* ── CODE ─────────────────────────────────────────────────── */
.code-block {
  background: var(--bg-deep); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 1.25rem 1.5rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.83rem; color: var(--cb-sand);
  overflow-x: auto; line-height: 1.8;
}
.code-block .ck { color: var(--cb-sky); }
.code-block .cv { color: var(--cb-teal); }
.code-block .cs { color: var(--cb-rose); }
.code-block .cc { color: var(--text-dim); }

/* ── TABLES ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { font-family: 'Cinzel', serif; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-mid); text-align: left; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(200,150,30,0.04); }
.data-table td.hi { color: var(--gold-bright); font-weight: 600; }
.data-table td.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }

/* ── PAGE HERO ────────────────────────────────────────────── */
.page-hero {
  position: relative; padding: 6rem 2rem 4rem;
  text-align: center; overflow: hidden; border-bottom: 1px solid var(--border-subtle);
}
.page-hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 80% at 50% 0%, rgba(180,120,20,0.1) 0%, transparent 70%); }
.page-hero > * { position: relative; z-index: 1; }

/* ── TRIVIA BOXES ─────────────────────────────────────────── */
.trivia-box {
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  border-radius: 10px; padding: 1.5rem;
  display: flex; gap: 1rem; align-items: flex-start;
}
.trivia-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.trivia-label { font-family: 'JetBrains Mono', monospace; font-size: 0.63rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cb-sand); margin-bottom: 0.3rem; display: block; }
.trivia-text { font-size: 0.88rem; color: var(--text-secondary); }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer { background: var(--bg-deep); border-top: 1px solid var(--border-subtle); padding: 3rem 2rem; text-align: center; }
.footer-brand { font-family: 'Cinzel Decorative', serif; font-size: 1.05rem; color: var(--gold-base); margin-bottom: 0.5rem; }
.footer-meta { font-size: 0.76rem; color: var(--text-dim); margin-bottom: 1.5rem; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.footer-links a { font-size: 0.78rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--gold-bright); }
.footer-disclaimer { font-size: 0.68rem; color: var(--text-dim); max-width: 700px; margin: 0 auto; line-height: 1.6; }

/* ── REVEAL ANIMATIONS ────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.rd1 { transition-delay: 0.1s; } .rd2 { transition-delay: 0.2s; }
.rd3 { transition-delay: 0.3s; } .rd4 { transition-delay: 0.4s; }

/* ── UTILITIES ────────────────────────────────────────────── */
.glow-text { text-shadow: 0 0 30px rgba(232,176,32,0.4); }
.text-gold { color: var(--gold-bright); }
.text-teal { color: var(--cb-teal); }
.text-muted { color: var(--text-muted); }
.mono { font-family: 'JetBrains Mono', monospace; }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; } .mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.gap-highlight {
  display: inline-block; background: rgba(200,150,10,0.15);
  border: 1px solid var(--gold-deep); border-radius: 4px;
  padding: 0.1em 0.4em; font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em; color: var(--gold-pale);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0; background: var(--bg-deep); border-bottom: 1px solid var(--border-subtle); padding: 1rem; gap: 0.2rem; }
  .nav-toggle { display: flex; }
  .cg-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .section { padding: 3.5rem 1.5rem; }
}
@media (max-width: 600px) {
  .hero { padding: 5rem 1.5rem 3rem; }
  .cg-2, .cg-3, .cg-4 { grid-template-columns: 1fr; }
  .hero-stats { gap: 0.6rem; }
  .stat-pill { padding: 0.5rem 0.9rem; }
  .btn-row { flex-direction: column; align-items: center; }
}
