/* ============================================================
   JJJvR - main.css
   Black. White. One restrained pulse of light. Restraint is the
   luxury signal. Content is HTML; motion is paint on top.
   ============================================================ */

:root {
  --bg: #07070a;
  --bg-raise: #0c0c11;
  --ink: #f4f4f6;
  --dim: #9a9aa4;
  --faint: #55555f;
  --line: rgba(255, 255, 255, 0.08);
  --glow: rgba(140, 190, 255, 0.55);   /* electron */
  --glow-2: rgba(190, 140, 255, 0.35); /* field */
  --max: 1120px;
  --prose: 42rem;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --alien: "Michroma", "Inter", sans-serif;
}

/* alien-tech display face: spaced out, geometric, quiet */
.display { font-family: var(--alien); font-weight: 400; letter-spacing: 0.12em; }
.display-sm { font-family: var(--alien); font-weight: 400; letter-spacing: 0.14em; }

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--dim); }

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

img { max-width: 100%; height: auto; display: block; }

.visually-hidden, .skip {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus {
  position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto;
  background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 100;
}

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max); margin: 0 auto; padding: 20px 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 7, 10, 0.72);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 0 12px -2px var(--glow);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 8px -2px var(--glow); } 50% { box-shadow: 0 0 16px 0 var(--glow); } }
.brand-name { font-family: var(--alien); font-weight: 400; letter-spacing: 0.2em; font-size: 0.62rem; line-height: 1.5; max-width: 24ch; }

.site-header nav { display: flex; align-items: center; gap: 26px; }
.site-header nav a { font-size: 0.86rem; color: var(--dim); transition: color 0.2s; }
.site-header nav a:hover { color: var(--ink); opacity: 1; }
.nav-cta {
  color: var(--ink) !important;
  border: 1px solid var(--line);
  padding: 7px 16px; border-radius: 999px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { border-color: rgba(255,255,255,0.35); box-shadow: 0 0 20px -6px var(--glow); }

/* ---------- hero ---------- */

.hero, .stack-hero { position: relative; overflow: hidden; }
.hero > canvas, .stack-hero > canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--max); margin: 0 auto;
  padding: 128px 24px 96px;
  text-align: left;
}
.kicker { color: var(--faint); margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(1.45rem, 4.2vw, 3.3rem);
  line-height: 1.34;
  text-shadow: 0 0 40px rgba(140, 190, 255, 0.18);
}
.tagline {
  margin-top: 24px; font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--dim); max-width: 34ch;
}
.stackline { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stackline a {
  color: var(--dim); padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
}
.stackline a:hover {
  color: var(--ink); border-color: rgba(140, 190, 255, 0.6); opacity: 1;
  text-shadow: 0 0 16px rgba(140, 190, 255, 0.5);
}
.stackline .sep { color: var(--faint); }
.hero-sub { margin-top: 44px; max-width: 26rem; }

/* ---------- subscribe ---------- */

.subscribe { display: flex; gap: 10px; }
.subscribe input {
  flex: 1; min-width: 0;
  background: var(--bg-raise); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 16px; font: inherit; font-size: 0.92rem;
}
.subscribe input:focus { outline: none; border-color: rgba(255,255,255,0.35); }
.subscribe button {
  background: var(--ink); color: var(--bg);
  border: 0; border-radius: 10px; padding: 13px 22px;
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.subscribe button:hover { box-shadow: 0 0 28px -6px var(--glow); transform: translateY(-1px); }
.subscribe-note { margin-top: 10px; font-size: 0.78rem; color: var(--faint); }

/* ---------- sections ---------- */

.latest, .essays, .interfaces { max-width: var(--max); margin: 0 auto; padding: 56px 24px; }
.section-label { color: var(--faint); margin-bottom: 26px; }

.latest-card a {
  display: block; border: 1px solid var(--line); border-radius: 16px;
  padding: 40px; background: linear-gradient(160deg, var(--bg-raise), transparent 65%);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.latest-card a:hover { border-color: rgba(255,255,255,0.22); box-shadow: 0 0 60px -30px var(--glow); opacity: 1; }
.latest-card h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); letter-spacing: -0.02em; line-height: 1.15; max-width: 24ch; }
.latest-card p { margin-top: 14px; color: var(--dim); max-width: 62ch; }
.latest-card .card-meta { margin-top: 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card a {
  display: block; height: 100%;
  border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  transition: border-color 0.25s, transform 0.2s;
}
.card a:hover { border-color: rgba(255,255,255,0.22); transform: translateY(-2px); opacity: 1; }
.card h3 { margin: 12px 0 8px; font-size: 1.12rem; letter-spacing: -0.01em; line-height: 1.3; }
.card p { color: var(--dim); font-size: 0.9rem; }
.card-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

/* ---------- interfaces ---------- */

.iface-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.iface {
  border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  background: var(--bg-raise);
}
.iface .mono { color: var(--faint); }
.iface h3 { margin: 12px 0 8px; font-size: 1.05rem; }
.iface p { color: var(--dim); font-size: 0.88rem; }
.iface a { display: inline-block; margin-top: 14px; font-size: 0.85rem; border-bottom: 1px solid var(--line); }

/* ---------- CTA band ---------- */

.cta-band {
  max-width: var(--max); margin: 40px auto 96px; padding: 64px 24px;
  text-align: center; border: 1px solid var(--line); border-radius: 20px;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(140,190,255,0.07), transparent),
    var(--bg-raise);
}
.cta-band h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.02em; margin-bottom: 24px; }
.cta-band .subscribe { max-width: 26rem; margin: 0 auto; }

