/* ==========================================================================
   JDBYTES — site styles
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #06080b;
  --bg-2: #0a0e13;
  --surface: #0e131a;
  --surface-2: #131a23;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #e9eef4;
  --text-2: #a3aebb;
  --text-3: #6b7685;
  --accent: #4ac3f3;      /* brand mark blue */
  --accent-2: #56c4cf;    /* wordmark teal  */
  --accent-glow: rgba(74, 195, 243, 0.35);
  --byte: #cccccc;        /* brand grey squares */

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 68px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
::selection { background: var(--accent); color: #001018; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #001018;
  border-radius: 8px;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* Faint engineering grid across the whole page */
.page-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(6, 8, 11, 0.72);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--line);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 22px; width: auto; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 1px;
  background: var(--accent);
}

.nav .lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.nav .lang-switch svg { width: 14px; height: 14px; }
.nav .lang-switch:hover { border-color: rgba(74, 195, 243, 0.5); color: var(--text); }

/* Suggests the Spanish version on pages that never redirect */
.lang-banner {
  position: fixed;
  left: 50%; bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100% - 32px);
  padding: 12px 12px 12px 20px;
  transform: translateX(-50%);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(14, 19, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7);
  font-size: 14px;
  color: var(--text-2);
  animation: fade 0.5s var(--ease) both;
}
.lang-banner a { color: var(--accent); font-weight: 500; white-space: nowrap; }
.lang-banner button {
  flex: none;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.lang-banner button:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }
@media (max-width: 560px) { .lang-banner { border-radius: 16px; font-size: 13px; } }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px; height: 1.5px;
  margin: 4px auto;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 24px;
    background: rgba(6, 8, 11, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav a { padding: 14px 4px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav .lang-switch { margin: 16px 0 0; align-self: flex-start; border-bottom: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; }
  .nav-open .nav { opacity: 1; transform: none; visibility: visible; }
  .nav-open .site-header { background: rgba(6, 8, 11, 0.96); }
}

/* --------------------------------------------------------------------------
   Shared bits
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.section { position: relative; padding: clamp(96px, 14vw, 168px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(48px, 7vw, 80px); }
.section-head h2 {
  margin-top: 20px;
  font-size: clamp(32px, 4.6vw, 56px);
}
.section-head p { margin-top: 20px; font-size: 18px; color: var(--text-2); max-width: 620px; }

.text-gradient {
  background: linear-gradient(100deg, #fff 10%, var(--accent) 55%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s, gap 0.3s var(--ease);
}
.link-arrow::after { content: "→"; color: var(--accent); transition: transform 0.3s var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover::after { transform: translateX(4px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  font: 500 15px/1 var(--font-sans);
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), color 0.2s;
}
.btn:hover { border-color: rgba(74, 195, 243, 0.6); background: rgba(74, 195, 243, 0.08); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--text); color: #05080b; border-color: var(--text); }
.btn-primary:hover { background: #fff; color: #05080b; border-color: #fff; box-shadow: 0 0 0 6px rgba(74, 195, 243, 0.15); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 48px) 0 96px;
  overflow: hidden;
  isolation: isolate;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  z-index: -2;
  width: 900px; height: 900px;
  right: -260px; top: -200px;
  background: radial-gradient(circle, rgba(74, 195, 243, 0.16) 0%, rgba(74, 195, 243, 0) 60%);
  filter: blur(20px);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
.hero-inner { position: relative; max-width: 760px; }
.hero h1 {
  margin-top: 28px;
  font-size: clamp(46px, 7vw, 100px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero h1 .line > span { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero h1 .line:nth-child(3) > span { animation-delay: 0.24s; }
@keyframes rise { to { transform: none; } }

.hero-lede {
  margin-top: 32px;
  max-width: 600px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-2);
  opacity: 0;
  animation: fade 1s var(--ease) 0.5s forwards;
}
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  opacity: 0;
  animation: fade 1s var(--ease) 0.75s forwards;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta b { color: var(--text-2); font-weight: 500; }
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3ddc97;
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.scroll-cue {
  position: absolute;
  left: 50%; bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0;
  animation: fade 1s var(--ease) 1.2s forwards;
}
.scroll-cue i {
  display: block;
  width: 1px; height: 40px;
  background: linear-gradient(var(--accent), transparent);
  animation: drip 2.2s var(--ease) infinite;
  transform-origin: top;
}
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Hero visual: the JD mark ---------- */
.hero-visual {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  width: 100%;
  max-width: 560px;
  justify-self: end;
  aspect-ratio: 640 / 470;
  opacity: 0;
  animation: fade 1.2s var(--ease) 0.35s forwards;
}
/* soft light behind the tile */
.hero-visual::before {
  content: "";
  position: absolute;
  left: 32%; top: 50%;
  width: 115%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(74, 195, 243, 0.30) 0%, rgba(74, 195, 243, 0.10) 32%, transparent 62%);
  filter: blur(10px);
  pointer-events: none;
}
.hv-rings { position: absolute; inset: 0; pointer-events: none; }
.hv-rings i {
  position: absolute;
  left: 32.3%; top: 49.8%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transform: translate(-50%, -50%);
}
.hv-rings i:nth-child(1) { width: 92%; }
.hv-rings i:nth-child(2) { width: 124%; border-color: rgba(255, 255, 255, 0.05); }
.hv-orbit {
  width: 156%;
  border: 1px dashed rgba(74, 195, 243, 0.18) !important;
  animation: orbit 60s linear infinite;
}
.hv-orbit::after {
  content: "";
  position: absolute;
  left: 50%; top: -4px;
  width: 8px; height: 8px;
  margin-left: -4px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent), 0 0 30px var(--accent-glow);
}
@keyframes orbit { to { transform: translate(-50%, -50%) rotate(360deg); } }

