@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Instrument+Serif:ital@0;1&display=swap');

/* ========== DESIGN TOKENS ========== */
:root {
  --bg: #06090e;
  --bg2: #0a0e14;
  --card: #0d1117;
  --card-alt: #111820;
  --border: #1a2332;
  --border-light: #243044;
  --cyan: #00e5ff;
  --cyan-dim: rgba(0,229,255,0.12);
  --cyan-glow: rgba(0,229,255,0.25);
  --green: #00e676;
  --green-dim: rgba(0,230,118,0.1);
  --red: #ff1744;
  --red-dim: rgba(255,23,68,0.08);
  --pink: #ff4081;
  --amber: #ffab00;
  --amber-dim: rgba(255,171,0,0.1);
  --purple: #b388ff;
  --txt: #e8eaed;
  --txt2: #8b949e;
  --txt3: #484f58;
  --txt4: #2d3640;
}

/* ========== RESET ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) var(--bg);
}

body {
  background: var(--bg);
  font-family: 'DM Sans', sans-serif;
  color: var(--txt);
  line-height: 1.75;
  overflow-x: hidden;
}

::selection {
  background: var(--cyan);
  color: var(--bg);
}

/* ========== NAV BAR ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: rgba(6,9,14,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-brand .dot { color: var(--cyan); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--txt2);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover {
  color: #fff;
  border-color: var(--border);
  background: var(--card);
}
.nav-link.substack {
  color: #FF6719;
  border-color: rgba(255,103,25,0.3);
  box-shadow: 0 0 8px rgba(255,103,25,0.15), inset 0 0 8px rgba(255,103,25,0.04);
}
.nav-link.substack:hover {
  color: #fff;
  background: rgba(255,103,25,0.12);
  border-color: rgba(255,103,25,0.5);
  box-shadow: 0 0 14px rgba(255,103,25,0.25), inset 0 0 10px rgba(255,103,25,0.06);
}
.nav-link.xlink {
  color: var(--txt2);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 0 8px rgba(255,255,255,0.06), inset 0 0 8px rgba(255,255,255,0.02);
}
.nav-link.xlink:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 14px rgba(255,255,255,0.1), inset 0 0 10px rgba(255,255,255,0.03);
}
.nav-link.accent {
  color: var(--cyan);
  border-color: rgba(0,229,255,0.2);
  box-shadow: 0 0 8px rgba(0,229,255,0.15), inset 0 0 8px rgba(0,229,255,0.04);
}
.nav-link.accent:hover {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.35);
  box-shadow: 0 0 14px rgba(0,229,255,0.25), inset 0 0 10px rgba(0,229,255,0.06);
}

.nav-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}
/* Subpages: shorter hero */
.hero.compact {
  min-height: auto;
  padding: 140px 24px 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 800px 600px at 50% 40%, rgba(0,229,255,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 20% 80%, rgba(0,230,118,0.02) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 80% 20%, rgba(255,23,68,0.02) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.15;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 80%);
}

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
  opacity: 0.8;
}

.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -2px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}
/* Subpages: slightly smaller title */
.hero.compact .hero-title {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.1;
}

.hero-title em {
  font-style: italic;
  color: var(--cyan);
}

.hero-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  color: var(--txt2);
  max-width: 680px;
  line-height: 1.8;
  position: relative;
  z-index: 2;
  margin-bottom: 48px;
}
.hero.compact .hero-subtitle {
  font-size: 17px;
  max-width: 640px;
  margin-bottom: 36px;
}

.hero-equation {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--txt3);
  padding: 16px 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  position: relative;
  z-index: 2;
}
.hero-equation .hl { color: var(--cyan); font-weight: 600; }

.hero-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--txt3);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta .dot { color: var(--cyan); }

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--txt4);
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.7; } }

/* ========== MAIN CONTENT ========== */
.content {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 0px;
}

/* ========== SECTION ========== */
.section {
  margin-bottom: 96px;
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--txt4);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-num::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 28px;
}
.section h2 em {
  font-style: italic;
  color: var(--cyan);
}

.section h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--cyan);
  margin-top: 40px;
  margin-bottom: 16px;
}

.section p {
  font-size: 16.5px;
  color: var(--txt2);
  margin-bottom: 20px;
  line-height: 1.8;
}
.section p strong { color: var(--txt); font-weight: 600; }
.section p .hl   { color: var(--cyan); font-weight: 500; }
.section p .hl-r { color: var(--red); font-weight: 500; }
.section p .hl-g { color: var(--green); font-weight: 500; }
.section p .hl-a { color: var(--amber); font-weight: 500; }
.section p .hl-p { color: var(--purple); font-weight: 500; }

/* ========== CALLOUT CARDS ========== */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  background: var(--card);
  border-radius: 4px;
  padding: 24px 28px;
  margin: 32px 0;
  position: relative;
}
.callout.warn   { border-left-color: var(--amber); }
.callout.danger { border-left-color: var(--red); }
.callout.win    { border-left-color: var(--green); }

.callout-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 10px;
}

