/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; border: none; outline: none; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* === TOKENS === */
:root {
  --bg:           #F8F8F5;
  --bg-2:         #EEEEE9;
  --surface:      #FFFFFF;
  --text-1:       #18181B;
  --text-2:       #6B6B73;
  --text-3:       #A8A8B0;
  --accent:       #0560D9;
  --accent-tint:  #EEF4FF;
  --border:       rgba(0,0,0,0.07);
  --dark-bg:      #080808;
  --font-d: 'Fraunces', Georgia, serif;
  --font-b: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --nav-h:  62px;
  --max-w:  1080px;
  --pad:    clamp(24px, 5vw, 80px);
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.05), 0 12px 32px rgba(0,0,0,0.06);
  --r-lg: 24px;
}
[data-theme="dark"] {
  --bg:          #080808;
  --bg-2:        #111113;
  --surface:     #1C1C1F;
  --text-1:      #F5F5F0;
  --text-2:      #88888F;
  --text-3:      #55555F;
  --accent:      #5AA0FF;
  --accent-tint: #0A1626;
  --border:      rgba(255,255,255,0.07);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.3);
}

/* === BASE === */
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text-1);
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background 0.5s var(--ease), backdrop-filter 0.5s, box-shadow 0.5s;
}
.nav.scrolled, .nav.solid {
  background: rgba(248,248,245,0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .nav.scrolled, [data-theme="dark"] .nav.solid {
  background: rgba(8,8,8,0.88);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-logo {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-right: auto;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-1); }
.nav-theme {
  width: 36px; height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  background: var(--surface);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.nav-theme:hover { color: var(--text-1); background: var(--bg-2); }
.nav-cta {
  height: 36px;
  padding: 0 20px;
  border-radius: 9999px;
  background: var(--text-1);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.nav-cta:hover { transform: scale(1.03); opacity: 0.88; }
@media (max-width: 640px) { .nav-links { display: none; } }

/* === PAGE HEADER === */
.page-header {
  padding: calc(var(--nav-h) + 72px) var(--pad) 60px;
  max-width: var(--max-w);
  margin: 0 auto;
  flex: 1;
}
.page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.page-h1 {
  font-family: var(--font-d);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 20px;
}
.page-h1 em { font-style: italic; font-weight: 300; color: var(--text-2); }
.page-lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 560px;
  font-weight: 400;
}
.page-updated {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 10px;
}

/* === PROSE CONTENT === */
.prose {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad) 100px;
}
.prose h2 {
  font-family: var(--font-d);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin: 48px 0 16px;
}
.prose h2:first-child { margin-top: 0; }
.prose p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-2);
  margin-bottom: 18px;
}
.prose ul {
  list-style: none;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prose ul li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
  padding-left: 22px;
  position: relative;
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { opacity: 0.75; }
.prose strong { color: var(--text-1); font-weight: 600; }
.prose .callout {
  background: var(--accent-tint);
  border: 1px solid rgba(5,96,217,0.12);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 28px 0;
}
[data-theme="dark"] .prose .callout {
  border-color: rgba(90,160,255,0.15);
}
.prose .callout p { margin-bottom: 0; }
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* === FOOTER === */
footer {
  background: var(--dark-bg);
  padding: 60px var(--pad) 40px;
  margin-top: auto;
}
[data-theme="dark"] footer {
  background: #000;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-logo {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 600;
  color: #F5F5F0;
}
.footer-tagline { font-size: 13px; color: rgba(255,255,255,0.3); }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}
.footer-col a { font-size: 14px; color: rgba(255,255,255,0.5); transition: color 0.2s; }
.footer-col a:hover { color: rgba(255,255,255,0.88); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-copy { font-size: 12px; color: rgba(255,255,255,0.22); }

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
