:root {
  --bg-primary: #05070C;
  --bg-secondary: #0A0E16;
  --bg-card: rgba(16, 20, 28, 0.75);
  --border: #161C2B;
  --border-bright: #232D40;
  --hairline: rgba(255,255,255,0.08);
  --hairline-strong: rgba(255,255,255,0.14);
  --mint: #6EE7B7;
  --ice: #A5F3FC;
  --text-primary: #E8EDF4;
  --text-whisper: #C5CBD4;
  --text-muted: #8B93A1;
  --accent-mint: #6EE7B7;
  --accent-ice: #A5F3FC;
  --text-secondary: #B5BFD0;
  --ease-luxe: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); overflow-x: hidden; -webkit-font-smoothing: antialiased; }

/* Luxury materiality layers */
.ambient-grain, .ambient-vignette, .ambient-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.ambient-grain {
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.8'/></svg>");
  mix-blend-mode: overlay;
}
.ambient-vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
}
.ambient-glow {
  background:
    radial-gradient(ellipse 900px 600px at 15% 10%, rgba(110,231,183,0.05), transparent 60%),
    radial-gradient(ellipse 800px 500px at 85% 90%, rgba(165,243,252,0.04), transparent 60%);
}
nav, main, section, header, footer, article, .container { position: relative; z-index: 10; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 14px 0; background: rgba(5, 7, 12, 0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--hairline); }
nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo svg { height: 32px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none; transition: color 0.45s var(--ease-luxe); }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-cta a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; font-size: 13px; font-weight: 600; border-radius: 10px; text-decoration: none; cursor: pointer; transition: all 0.45s var(--ease-luxe); }
.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--hairline-strong); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn-primary { background: var(--mint); color: var(--bg-primary); border: none; }
.btn-primary:hover { background: #8CF0CC; }
@media (max-width: 768px) { .nav-links { display: none; } }
.page-hero { padding: 160px 0 60px; }
.page-hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 16px; }
.page-hero h1 em, h1 em, h2 em {
  font-family: 'Fraunces', 'Instrument Sans', serif;
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, var(--mint) 0%, var(--ice) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.post-meta { display: flex; align-items: center; gap: 16px; margin: 20px 0 0 0; font-size: 13px; color: var(--text-muted); }
.post-meta-pill { display: inline-flex; align-items: center; padding: 4px 12px; background: var(--bg-card); border: 1px solid var(--hairline); border-radius: 6px; font-weight: 600; color: var(--mint); }
.page-hero p { font-size: 18px; line-height: 1.65; color: var(--text-whisper); max-width: 640px; }
.page-updated { font-size: 13px; color: var(--text-muted); margin-top: 12px; font-family: var(--font-mono); }
.content { padding: 0 0 100px; }
.content-inner { max-width: 760px; }
.content-section { margin-bottom: 48px; }
.content-section h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.content-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; margin-top: 24px; }
.content-section p { font-size: 15px; line-height: 1.75; color: var(--text-whisper); margin-bottom: 12px; }
.content-section ul { list-style: none; padding: 0; margin: 0 0 16px 0; }
.content-section ul li { font-size: 15px; color: var(--text-whisper); line-height: 1.75; padding: 4px 0 4px 20px; position: relative; }
.content-section ul li::before { content: ''; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.content-section strong { color: var(--text-primary); font-weight: 600; }
blockquote {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--text-whisper);
  border-left: 2px solid var(--mint);
  padding: 1rem 0 1rem 1.5rem;
  margin: 2rem 0;
}
pre, code { background: var(--bg-secondary); border: 1px solid var(--hairline); }
.post-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--hairline); }
.post-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; font-size: 13px; font-weight: 600; border-radius: 10px; text-decoration: none; cursor: pointer; transition: all 0.45s var(--ease-luxe); }
.post-nav a.nav-prev { color: var(--text-primary); border: 1px solid var(--hairline-strong); }
.post-nav a.nav-prev:hover { border-color: var(--mint); color: var(--mint); }
.post-nav a.nav-next { color: var(--text-primary); border: 1px solid var(--hairline-strong); }
.post-nav a.nav-next:hover { border-color: var(--mint); color: var(--mint); }
.cost-highlight { background: rgba(110, 231, 183, 0.08); border-left: 3px solid var(--mint); padding: 16px; border-radius: 6px; margin: 16px 0; }
.cost-highlight p { color: var(--text-primary); font-weight: 500; }
footer { padding: 48px 0; border-top: 1px solid var(--hairline); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-left { display: flex; align-items: center; gap: 16px; }
.footer-left svg { height: 22px; width: auto; }
.footer-copy { font-size: 12px; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 12px; color: var(--text-muted); text-decoration: none; transition: color 0.45s var(--ease-luxe); }
.footer-links a:hover { color: var(--text-primary); }

/* ── LIGHT MODE ── */
body.light {
  --bg-primary: #F7F8FA; --bg-card: rgba(255,255,255,0.82); --border: #DDE1E8; --border-bright: #C8CDD6;
  --hairline: rgba(0,0,0,0.08); --hairline-strong: rgba(0,0,0,0.14);
  --text-primary: #111827; --text-whisper: #4B5563; --text-secondary: #4B5563; --text-muted: #9CA3AF;
  --mint: #059669; --ice: #0284C7; --accent-mint: #059669; --accent-ice: #0284C7;
}
body.light nav { background: rgba(247,248,250,0.92); }
body.light .btn-primary { background: #059669; color: #fff; }
body.light .btn-primary:hover { background: #047857; }
body.light .btn-ghost { color: #111827; border-color: #C8CDD6; }
body.light .btn-ghost:hover { border-color: #059669; color: #059669; }
body.light .nav-logo text { fill: #111827; }
body.light .footer-left text { fill: #111827; }
body.light .page-hero h1 em { background: linear-gradient(135deg, #059669, #0284C7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
body.light .cost-highlight { background: rgba(5, 150, 105, 0.08); border-left-color: #059669; }
/* Theme toggle */
.theme-toggle{position:relative;display:inline-block;width:44px;height:24px;border-radius:24px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);cursor:pointer;padding:0;vertical-align:middle;transition:background 0.3s ease, border-color 0.3s ease}
.theme-toggle:hover{border-color:rgba(110,231,183,0.4);background:rgba(255,255,255,0.08)}
.theme-toggle-thumb{position:absolute;top:1px;left:1px;width:20px;height:20px;border-radius:50%;background:#E8ECF2;display:flex;align-items:center;justify-content:center;color:#080A0F;box-shadow:0 1px 3px rgba(0,0,0,0.2);transition:transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease}
body.light .theme-toggle{background:rgba(0,0,0,0.04);border-color:rgba(0,0,0,0.1)}
body.light .theme-toggle:hover{background:rgba(0,0,0,0.06);border-color:rgba(5,150,105,0.4)}
body.light .theme-toggle-thumb{transform:translateX(20px);background:#059669;color:#fff}

/* Light-mode extensions */
body.light {
  background: #F7F8FA;
  color: #111827;
}
body.light .ambient-grain { opacity: 0.015; }
body.light .ambient-vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.04) 100%);
}
body.light .ambient-glow {
  background:
    radial-gradient(ellipse 900px 600px at 15% 10%, rgba(5,150,105,0.04), transparent 60%),
    radial-gradient(ellipse 800px 500px at 85% 90%, rgba(2,132,199,0.03), transparent 60%);
}
body.light nav { border-bottom: 1px solid rgba(0,0,0,0.08); }
body.light footer { border-top: 1px solid rgba(0,0,0,0.08); color: rgba(17,24,39,0.6); }
body.light a { color: #059669; }
body.light a:hover { color: #047857; }
body.light .content-section p,
body.light .content-section ul li { color: #374151; }
body.light .content-section strong { color: #111827; }
body.light .content-section h2 { color: #111827; border-bottom-color: rgba(0,0,0,0.08); }
body.light .content-section h3 { color: #111827; }
body.light .page-hero p { color: #374151; }
body.light .page-updated { color: #6B7280; }
body.light .post-meta { color: #6B7280; }
body.light .post-meta-pill { background: rgba(5,150,105,0.08); border-color: rgba(5,150,105,0.24); color: #047857; }
body.light .content-section ul li::before { background: #059669; }
body.light blockquote { color: #374151; border-left-color: #059669; }
body.light pre, body.light code { background: #EEF0F4; border-color: rgba(0,0,0,0.08); color: #047857; }
body.light .post-nav { border-top-color: rgba(0,0,0,0.08); }
body.light .post-nav a.nav-prev, body.light .post-nav a.nav-next { color: #111827; border-color: rgba(0,0,0,0.14); }
body.light .post-nav a.nav-prev:hover, body.light .post-nav a.nav-next:hover { color: #059669; border-color: #059669; }
body.light .footer-copy { color: #6B7280; }
body.light .footer-links a { color: #6B7280; }
body.light .footer-links a:hover { color: #111827; }
