/* Layout: a dark FPV-feed hero (live point cloud), then a quiet light "ground plane" page:
   radial nav + swapping panels, then a dated log. Depth colormap is the only loud color. */
:root {
  --bg: #f2f4f3;
  --surface: #ffffff;
  --ink: #121619;
  --muted: #59626a;
  --rule: #d3d9d8;
  --grid: rgba(18, 22, 25, 0.05);
  --accent: #2a52d6;
  --ph: #a44a0c;
  --ph-bg: rgba(164, 74, 12, 0.08);
  --spoke: #b9c1c3;

  /* hero is always night */
  --night: #04060a;
  --osd: #eef4ff;
  --osd-dim: rgba(238, 244, 255, 0.62);

  /* depth colormap stops (turbo-like), used for the name glow and accents */
  --d0: #3b4cc0;
  --d1: #1fb8e0;
  --d2: #7fe05a;
  --d3: #f4c430;
  --d4: #e2531f;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-hero: clamp(3.4rem, 11vw, 8.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e11;
    --surface: #12161a;
    --ink: #e6ebed;
    --muted: #97a1a8;
    --rule: #252e33;
    --grid: rgba(230, 235, 237, 0.045);
    --accent: #8aa4ff;
    --ph: #f0a560;
    --ph-bg: rgba(240, 165, 96, 0.1);
    --spoke: #3a454b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e11;
  --surface: #12161a;
  --ink: #e6ebed;
  --muted: #97a1a8;
  --rule: #252e33;
  --grid: rgba(230, 235, 237, 0.045);
  --accent: #8aa4ff;
  --ph: #f0a560;
  --ph-bg: rgba(240, 165, 96, 0.1);
  --spoke: #3a454b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  overflow-x: hidden;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  color: var(--osd-dim);
}
.eyebrow-ink { color: var(--muted); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: clamp(600px, 92svh, 820px);
  background: var(--night);
  color: var(--osd);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -2;
  touch-action: pan-y;
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(4,6,10,0.78) 0%, rgba(4,6,10,0.35) 48%, rgba(4,6,10,0) 75%),
    linear-gradient(0deg, rgba(4,6,10,0.7) 0%, rgba(4,6,10,0) 30%);
  pointer-events: none;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 20px;
  font-family: var(--mono); font-size: var(--step--1);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.brand { text-decoration: none; font-weight: 500; }
.topbar-links { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
.topbar-links a { text-decoration: none; color: var(--osd-dim); }
.topbar-links a:hover { color: var(--osd); }
.theme-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(238,244,255,0.35); background: rgba(4,6,10,0.3);
  color: var(--osd); cursor: pointer;
}
.theme-btn:hover { border-color: var(--osd); }

.hero-body {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding-block: 40px 24px;
  pointer-events: none;
}
.hero-body a, .hero-body button { pointer-events: auto; }
.hero-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 850;
  font-stretch: 115%;
  font-variation-settings: "wdth" 115;
  font-size: var(--step-hero);
  line-height: 0.86;
  letter-spacing: -0.035em;
  display: flex; flex-direction: column;
  text-shadow: 0 2px 30px rgba(4,6,10,0.45);
}
.hero-lede {
  margin: 6px 0 0;
  max-width: 26ch;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.35;
  color: var(--osd);
  text-wrap: balance;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pill {
  display: inline-flex; align-items: center;
  height: 38px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(238,244,255,0.5);
  color: var(--osd); background: rgba(4,6,10,0.25);
  font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pill:hover { border-color: var(--osd); background: rgba(238,244,255,0.1); }
.pill-solid { background: var(--osd); color: var(--night); border-color: var(--osd); }
.pill-solid:hover { background: #ffffff; color: var(--night); }

.osd {
  position: absolute; inset: 0; pointer-events: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--osd);
  font-variant-numeric: tabular-nums;
}
.osd > div { position: absolute; text-shadow: 0 0 6px rgba(0,0,0,0.6); }
.osd-tl { top: 76px; left: max(16px, env(safe-area-inset-left, 0px)); }
.osd-tr { top: 76px; right: max(16px, env(safe-area-inset-right, 0px)); }
.osd-bl { bottom: 72px; right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) {
  .osd-tl { left: max(32px, env(safe-area-inset-left, 0px)); }
  .osd-tr, .osd-bl { right: max(32px, env(safe-area-inset-right, 0px)); }
}
.rec {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--d4); margin-right: 6px; vertical-align: 1px;
  animation: blink 1.2s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding-block: 0 22px;
}
.caption {
  margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--osd-dim);
}
.caption .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(90deg, var(--d0), var(--d2), var(--d4));
  margin-right: 8px; vertical-align: 1px;
}
.hint { margin-left: auto; }
.seg {
  display: inline-flex; border: 1px solid rgba(238,244,255,0.35); border-radius: 999px; padding: 2px;
}
.seg button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  background: transparent; color: var(--osd-dim); border: 0; border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--osd); color: var(--night); }