.hv-tilt {
  position: relative;
  width: 100%;
  height: 100%;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.6s var(--ease);
  will-change: transform;
}
.hv-mark {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 40px rgba(74, 195, 243, 0.22));
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.hv-mark .jd-tile, .hv-mark .jd-letters { transform-box: fill-box; }
.hv-mark .jd-byte { transform-box: fill-box; transform-origin: center; }
/* intro: the bytes slide out from behind the D */
.hv-mark .jd-byte-1 { animation: byte-in 1s var(--ease) 0.9s both, byte-drift-1 6s ease-in-out 2s infinite; }
.hv-mark .jd-byte-2 { animation: byte-in 1s var(--ease) 1.05s both, byte-drift-2 6s ease-in-out 2.2s infinite; }
@keyframes byte-in { from { transform: translateX(-70px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes byte-drift-1 { 0%, 100% { transform: none; } 50% { transform: translate(4px, -2px); } }
@keyframes byte-drift-2 { 0%, 100% { transform: none; } 50% { transform: translate(8px, -6px); } }

/* bits streaming away from the bytes */
.hv-mark .jd-bit { fill: var(--accent); opacity: 0; transform-box: fill-box; transform-origin: center; }
.hv-mark .jd-bit-1 { animation: bit 4.2s var(--ease) 2.0s infinite; }
.hv-mark .jd-bit-2 { animation: bit 4.2s var(--ease) 2.25s infinite; }
.hv-mark .jd-bit-3 { animation: bit 4.2s var(--ease) 2.5s infinite; }
.hv-mark .jd-bit-4 { animation: bit-low 5.6s var(--ease) 3.1s infinite; fill: #cccccc; }
@keyframes bit {
  0% { opacity: 0; transform: translate(-28px, 14px) scale(0.4); }
  25% { opacity: 1; transform: none; }
  60% { opacity: 0.85; transform: translate(10px, -5px); }
  100% { opacity: 0; transform: translate(34px, -16px) scale(0.6); }
}
@keyframes bit-low {
  0% { opacity: 0; transform: translateX(-20px) scale(0.5); }
  30% { opacity: 0.8; transform: none; }
  100% { opacity: 0; transform: translateX(60px) scale(0.7); }
}

/* light sweep across the tile */
.hv-mark .jd-sheen { animation: sheen 8s ease-in-out 1.6s infinite; }
@keyframes sheen {
  0% { transform: skewX(-18deg) translateX(0); }
  22%, 100% { transform: skewX(-18deg) translateX(720px); }
}

.hv-shadow {
  position: absolute;
  left: 32%; bottom: -6%;
  width: 52%; height: 7%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(74, 195, 243, 0.22), transparent 70%);
  filter: blur(6px);
  animation: shadow 7s ease-in-out infinite;
}
@keyframes shadow { 0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 1; } 50% { transform: translateX(-50%) scaleX(0.86); opacity: 0.7; } }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-visual { order: -1; justify-self: start; max-width: 230px; margin: 0 0 12px; }
}
@media (max-width: 760px) {
  .scroll-cue { display: none; }
  .hv-rings i:nth-child(2), .hv-orbit { display: none; }
}

/* --------------------------------------------------------------------------
   Manifesto (scroll-lit words)
   -------------------------------------------------------------------------- */
.manifesto { padding: clamp(96px, 16vw, 200px) 0; border-top: 1px solid var(--line); }
.manifesto p {
  max-width: 1050px;
  margin: 28px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 58px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.03em;
}
.manifesto .w { color: rgba(233, 238, 244, 0.14); transition: color 0.35s linear; }
.manifesto .w.lit { color: var(--text); }
.manifesto .w.hl.lit { color: var(--accent); }
.no-js .manifesto .w { color: var(--text); }

/* --------------------------------------------------------------------------
   Systems at work
   -------------------------------------------------------------------------- */
.sys-stage {
  position: relative;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(ellipse 50% 70% at 50% 50%, rgba(74, 195, 243, 0.07), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--bg-2);
  overflow: hidden;
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.8);
}
.sys-canvas {
  display: block;
  width: 100%;
  height: clamp(400px, 36vw, 480px);
  cursor: pointer;
  touch-action: manipulation;
}
.sys-hint {
  position: absolute;
  right: 18px; bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  pointer-events: none;
}
.sys-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
}
.sys-stats > div { padding: 20px 20px 0 0; }
.sys-stats > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.sys-stats dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.sys-stats dd {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sys-stats > div:last-child dd { color: var(--accent); }
@media (max-width: 700px) {
  .sys-canvas { height: 640px; }
  .sys-hint { left: 0; right: 0; text-align: center; }
  .sys-stats { grid-template-columns: 1fr 1fr; }
  .sys-stats > div { padding: 18px 12px 18px 0; border-bottom: 1px solid var(--line); }
  .sys-stats > div + div { padding-left: 0; border-left: 0; }
  .sys-stats > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
}

/* --------------------------------------------------------------------------
   Principles (spotlight cards)
   -------------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
}
.card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  padding: clamp(32px, 4vw, 52px);
  background: var(--bg-2);
  overflow: hidden;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(74, 195, 243, 0.10), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.1em;
}
.card-icon {
  width: 44px; height: 44px;
  margin: 36px 0 28px;
  color: var(--accent);
}
.card-icon svg { width: 100%; height: 100%; }
.card h3 { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 14px; }
.card p { color: var(--text-2); margin: 0; max-width: 440px; }

@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
}

/* --------------------------------------------------------------------------
   Facts + terminal
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 48px;
  border-top: 1px solid var(--line);
}
.fact { padding: 28px 0; border-bottom: 1px solid var(--line); }
.fact:nth-child(odd) { padding-right: 24px; border-right: 1px solid var(--line); }
.fact:nth-child(even) { padding-left: 28px; }
.fact-value {
  font-family: var(--font-display);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.fact-value sup { font-size: 0.45em; color: var(--accent); vertical-align: top; position: relative; top: 0.15em; margin-left: 2px; }
.fact-label { margin-top: 10px; font-size: 14px; color: var(--text-3); }

.terminal {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0d1218, #090c11);
  border: 1px solid var(--line-2);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 40px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 120px -40px var(--accent-glow);
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a313b; }
.terminal-bar span {
  margin-left: auto;
  margin-right: auto;
  transform: translateX(-24px);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.terminal pre {
  margin: 0;
  padding: 24px 24px 28px;
  min-height: 340px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal .p { color: var(--accent); }
.terminal .k { color: #8b98a8; }
.terminal .s { color: #9be3b8; }
.terminal .n { color: #f5c26b; }
.terminal .c { color: #4f5966; }
.terminal .ok { color: #3ddc97; }
.cursor {
  display: inline-block;
  width: 8px; height: 1.15em;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --------------------------------------------------------------------------
   Toolchain marquee
   -------------------------------------------------------------------------- */
.marquee-section { padding: 56px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.012); }
.marquee-label { text-align: center; margin-bottom: 28px; }
.marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track ul { display: flex; margin: 0; padding: 0; list-style: none; }
.marquee-track li {
  display: flex;
  align-items: center;
  gap: 48px;
  padding-right: 48px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  color: var(--text-3);
  white-space: nowrap;
  transition: color 0.2s;
}
.marquee-track li:hover { color: var(--text); }
.marquee-track li::after {
  content: "";
  width: 6px; height: 6px;
  background: var(--byte);
  opacity: 0.35;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact { text-align: center; }
.contact h2 { margin-top: 20px; font-size: clamp(36px, 6vw, 80px); letter-spacing: -0.04em; }
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 40px);
  letter-spacing: -0.02em;
  color: var(--text);
  position: relative;
}
.contact-email a { position: relative; }
.contact-email a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0.25);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.contact-email a:hover::after { transform: scaleX(1); }
.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.copy-btn:hover { color: var(--accent); border-color: rgba(74, 195, 243, 0.5); }
.copy-btn svg { width: 18px; height: 18px; }
.copy-btn .ic-check { display: none; }
.copy-btn.copied { color: #3ddc97; border-color: rgba(61, 220, 151, 0.5); }
.copy-btn.copied .ic-copy { display: none; }
.copy-btn.copied .ic-check { display: block; }
.contact-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  padding: 72px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  font-size: 14px;
  color: var(--text-3);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 56px;
}
.footer-brand img { height: 20px; width: auto; }
.footer-brand p { margin-top: 20px; max-width: 300px; }
.footer-col h4 {
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.footer-col a { transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
}
.footer-bottom .bytes { display: inline-flex; gap: 5px; align-items: center; }
.footer-bottom .bytes i { width: 5px; height: 5px; background: var(--byte); opacity: 0.4; }
.footer-bottom .bytes i:last-child { background: var(--accent); opacity: 1; }
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   Inner pages (apps / legal)
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(64px, 10vw, 128px)) 0 clamp(48px, 7vw, 80px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  width: 700px; height: 700px;
  right: -200px; top: -300px;
  background: radial-gradient(circle, rgba(74, 195, 243, 0.14), transparent 62%);
  pointer-events: none;
}
.page-hero h1 { margin-top: 24px; font-size: clamp(40px, 6.4vw, 80px); letter-spacing: -0.04em; }
.page-hero .lede { margin-top: 24px; max-width: 680px; font-size: clamp(17px, 1.5vw, 19px); color: var(--text-2); }
.page-hero .wrap { position: relative; }
.page-hero-mark {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  width: clamp(160px, 18vw, 240px);
  height: auto;
  transform: translateY(-40%);
  opacity: 0.95;
  filter: drop-shadow(0 30px 60px rgba(74, 195, 243, 0.25));
}
@media (max-width: 960px) { .page-hero-mark { display: none; } }
.page-hero .meta { margin-top: 28px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }
.page-hero .meta b { color: var(--text-2); font-weight: 500; }
.page-hero .meta a { color: var(--text-2); border-bottom: 1px solid rgba(74, 195, 243, 0.5); transition: color 0.2s; }
.page-hero .meta a:hover { color: var(--accent); }

