/* ─── Dark Theme ─── */
:root {
  --paper: #0a0a0a;
  --paper2: #111111;
  --ink: #f0f0f0;
  --muted: #b0b0b0;
  --faint: #787878;
  --line: #2a2a2a;
  --wash: #151515;
  --accent: #ffffff;
  --accent2: #5a9cff;
  --max: 880px;
  --gutter: 32px;
  --serif: "Satoshi", Georgia, "Times New Roman", ui-serif, serif;
  --sans: "Satoshi", "Helvetica Neue", Helvetica, Arial, ui-sans-serif, sans-serif;
}

/* ─── Light Mode (toggle) ─── */
[data-theme="light"] {
  --paper: #ffffff;
  --paper2: #fafafa;
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --faint: #6a6a6a;
  --line: #e5e5e5;
  --wash: #f5f5f5;
  --accent: #000000;
  --accent2: #0066ff;
}

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

body {
  background-color: var(--paper);
  /* Glitch houndstooth pattern - very subtle */
  background-image:
    url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h8v8H0zm8 8h8v8H8zm16 0h8v8h-8zm-8 8h8v8h-8zm-16 0h8v8H0zm24 8h8v8h-8z' fill='%23ffffff' fill-opacity='0.012'/%3E%3Cpath d='M4 4h2v2H4zm16 0h2v2h-2zm8 16h2v2h-2zm-24 0h2v2H4z' fill='%23ffffff' fill-opacity='0.018'/%3E%3Cpath d='M12 2h1v1h-1zm7 13h1v1h-1zm-10 9h1v1H9z' fill='%234d94ff' fill-opacity='0.025'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 50px;
}

[data-theme="light"] body {
  background-image:
    url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h8v8H0zm8 8h8v8H8zm16 0h8v8h-8zm-8 8h8v8h-8zm-16 0h8v8H0zm24 8h8v8h-8z' fill='%23000000' fill-opacity='0.008'/%3E%3Cpath d='M4 4h2v2H4zm16 0h2v2h-2zm8 16h2v2h-2zm-24 0h2v2H4z' fill='%23000000' fill-opacity='0.012'/%3E%3Cpath d='M12 2h1v1h-1zm7 13h1v1h-1zm-10 9h1v1H9z' fill='%230066ff' fill-opacity='0.02'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none }
a:hover { color: var(--ink) }

.page { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) }

/* ─── Header ─── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 20px;
}
.stamp {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--ink);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
nav {
  display: flex;
  align-items: center;
}
nav a {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-left: 28px;
  position: relative;
}
nav a:first-child { margin-left: 0 }
nav a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width .25s ease;
}
nav a:hover { color: var(--ink) }
nav a:hover::after { width: 100% }

/* ─── Social Links ─── */
.social-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
.social-links a {
  color: var(--faint);
  transition: color .15s;
}
.social-links a:hover {
  color: var(--ink);
}
.social-links svg {
  width: 18px;
  height: 18px;
}

/* ─── Datum + hairline ─── */
.datum { height: 1px; background: var(--line) }
.hairline { height: 1px; background: var(--line) }

/* ─── Hero ─── */
.hero { padding: 80px 0 72px }
h1 {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  line-height: .94;
  letter-spacing: -.02em;
  margin-bottom: 24px;
}
.accent { color: var(--accent) }
.accent2 { color: var(--accent2) }

/* ─── Ticker / Marquee ─── */
.ticker-wrap {
  overflow: hidden;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}
.ticker-wrap.sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: none;
  border-top: 1px solid var(--line);
}
.ticker {
  display: flex;
  animation: ticker 60s linear infinite;
  white-space: nowrap;
}
.ticker:hover {
  animation-play-state: paused;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 32px;
  font-size: 13px;
  color: var(--muted);
}
.ticker-item a {
  color: var(--ink);
  text-decoration: none;
  transition: color .15s;
}
.ticker-item a:hover {
  color: var(--accent2);
}
.ticker-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 8px;
}
.ticker-score {
  margin-left: 8px;
  color: var(--accent2);
  font-weight: 600;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Theme Toggle ─── */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
[data-theme="dark"] .theme-toggle .icon-sun { display: block }
[data-theme="dark"] .theme-toggle .icon-moon { display: none }
.theme-toggle .icon-sun { display: none }
.theme-toggle .icon-moon { display: block }
.thesis {
  font-size: 18px;
  line-height: 1.6;
  max-width: 48ch;
  margin-bottom: 32px;
}
.hero-cta { display: flex; align-items: center; gap: 20px }

/* ─── Buttons: quiet ─── */
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 22px;
  border: 1px solid var(--line);
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink);
  transition: border-color .15s;
}
.btn-outline:hover { border-color: var(--ink); color: var(--ink) }
.btn-text {
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.btn-text:hover { color: var(--ink) }

/* ─── Section headers ─── */
section { margin-top: 72px }
.sh {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.sh h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .01em;
}
.meta {
  font-size: 12px;
  color: var(--faint);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.meta a { color: var(--faint) }
.meta a:hover { color: var(--ink) }

/* ─── Featured items (lines, not cards) ─── */
.feat-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(0,0,0,.10);
}
.feat-label {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 3px;
}
.feat-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  display: block;
  margin-bottom: 4px;
}
a.feat-title:hover { color: var(--ink) }
span.feat-title { color: var(--ink) }
.feat-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