/* ---------- post / prose ---------- */

.post { max-width: var(--prose); margin: 0 auto; padding: 80px 24px 40px; }
.post-header h1 {
  margin-top: 18px;
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
}
.post-hero { margin: 40px -8px 0; }
.post-hero img { border-radius: 14px; border: 1px solid var(--line); }

/* the city, alive: canvas overlay for light trails */
.fx-city { position: relative; }
.fx-city canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; border-radius: 14px;
}

/* ---------- stack pages ---------- */

.stack-hero {
  min-height: 58vh; display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
}
.stack-hero-inner {
  position: relative; z-index: 1;
  max-width: var(--max); margin: 0 auto; width: 100%;
  padding: 110px 24px 80px;
}
.stack-hero h1 {
  font-size: clamp(2.2rem, 8vw, 5.4rem); line-height: 1.1; margin-top: 18px;
  text-shadow: 0 0 60px rgba(140, 190, 255, 0.22);
}
.stack-hero .tagline { margin-top: 20px; }
.stack-body { padding-top: 56px; }

.stack-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 64px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.stack-nav a { color: var(--dim); }
.stack-nav a:hover { color: var(--ink); opacity: 1; }
.stack-nav .here { color: var(--ink); text-shadow: 0 0 14px rgba(140, 190, 255, 0.5); }
.stack-nav-all { color: var(--faint); }

.stack-tiles { max-width: var(--max); margin: 0 auto; padding: 56px 24px; }
.stack-tile { text-align: left; }
.stack-tile h3 { font-size: 0.98rem; }
.stack-tile:hover { border-color: rgba(140, 190, 255, 0.4); box-shadow: 0 0 40px -18px var(--glow); opacity: 1; }
.tile-go { display: inline-block; margin-top: 14px; font-size: 0.82rem; color: var(--dim); }
.stack-tile:hover .tile-go { color: var(--ink); }

.cta-links { margin-bottom: 22px; color: var(--dim); }
.cta-links a { border-bottom: 1px solid var(--faint); }

.prose { margin-top: 44px; }
.prose p { margin-bottom: 1.35em; color: #d6d6dc; }
.prose h2 {
  margin: 2.2em 0 0.7em; font-size: 1.45rem; letter-spacing: -0.02em;
}
.prose h3 { margin: 1.8em 0 0.6em; font-size: 1.15rem; }
.prose a { border-bottom: 1px solid var(--faint); }
.prose a:hover { border-color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 1.35em 1.2em; color: #d6d6dc; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  border-left: 2px solid var(--glow); padding-left: 1.2em; margin: 1.6em 0;
  color: var(--dim); font-style: italic;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3em 0; }
.prose code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-raise); padding: 2px 6px; border-radius: 6px; }
.prose img { border-radius: 12px; border: 1px solid var(--line); margin: 1.5em 0; }
.prose strong { color: var(--ink); }

/* ---------- thesis: figures, tables, gate ---------- */

.thesis-kicker { color: var(--faint); margin-bottom: 1.4em; }
.thesis-byline { color: var(--faint); margin: 1.4em 0 0; }