@media (max-width: 560px) {
  .osd-bl { bottom: 96px; font-size: 11px; }
  .osd-tr, .osd-tl { top: 70px; font-size: 11px; }
  .hint { display: none; }
}

/* ---------- lower page: faint grid like a ground plane ---------- */
main {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
}

.me {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 32px clamp(32px, 6vw, 80px);
  padding-block: clamp(56px, 9vw, 112px);
  align-items: start;
}
.me-left { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.portrait { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.portrait canvas { width: 132px; height: 132px; image-rendering: pixelated; }
.ph-note {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.4; color: var(--ph);
  max-width: 24ch; text-align: center;
}

.radial {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  max-width: 100%;
}
.radial-spokes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.radial-spokes line { stroke: var(--spoke); stroke-width: 1.5; stroke-dasharray: 2 4; stroke-linecap: round; transition: stroke 0.2s; }
.radial-spokes line.is-on { stroke: var(--ink); stroke-dasharray: none; stroke-width: 1.5; }
.radial button {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--text); font-size: 1.0625rem; color: var(--muted);
  background: none; border: 0; padding: 4px 6px; cursor: pointer; line-height: 1.2;
  transition: color 0.15s;
}
.radial button:hover { color: var(--ink); }
.radial button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.radial-center { left: 50%; top: 50%; font-size: 1.15rem !important; }

.me-right { min-width: 0; padding-top: 8px; }
.nameplate { position: relative; display: inline-block; margin-bottom: 20px; }
.glow {
  position: absolute; inset: -40px -70px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(closest-side at 30% 55%, color-mix(in srgb, var(--d1) 22%, transparent), transparent),
    radial-gradient(closest-side at 72% 50%, color-mix(in srgb, var(--d3) 22%, transparent), transparent);
  filter: blur(14px);
}
.name {
  position: relative; margin: 0;
  font-family: var(--text); font-weight: 600; font-size: var(--step-2); letter-spacing: -0.01em; line-height: 1.15;
}
.say {
  position: relative; margin: 2px 0 0;
  font-family: var(--mono); font-style: italic; font-size: var(--step--1); color: var(--muted);
}

.panels { max-width: 62ch; }
.panel { animation: rise 0.28s ease-out; }
.panel p { margin: 0 0 1em; }
@keyframes rise { from { opacity: 0.35; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.facts { margin: 0; display: grid; gap: 14px; }
.facts div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; }
.facts dt {
  font-family: var(--mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); padding-top: 4px;
}
.facts dd { margin: 0; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px;
}
.card.is-ph { border-style: dashed; }
.card h3 { margin: 4px 0 4px; font-family: var(--text); font-size: var(--step-1); font-weight: 600; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); }
.meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.ph {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ph); background: var(--ph-bg); border: 1px dashed var(--ph);
  border-radius: 4px; padding: 1px 5px; white-space: nowrap; vertical-align: 1px;
}
.ph-line { color: var(--muted); }

.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.email {
  font-family: var(--mono); font-size: var(--step-0);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 10px;
  user-select: all;
}
.pill-small {
  height: 32px; padding: 0 14px; border-color: var(--rule); color: var(--ink); background: var(--surface);
}
.pill-small:hover { border-color: var(--ink); background: var(--surface); }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.links a { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.links a:hover { color: var(--accent); }
.is-ph-link { color: var(--muted); }

/* ---------- log ---------- */
.log { padding-block: 0 clamp(64px, 10vw, 120px); }
.log-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.log-head h2 {
  margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 115%; font-variation-settings: "wdth" 115;
  font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; line-height: 1;
}
.log-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: 820px; }
.log-list li {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.log-list time {
  font-family: var(--mono); font-size: var(--step--1); color: var(--muted); padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.log-list p { margin: 0; }
.log-list .is-ph p { color: var(--muted); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-block: 24px 32px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- narrow ---------- */
@media (max-width: 820px) {
  .me { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .me-left, .me-right { display: contents; }
  .portrait { order: 1; justify-self: center; }
  .nameplate { order: 2; justify-self: center; text-align: center; margin-bottom: 0; }
  .radial { order: 3; justify-self: center; width: min(280px, 100%); }
  .panels { order: 4; justify-self: center; width: 100%; scroll-margin-top: 24px; }
}
@media (max-width: 420px) {
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .log-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .radial button { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rec { animation: none; }
  .panel { animation: none; }
}

.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.log-list a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.log-list a:hover { color: var(--accent); }
.facts a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.facts a:hover { color: var(--accent); }

/* Pre-dithered photos: a 1-bit PNG used as a mask, filled with the ink color so it follows the theme */
.panel-photo { margin: 18px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.panel-photo figcaption { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.dither-img { width: 100%; max-width: 320px; aspect-ratio: 1; background: var(--ink); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.dither-flying { --src: url("assets/flying.png"); }
.dither-car-out { --src: url("assets/car-outside.png"); }
.dither-car-in { --src: url("assets/car-inside.png"); }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.photo-pair .panel-photo { margin: 10px 0 0; }
.photo-pair .dither-img { max-width: none; }