/* ─── Video grid ─── */
.vid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
.vid { text-decoration: none; display: block }
.vid:hover strong { color: var(--ink) }
.vid-thumb {
  aspect-ratio: 16/9;
  background: var(--wash);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.vid-thumb svg { width: 24px; height: 24px; color: var(--faint) }
.vid-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 2px; display: block;
}
.vid strong {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  color: var(--ink); display: block;
  transition: color .15s;
}

/* ─── About ─── */
.about-block { max-width: 600px; margin-bottom: 28px }
.about-block p { font-size: 16px; line-height: 1.7; margin-bottom: 16px }
.muted-text { font-size: 14px; color: var(--muted) }

.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.proof-item {
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ─── Spotlight ─── */
.spotlight {
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--line);
  background: var(--wash);
}
.spotlight-label {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.spotlight-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  display: block;
}
a.spotlight-title:hover { color: var(--accent) }
.spotlight-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 54ch;
}

/* ─── Contact ─── */
.contact-links { display: flex; flex-wrap: wrap; gap: 8px }
.contact-links a {
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color .15s, color .15s;
}
.contact-links a:hover { border-color: var(--ink); color: var(--ink) }

/* ─── Footer ─── */
footer { margin-top: 96px; padding-bottom: 48px }
.footer-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  font-size: 12px;
  color: var(--faint);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer-stamp {
  font-family: var(--serif); font-size: 11px; font-weight: 700;
  color: var(--faint); letter-spacing: .06em;
}
.footer-nav { margin-left: auto }
.footer-nav a { margin-left: 20px; color: var(--faint) }
.footer-nav a:hover { color: var(--ink) }

/* ─── Case study page ─── */
.case-hero { padding: 64px 0 56px }
.case-hero .eyebrow {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}
.case-hero h1 { font-size: 48px; margin-bottom: 16px }
.case-hero .subtitle {
  font-size: 18px;
  line-height: 1.6;
  max-width: 54ch;
  color: var(--muted);
}

.case-section { margin-top: 56px }
.case-section h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}
.case-section p {
  font-size: 15px;
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 16px;
}
.case-section ul {
  list-style: none;
  margin-bottom: 16px;
}
.case-section li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.case-section li:first-child { border-top: 1px solid var(--line) }

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 24px 0;
}
.metric {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.metric .num {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}
.metric .unit {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ─── Writing page ─── */
.writing-intro {
  max-width: 540px;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 48px;
}

/* ─── Page title (for sub-pages) ─── */
.page-title {
  padding: 64px 0 48px;
}
.page-title h1 {
  font-size: 42px;
  margin-bottom: 12px;
}
.page-title p {
  font-size: 16px;
  color: var(--muted);
  max-width: 48ch;
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
  :root { --gutter: 16px }
  h1 { font-size: 40px }
  .hero { padding: 40px 0 32px }
  .case-hero h1 { font-size: 32px }
  .page-title h1 { font-size: 28px }
  .feat-item { grid-template-columns: 1fr; gap: 4px }
  .vid-grid { grid-template-columns: 1fr 1fr }
  .proof-grid { grid-template-columns: 1fr }
  .metric-row { grid-template-columns: 1fr }
  .footer-inner { flex-wrap: wrap }
  section { margin-top: 48px }

  /* Header mobile */
  header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 12px 16px;
  }
  .stamp {
    grid-row: 1;
    grid-column: 1;
  }
  .header-right {
    grid-row: 1;
    grid-column: 2;
    justify-content: flex-end;
    gap: 12px;
  }
  nav {
    grid-row: 2;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 0;
  }
  nav a {
    margin-left: 0;
    margin-right: 16px;
    margin-bottom: 4px;
    font-size: 11px;
  }
  .social-links { display: none }
  .theme-toggle { width: 32px; height: 32px }
  .theme-toggle svg { width: 14px; height: 14px }

  /* Ticker mobile */
  .ticker { animation-duration: 30s }
  .ticker-item { padding: 0 16px; font-size: 11px }
  .ticker-label { font-size: 8px; letter-spacing: .08em }

  /* Spotlight mobile */
  .spotlight { padding: 20px }
  .spotlight-title { font-size: 20px }
}

@media (max-width: 480px) {
  h1 { font-size: 32px }
  .vid-grid { grid-template-columns: 1fr }
  .hero { padding: 24px 0 20px }
  .thesis { font-size: 16px; margin-bottom: 20px }
  nav a { font-size: 10px; margin-right: 12px }
  .social-links svg { width: 16px; height: 16px }
  section { margin-top: 40px }
}