.fig { margin: 2.4em 0; padding: 22px 14px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raise); }
.fig svg { width: 100%; height: auto; display: block; }
.fig figcaption {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--faint);
}
.fig-hole .spin { animation: hole-spin 60s linear infinite; }
@keyframes hole-spin { to { transform: rotate(360deg); } }

.prose table { width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: 0.86rem; }
.prose th {
  text-align: left; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--faint); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.prose td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: #d6d6dc; vertical-align: top; }
.prose tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Classified redaction bar: the name is not in the document. The bar is what remains. */
.redacted {
  display: inline-block; width: 8.5ch; height: 0.92em;
  background: var(--ink); border-radius: 2px; vertical-align: -0.1em;
  box-shadow: 0 0 16px -5px rgba(244, 244, 246, 0.55);
  cursor: not-allowed;
}
.redacted-sm { width: 6ch; height: 0.8em; }

/* Anthropic-style big-stat blocks */
.statfig { text-align: center; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 10px; }
.stat { padding: 26px 8px 18px; border-bottom: 1px solid var(--line); }
.statgrid:last-of-type .stat { border-bottom: 0; }
.stat-n {
  display: block; font-size: clamp(1.5rem, 4.6vw, 2.7rem); color: var(--ink);
  text-shadow: 0 0 34px rgba(140, 190, 255, 0.22);
}
.stat-amber { color: #ffb450; text-shadow: 0 0 34px rgba(255, 180, 80, 0.25); }
.stat-l { display: block; margin-top: 12px; color: var(--faint); line-height: 1.6; }
@media (max-width: 560px) { .stat-n { font-size: 1.3rem; } .stat-l { font-size: 0.58rem; } }

.gate { position: relative; margin: 0 0 2em; }
.gate::before {
  content: ""; position: absolute; left: 0; right: 0; top: -140px; height: 140px;
  background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none;
}
.gate-inner {
  border: 1px solid rgba(140, 200, 255, 0.3); border-radius: 18px; padding: 40px 28px;
  text-align: center; background:
    radial-gradient(400px 160px at 50% 0%, rgba(140, 200, 255, 0.08), transparent), var(--bg-raise);
  box-shadow: 0 0 60px -30px var(--glow);
}
.gate-kicker { color: var(--dim); margin-bottom: 14px; }
.gate-inner h2 { font-size: clamp(1.2rem, 3vw, 1.7rem); margin-bottom: 14px; }
.gate-inner > .gate-inner p, .gate-inner p { color: var(--dim); max-width: 42ch; margin: 0 auto 8px; }
.gate-form { max-width: 26rem; margin: 22px auto 0; }
html.js .gated.locked { display: none; }
html:not(.js) .gate { display: none; }

.portrait-fig { margin: 2.6em auto; max-width: 400px; text-align: center; }
.portrait-fig img { border-radius: 14px; border: 1px solid var(--line); }
.portrait-fig figcaption {
  margin-top: 12px; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.08em; color: var(--faint);
}

.post-footer { margin-top: 72px; }
.post-footer .cta-band { margin: 0 0 40px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  max-width: 100%; padding: 56px 24px 72px; text-align: center;
}
.footer-stack { color: var(--faint); letter-spacing: 0.3em; }
.footer-links { margin-top: 22px; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.footer-links a { font-size: 0.85rem; color: var(--dim); }
.footer-links a:hover { color: var(--ink); }
.footer-copy { margin-top: 22px; font-size: 0.78rem; color: var(--faint); }

/* ---------- reveal on scroll (JS adds .js to <html>) ---------- */

html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .site-header { padding: 14px 18px; }
  .site-header nav { gap: 16px; }
  .site-header nav a:not(.nav-cta) { display: none; }
  .hero-inner { padding: 88px 18px 64px; }
  .latest-card a { padding: 26px; }
  .subscribe { flex-direction: column; }
}


/* ---- figures for data essays. brand tokens only, no new colours ---- */
.post-fig { margin: 2.4em 0 2.6em; }
.post-fig .fig-title { margin-bottom: .25em; color: var(--ink); }
.post-fig .fig-sub { font-size: .92rem; color: var(--dim); margin-bottom: 1.1em; }
.post-fig .fig-scroll { overflow-x: auto; }
.post-fig svg { display: block; width: 100%; min-width: 520px; height: auto; }
.post-fig .fig-src { margin-top: .9em; color: var(--faint); font-size: .62rem; }