.callout p {
  font-size: 15px;
  color: var(--txt2);
  margin-bottom: 0;
  line-height: 1.7;
}
.callout p strong { color: #fff; }
.callout p + p { margin-top: 12px; }

/* ========== TABLE ========== */
.data-table-wrap {
  margin: 28px 0;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.data-table th {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt3);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(26,35,50,0.4);
  color: var(--txt2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .g    { color: var(--green); font-weight: 600; }
.data-table .r    { color: var(--red); font-weight: 600; }
.data-table .a    { color: var(--amber); font-weight: 600; }
.data-table .c    { color: var(--cyan); font-weight: 600; }
.data-table .bold { color: #fff; font-weight: 700; }

/* ========== COMPARISON BLOCK ========== */
.vs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}
.vs-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  position: relative;
}
.vs-card.good    { border-top: 2px solid var(--cyan); }
.vs-card.bad     { border-top: 2px solid var(--red); }
.vs-card.neutral { border-top: 2px solid var(--amber); }

.vs-card .vs-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.vs-card.good .vs-label    { color: var(--cyan); }
.vs-card.bad .vs-label     { color: var(--red); }
.vs-card.neutral .vs-label { color: var(--amber); }

.vs-card .vs-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}
.vs-card.good .vs-val    { color: var(--cyan); }
.vs-card.bad .vs-val     { color: var(--red); }
.vs-card.neutral .vs-val { color: var(--amber); }

.vs-card .vs-desc {
  font-size: 13px;
  color: var(--txt3);
  line-height: 1.5;
}

/* ========== STAT GRID ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 32px 0;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }

.stat-cell {
  background: var(--card);
  padding: 20px 24px;
  text-align: center;
}
.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}
.stat-val.g { color: var(--green); }
.stat-val.c { color: var(--cyan); }
.stat-val.a { color: var(--amber); }
.stat-val.r { color: var(--red); }
.stat-val.p { color: var(--purple); }

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt3);
}

/* ========== PRINCIPLE CARDS ========== */
.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 32px 0;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.principle {
  background: var(--card);
  padding: 24px 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.principle-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--border-light);
  flex-shrink: 0;
  width: 40px;
  text-align: right;
}
.principle-body h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}
.principle-body p {
  font-size: 14px;
  color: var(--txt2);
  margin-bottom: 0;
  line-height: 1.65;
}

/* ========== TIMELINE ========== */
.timeline {
  margin: 32px 0;
  border-left: 2px solid var(--border);
  padding-left: 28px;
}
.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -34px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
}
.timeline-item.loss::before { background: var(--red); }
.timeline-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--txt3);
  margin-bottom: 4px;
}
.timeline-event {
  font-size: 15px;
  color: var(--txt2);
  line-height: 1.6;
}
.timeline-event strong { color: #fff; }
.timeline-event .hl-g { color: var(--green); font-weight: 600; }
.timeline-event .hl-r { color: var(--red); font-weight: 600; }

/* ========== QUOTE BLOCK ========== */
.axiom {
  margin: 48px 0;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.axiom p {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 24px;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 12px;
}
.axiom .attr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--txt3);
  letter-spacing: 1px;
}

/* ========== VERDICT BLOCK ========== */
.verdict {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  padding: 32px;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}
.verdict::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.verdict.pass::before    { background: var(--green); }
.verdict.caution::before { background: var(--amber); }
.verdict.fail::before    { background: var(--red); }

.verdict-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.verdict.pass .verdict-header    { color: var(--green); }
.verdict.caution .verdict-header { color: var(--amber); }
.verdict.fail .verdict-header    { color: var(--red); }

.verdict-title {
  font-family: 'Instrument Serif', serif;
  font-size: 26px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 12px;
}
.verdict p {
  font-size: 15px;
  color: var(--txt2);
  margin-bottom: 0;
  line-height: 1.7;
}

/* ========== CODE BLOCK ========== */
.code-block {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 24px;
  margin: 20px 0;
  overflow-x: auto;
  color: var(--txt2);
  line-height: 1.7;
  white-space: pre;
}
.code-block .comment { color: var(--txt3); }
.code-block .keyword { color: var(--cyan); }
.code-block .val     { color: var(--green); }

/* ========== SHOWCASE IMAGE ========== */
.showcase-img {
  margin: 32px 0;
  border-radius: 6px;
  border: 1px solid rgba(0,229,255,0.2);
  box-shadow: 0 0 20px rgba(0,229,255,0.1), 0 0 60px rgba(0,229,255,0.05);
  overflow: hidden;
  background: var(--card);
}
.showcase-img img {
  width: 100%;
  display: block;
}
.showcase-img figcaption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--txt3);
  text-align: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.5px;
}

/* ========== SUBSTACK CTA ========== */
.cta-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px 80px;
  text-align: center;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, #FF6719 0%, #e8530e 100%);
  border: 1px solid rgba(255,103,25,0.5);
  border-radius: 6px;
  padding: 20px 48px;
  text-decoration: none;
  position: relative;
  box-shadow:
    0 0 20px rgba(255,103,25,0.3),
    0 0 60px rgba(255,103,25,0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.3s ease;
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 30px rgba(255,103,25,0.45),
    0 0 80px rgba(255,103,25,0.2),
    0 4px 20px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.cta-btn:active { transform: translateY(0); }
.cta-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.cta-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--txt3);
  margin-top: 16px;
}

/* ========== FOOTER ========== */
.doc-footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.doc-footer .footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}
.doc-footer .footer-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--txt3);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.doc-footer .footer-link:hover { color: var(--cyan); }
.doc-footer .footer-link svg { width: 14px; height: 14px; }

.doc-footer .copyright {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--txt4);
  letter-spacing: 1px;
}
.doc-footer .brand { color: var(--cyan); font-weight: 600; }

/* ========== RESPONSIVE ========== */
@media (max-width: 700px) {
  .nav { padding: 0 16px; }
  .nav-link span.hide-mobile { display: none; }
  .vs-grid { grid-template-columns: 1fr; }
  .stat-grid, .stat-grid.four { grid-template-columns: 1fr 1fr; }
  .hero-title { letter-spacing: -1px; }
  .section h2 { font-size: 28px; }
  .content { padding: 0 16px 80px; }
  .principle { padding: 20px; gap: 14px; }
  .principle-num { font-size: 18px; width: 28px; }
  .hero-meta { flex-direction: column; gap: 8px; }
}