/* Apps page */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  padding: clamp(28px, 3.5vw, 40px);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  margin-bottom: 28px;
  border-radius: 12px;
  background: rgba(74, 195, 243, 0.08);
  border: 1px solid rgba(74, 195, 243, 0.22);
  color: var(--accent);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 22px; margin-bottom: 12px; }
.feature p { margin: 0; color: var(--text-2); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.checklist li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.checklist li::before {
  content: "";
  width: 18px; height: 18px;
  margin-top: 3px;
  border-radius: 5px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ac3f3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat,
    rgba(74, 195, 243, 0.1);
  border: 1px solid rgba(74, 195, 243, 0.3);
}

.two-col { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 96px); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.two-col h2 { font-size: clamp(28px, 3.4vw, 42px); margin-top: 18px; }

.link-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .link-cards { grid-template-columns: 1fr; } }
.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.25s, transform 0.35s var(--ease), background 0.25s;
}
a.link-card:hover { border-color: rgba(74, 195, 243, 0.5); transform: translateY(-3px); background: var(--surface-2); }
.link-card .label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.link-card strong { font-family: var(--font-display); font-size: 21px; font-weight: 500; color: var(--text); }
.link-card span:last-child { color: var(--text-2); font-size: 15px; }
a.link-card strong::after { content: " →"; color: var(--accent); }

