/* ──────────────────────────────────────────────────────────────
   Quintarthai brand overlay — applied to subpages for consistency
   with homepage v8 redesign. Overrides legacy yellow/navy palette
   with cream/burnt-orange + Source Serif 4 typography.
   ────────────────────────────────────────────────────────────── */

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

:root, [data-theme="light"] {
  --bg: #FAF5EC !important;
  --panel: #FFFFFF !important;
  --gold: #C7551E !important;
  --text: #0F0B07 !important;
  --text-dim: #5C5044 !important;
  --green: #2D6A4F !important;
  --red: #B33A2A !important;
  --blue: #1E3A5F !important;
  --accent: #C7551E;
  --accent-deep: #9A3F14;
  --accent-soft: #F0D9C5;
  --rule: #D4C9B0;
  --ink: #0F0B07;
  --bg-cream: #FAF5EC;
  --bg-paper: #FFFFFF;
}

[data-theme="dark"] {
  --bg: #0E0B08 !important;
  --panel: #14100C !important;
  --gold: #E27C4D !important;
  --text: #F5F0E5 !important;
  --text-dim: #B5A99B !important;
  --green: #7FB996 !important;
  --red: #E27D63 !important;
  --blue: #5B8FB9 !important;
  --accent: #E27C4D;
  --accent-deep: #C7551E;
  --accent-soft: #3A2418;
  --rule: #2E261D;
  --ink: #F5F0E5;
  --bg-cream: #0E0B08;
  --bg-paper: #14100C;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-variant-numeric: tabular-nums;
  background: var(--bg) !important;
  color: var(--text) !important;
  transition: background-color 320ms cubic-bezier(0.4,0,0.2,1), color 320ms cubic-bezier(0.4,0,0.2,1);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Source Serif 4', Georgia, serif !important;
  letter-spacing: -0.02em;
  font-weight: 500;
}

/* Hero — replace gradient-clip with deep ink + italic burnt-orange treatment */
.hero h1 {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: var(--ink) !important;
  color: var(--ink) !important;
}

/* CTAs — match homepage pill style */
.cta {
  background: var(--ink) !important;
  color: var(--bg-cream) !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  padding: 14px 32px !important;
  transition: background 200ms cubic-bezier(0.16,1,0.3,1), transform 200ms;
}
.cta:hover { background: var(--accent) !important; transform: translateY(-1px); }
.cta.outline {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1.5px solid var(--rule) !important;
}
.cta.outline:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: transparent !important;
}

/* Feature cards — paper bg with accent on hover */
.feature {
  background: var(--bg-paper) !important;
  border: 1px solid var(--rule) !important;
  border-radius: 14px !important;
  transition: transform 240ms cubic-bezier(0.16,1,0.3,1), border-color 240ms, box-shadow 240ms;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: var(--accent) !important;
  box-shadow: 0 18px 36px -12px rgba(15,11,7,0.12);
}
.feature h3 { color: var(--ink) !important; font-weight: 500 !important; }
.feature p { color: var(--text-dim) !important; }
.feature .badge {
  background: var(--accent-soft) !important;
  color: var(--accent-deep) !important;
  font-family: 'JetBrains Mono', monospace !important;
}
[data-theme="dark"] .feature .badge { color: var(--accent) !important; }

/* Scenario callouts */
.scenario {
  background: var(--bg-paper) !important;
  border-radius: 14px !important;
  border-left: 4px solid var(--accent) !important;
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.scenario h4 { color: var(--accent) !important; font-weight: 500 !important; }
.scenario .losing { background: rgba(179,58,42,0.06) !important; border-color: rgba(179,58,42,0.25) !important; }
.scenario .winning { background: rgba(45,106,79,0.06) !important; border-color: rgba(45,106,79,0.25) !important; }
.scenario .losing h5 { color: var(--red) !important; }
.scenario .winning h5 { color: var(--green) !important; }

/* Nav */
nav {
  background: color-mix(in srgb, var(--bg) 88%, transparent) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--rule) !important;
  position: sticky; top: 0; z-index: 50;
}
nav a {
  color: var(--ink) !important;
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em;
}
/* Append italic burnt-orange "ai" to the wordmark */
nav a[href="/"]::after {
  content: ' ai';
  font-style: italic;
  color: var(--accent) !important;
  font-weight: 600;
}

/* Section + lead text */
section h2 { color: var(--ink) !important; }
section .lead { color: var(--text-dim) !important; }

/* Footer */
footer {
  background: var(--bg-paper) !important;
  border-top: 1px solid var(--rule) !important;
  color: var(--text-dim) !important;
}

/* Fine print */
.fine { color: var(--text-dim) !important; }

/* Theme toggle button (injected by JS) */
.qt-theme-toggle {
  position: fixed;
  top: 16px; right: 20px;
  width: 38px; height: 38px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-paper);
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  z-index: 200;
  transition: border-color 200ms, background 200ms, transform 200ms;
}
.qt-theme-toggle:hover {
  border-color: var(--accent);
  transform: rotate(8deg);
}
.qt-theme-toggle svg { width: 18px; height: 18px; }
[data-theme="light"] .qt-theme-toggle .sun { display: none; }
[data-theme="light"] .qt-theme-toggle .moon { display: block; }
[data-theme="dark"] .qt-theme-toggle .moon { display: none; }
[data-theme="dark"] .qt-theme-toggle .sun { display: block; }

/* "Back to Quintarthai" nav arrow color */
nav a:hover { color: var(--accent) !important; }
