/* ── TurboQuant Blog — Blackwell Dark Theme ─────────────── */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap');

:root {
  --bg:           #050505;
  --bg-secondary: #0a0a0a;
  --bg-card:      #0e0f11;
  --bg-code:      #08090a;
  --text:         #a1a1aa;
  --text-bright:  #ededed;
  --text-muted:   #71717a;
  --text-dim:     #52525b;
  --green:        #76b900;
  --green-dim:    rgba(118, 185, 0, 0.15);
  --blue:         #60a5fa;
  --blue-dim:     rgba(96, 165, 250, 0.1);
  --purple:       #c084fc;
  --purple-dim:   rgba(192, 132, 252, 0.1);
  --red:          #f43f5e;
  --yellow:       #eab308;
  --border:       rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --max-width:    820px;
  --nav-height:   56px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, rgba(118,185,0,0.06) 0%, transparent 60%);
  animation: fadeIn 0.8s ease-out forwards;
}

/* ── Navigation ─────────────────────────────────────────── */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 32px;
}

nav .nav-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0.04em;
}

nav .nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

nav .nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

nav .nav-links a:hover,
nav .nav-links a.active {
  color: var(--text-bright);
}

/* ── Layout ─────────────────────────────────────────────── */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) 24px 80px;
}

.wide {
  max-width: 1100px;
}

section {
  margin-bottom: 64px;
}

/* ── Typography ─────────────────────────────────────────── */

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-top: 56px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green);
  margin-top: 36px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

p {
  margin-bottom: 16px;
  color: var(--text);
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong {
  color: var(--text-bright);
  font-weight: 600;
}

em { color: var(--text-muted); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Hero ───────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 60px 0 48px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero .hook {
  font-size: 1.4rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

/* ── Stats row ──────────────────────────────────────────── */

.stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin: 32px 0;
}

.stat {
  text-align: center;
}

.stat .number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--green);
  line-height: 1.1;
}

.stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ── Cards / Panels ─────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin: 24px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s, background 0.2s;
}

.card:hover {
  background: rgba(255,255,255,0.02);
}

.card.accent-green { border-top: 2px solid var(--green); border-left: 1px solid var(--border); }
.card.accent-blue  { border-top: 2px solid var(--blue); border-left: 1px solid var(--border); }
.card.accent-purple { border-top: 2px solid var(--purple); border-left: 1px solid var(--border); }
.card.accent-red   { border-top: 2px solid var(--red); border-left: 1px solid var(--border); }

.card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

/* ── Code blocks ────────────────────────────────────────── */

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--blue);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text);
}

.code-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  padding-left: 2px;
}

/* ── Keywords / highlights ──────────────────────────────── */

.kw       { color: var(--purple); }
.fn       { color: var(--blue); }
.str      { color: var(--green); }
.comment  { color: var(--text-dim); font-style: italic; }
.num      { color: var(--yellow); }
.op       { color: var(--text-muted); }
.type     { color: var(--yellow); }
.decorator { color: var(--yellow); }

/* ── Images / Video ─────────────────────────────────────── */

figure {
  margin: 28px 0;
  text-align: center;
}

figure img,
figure video {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

figcaption {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 10px;
  font-style: italic;
}

.img-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.img-row img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Callout ────────────────────────────────────────────── */

.callout {
  background: var(--green-dim);
  border-left: 3px solid var(--green);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
  font-size: 0.95rem;
}

.callout.blue {
  background: var(--blue-dim);
  border-left-color: var(--blue);
}

.callout.purple {
  background: var(--purple-dim);
  border-left-color: var(--purple);
}

/* ── Table ──────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9rem;
}

th, td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

td { color: var(--text); }

tr:hover { background: rgba(255,255,255,0.02); }

/* ── Author card ────────────────────────────────────────── */

.author-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin: 32px 0;
}

.author-card .initials {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--bg);
  flex-shrink: 0;
}

.author-card .info .name {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 1rem;
}

.author-card .info .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.author-card .info .email {
  font-size: 0.82rem;
  color: var(--blue);
}

/* ── Pipeline graphic ───────────────────────────────────── */

.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 32px 0;
}

.pipeline .step {
  text-align: center;
  padding: 16px 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  min-width: 140px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.pipeline .step .icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.pipeline .step .step-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-bright);
}

.pipeline .step .step-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.pipeline .arrow {
  font-size: 1.3rem;
  color: var(--text-dim);
}

/* ── Kernel chips ───────────────────────────────────────── */

.kernel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.kernel-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.2s;
}

.kernel-chip:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  background: rgba(255,255,255,0.03);
}

.kernel-chip.highlight {
  border-color: var(--green);
  box-shadow: 0 0 15px var(--green-dim);
}

.kernel-chip .chip-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
}

.kernel-chip .chip-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Chapter nav (bottom) ───────────────────────────────── */

.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.chapter-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.chapter-nav a:hover {
  color: var(--green);
  text-decoration: none;
}

/* ── Formula ────────────────────────────────────────────── */

.formula {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: var(--green);
  padding: 20px;
  margin: 24px 0;
  background: var(--bg-code);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Footer ─────────────────────────────────────────────── */

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 700px) {
  .hero h1 { font-size: 2rem; }
  .stats-row { gap: 24px; }
  .stat .number { font-size: 1.6rem; }
  .img-row { grid-template-columns: 1fr; }
  
  nav {
    height: auto;
    padding: 12px 20px;
  }
  nav .nav-inner {
    flex-direction: column;
    gap: 12px;
  }
  main {
    padding-top: 130px;
  }
  
  nav .nav-links {
    gap: 20px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  nav .nav-links a { font-size: 13px; }
  
  .pipeline { 
    flex-direction: column;
    gap: 12px; 
  }
  .pipeline .step { 
    width: 100%;
    max-width: 260px;
    padding: 16px; 
  }
  .pipeline .arrow {
    transform: rotate(90deg);
  }
  
  .kernel-grid { grid-template-columns: 1fr; }
  
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}