/* Legal pages */
.legal {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(80px, 10vw, 140px);
}
.toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.toc h2 {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc ol a {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 7px 0 7px 18px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-3);
  transition: color 0.2s;
}
.toc ol a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; padding-top: 2px; opacity: 0.7; }
.toc ol a:hover { color: var(--text); }
.toc ol a.active { color: var(--text); }
.toc ol a.active::after {
  content: "";
  position: absolute;
  left: -1px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.toc-alt { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; display: grid; gap: 8px; }
.toc-alt a { color: var(--text-2); }
.toc-alt a:hover { color: var(--accent); }

.prose { max-width: 740px; font-size: 16.5px; line-height: 1.75; color: var(--text-2); }
.prose > p:first-child { font-size: 18.5px; color: var(--text); line-height: 1.65; }
.prose section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); }
.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--text);
}
.prose h2 .n { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: 0.04em; }
.prose h3 { margin: 28px 0 10px; font-family: var(--font-sans); font-size: 16.5px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.prose ul { margin: 0 0 1.1em; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.prose li::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.72em;
  width: 6px; height: 6px;
  background: var(--accent);
  opacity: 0.8;
}
.prose a { color: var(--text); border-bottom: 1px solid rgba(74, 195, 243, 0.5); transition: color 0.2s, border-color 0.2s; }
.prose a:hover { color: var(--accent); border-color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.callout {
  margin: 24px 0;
  padding: 22px 24px;
  border: 1px solid rgba(74, 195, 243, 0.25);
  border-left: 2px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(74, 195, 243, 0.05);
  color: var(--text);
}
.callout p:last-child { margin: 0; }
.address-card {
  display: inline-grid;
  gap: 4px;
  padding: 24px 28px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  font-style: normal;
  color: var(--text-2);
}
.address-card strong { font-family: var(--font-display); font-size: 18px; font-weight: 500; margin-bottom: 4px; }

@media (max-width: 960px) {
  .legal { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { columns: 2; column-gap: 24px; }
}
@media (max-width: 560px) { .toc { display: none; } }

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.nf-inner { position: relative; max-width: 720px; }
.nf-code {
  position: absolute;
  right: 4vw;
  top: 50%;
  z-index: -1;
  transform: translateY(-46%);
  font-family: var(--font-display);
  font-size: clamp(150px, 28vw, 420px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(74, 195, 243, 0.32);
  background: linear-gradient(180deg, rgba(74, 195, 243, 0.10), transparent 70%);
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  animation: fade 1.4s var(--ease) 0.2s forwards;
}
.nf-path, .nf-actions, .nf-alt { opacity: 0; animation: fade 1s var(--ease) 0.65s forwards; }
.nf-path {
  display: inline-block;
  max-width: 100%;
  margin: 36px 0 0;
  padding: 12px 18px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.nf-path .p { color: var(--accent); }
.nf-path .n { color: #f5c26b; }
.nf-path .arrow { color: var(--text-3); }
.nf-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.nf-alt { margin: 28px 0 0; font-size: 14px; color: var(--text-3); }
.nf-alt a { color: var(--accent); }
@media (max-width: 760px) {
  .nf-code { right: -4vw; top: auto; bottom: 6vh; transform: none; opacity: 0.6; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero h1 .line > span, .hero-lede, .hero-meta, .scroll-cue { animation: none; opacity: 1; transform: none; }
  .hero-visual, .hv-mark, .hv-mark .jd-byte, .hv-shadow { animation: none !important; opacity: 1; }
  .hv-mark .jd-bit, .hv-mark .jd-sheen { display: none; }
  .marquee-track { animation: none; }
  .manifesto .w { color: var(--text); }
}

@media print {
  .site-header, .site-footer, .toc, .page-grid, .hero-canvas { display: none !important; }
  body, html { background: #fff; color: #000; }
  .prose, .prose p, .prose li { color: #000; }
  .page-hero { padding-top: 0; }
}

/* Inline links inside app-page components */
.checklist a, .link-card span a, .contact-meta a {
  color: var(--text);
  border-bottom: 1px solid rgba(74, 195, 243, 0.5);
  transition: color 0.2s, border-color 0.2s;
}
.checklist a:hover, .link-card span a:hover, .contact-meta a:hover { color: var(--accent); border-color: var(--accent); }
