/* Black canvas, white type, the work as the picture. One family (Archivo): wide caps for display, normal for text. */
:root {
  --black: #000;
  --night: #0a0a0a;
  --tile: #161617;
  --line: #2a2a2c;
  --white: #fff;
  --mute: #a1a1a6;
  --paper: #f5f5f7;
  --ink: #1d1d1f;
  --ink-mute: #6e6e73;

  --m: clamp(20px, 4vw, 64px);
  --section: clamp(96px, 12vw, 180px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--black); color: var(--white);
  font-family: "Archivo", system-ui, -apple-system, sans-serif;
  font-size: 17px; line-height: 1.5; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

.display, .display-m, .display-s, .wordmark, .pill, .kicker {
  text-transform: uppercase; font-stretch: 90%;
}
.display   { font-size: clamp(3rem, 1.6rem + 6vw, 7.5rem); font-weight: 700; line-height: 0.92; letter-spacing: 0.01em; }
.display-m { font-size: clamp(2.2rem, 1.4rem + 3vw, 4.5rem); font-weight: 700; line-height: 0.95; letter-spacing: 0.015em; }
.display-s { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.5rem); font-weight: 700; line-height: 1; letter-spacing: 0.02em; }
.kicker { font-size: 13px; letter-spacing: 0.12em; color: var(--mute); }
.lead { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem); line-height: 1.4; max-width: 36ch; color: #e8e8ed; }

/* Ghost pill buttons */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px; border: 1.5px solid currentColor; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-decoration: none;
  background: transparent; color: inherit; cursor: pointer;
  transition: background-color 200ms, color 200ms, transform 160ms var(--ease);
}
.pill:hover { background: var(--white); color: var(--black); }
.pill:active { transform: scale(0.97); }
.pill-light { color: var(--white); }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--m);
  transition: transform 320ms var(--ease), background-color 300ms;
}
.nav.solid { background: rgba(0,0,0,0.86); }
.nav.away { transform: translateY(-100%); }
.wordmark { font-weight: 800; letter-spacing: 0.18em; font-size: 15px; text-decoration: none; }
.nav nav { display: flex; gap: clamp(14px, 2.4vw, 36px); align-items: center; }
.nav nav a:not(.pill) { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: #d2d2d7; transition: color 160ms; }
.nav nav a:not(.pill):hover { color: var(--white); }
.nav .pill { min-height: 36px; padding: 0 16px; }

/* Robot hero */
.robot { position: relative; height: 330vh; }
.anchor { position: absolute; top: 52%; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.canvas { position: absolute; inset: 0; cursor: grab; touch-action: pan-y; }
.canvas canvas { width: 100% !important; height: 100% !important; }
.hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--mute); font-size: 14px; }

.hero-copy {
  position: absolute; left: var(--m); bottom: clamp(32px, 8vh, 88px); z-index: 2;
  display: flex; flex-direction: column; gap: 20px; align-items: flex-start; max-width: 720px;
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.panel {
  position: absolute; left: var(--m); top: 50%; z-index: 2; width: min(380px, 34vw);
  transform: translateY(-46%); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; gap: 16px;
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.stage.apart .hero-copy { opacity: 0; transform: translateY(24px); pointer-events: none; }
.stage.apart .panel { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.panel-claim { color: var(--mute); font-size: 15px; }
.parts { display: flex; flex-direction: column; }
.parts a {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color 160ms, padding-left 200ms var(--ease);
}
.parts a .val { color: var(--mute); font-size: 13px; white-space: nowrap; }
.parts a:hover, .parts a.is-hot { padding-left: 8px; }
.parts a.is-on { padding-left: 8px; color: var(--white); border-bottom-color: var(--white); }
.note { font-size: 12px; color: #6e6e73; }

.tag {
  position: absolute; left: 0; top: 0; z-index: 3;
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  min-height: 28px; padding: 0 12px; border: 1px solid rgba(255,255,255,0.5); border-radius: 999px; cursor: pointer;
  background: rgba(0,0,0,0.55); color: var(--white);
  opacity: 0; pointer-events: none; transition: opacity 240ms, background-color 160ms, color 160ms;
}
.tag.on { opacity: 1; pointer-events: auto; }
.tag:hover, .tag.is-on { background: var(--white); color: var(--black); }

.drawer {
  position: absolute; z-index: 5; top: 0; bottom: 0; left: 0; width: min(50vw, 760px);
  background: rgba(10,10,10,0.94); display: flex; flex-direction: column; gap: 14px;
  padding: 84px var(--m) var(--m);
  animation: drawer-in 360ms var(--ease);
}
@keyframes drawer-in { from { transform: translateX(-28px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.drawer h3 { font-size: 24px; font-weight: 700; text-transform: uppercase; font-stretch: 90%; letter-spacing: 0.02em; }
.drawer-head p { color: var(--mute); font-size: 15px; max-width: 60ch; margin-top: 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button {
  font: inherit; font-size: 13px; min-height: 34px; padding: 0 14px; border-radius: 999px;
  background: transparent; color: var(--mute); border: 1px solid var(--line); cursor: pointer;
  transition: color 160ms, border-color 160ms;
}
.tabs button:hover { color: var(--white); }
.tabs button[aria-selected="true"] { color: var(--black); background: var(--white); border-color: var(--white); }
.code { flex: 1; min-height: 0; overflow: auto; margin: 0; background: #050505; border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: 12.5px; line-height: 1.6; }
.code code.hljs { background: transparent; padding: 0; }
.drawer-link { font-size: 14px; color: var(--mute); }
.drawer-link:hover { color: var(--white); }

/* Full-bleed photo with type on it */
.band { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5) saturate(0.9); transform: scale(var(--s, 1.08)); }
.band-copy { position: relative; padding: var(--m); display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.band-copy p { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); color: #e8e8ed; max-width: 46ch; }

/* Search / speed */
.runs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.run { background: var(--black); padding: var(--section) var(--m); display: flex; flex-direction: column; gap: 20px; }
.run p { color: #d2d2d7; max-width: 42ch; }
.run .stat { margin-top: 24px; color: var(--mute); font-size: 15px; }
.run .stat span { display: block; color: var(--white); font-size: clamp(2.6rem, 2rem + 2.4vw, 4.2rem); font-weight: 300; line-height: 1; letter-spacing: -0.02em; margin-bottom: 6px; }

/* Fig 1: the Anatomy figure */
.figure-band { padding: var(--section) var(--m); background: var(--black); }
.figure-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.figure-head p { color: var(--mute); max-width: 44ch; }
.figure-band .iso { max-width: 820px; margin: 0 auto; }

/* Work */
.work { background: var(--night); padding: var(--section) var(--m); }
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 48px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button {
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  min-height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--mute);
  transition: color 160ms, border-color 160ms, background-color 160ms;
}
.filters button:hover { color: var(--white); border-color: #555; }
.filters button[aria-pressed="true"] { background: var(--white); color: var(--black); border-color: var(--white); }
.list li { border-top: 1px solid var(--line); }
.list li:last-child { border-bottom: 1px solid var(--line); }
.list .row { display: grid; grid-template-columns: minmax(180px, 1.1fr) 2fr minmax(140px, 1fr) 24px; gap: 24px; align-items: baseline; padding: 22px 0; text-decoration: none; transition: padding-left 220ms var(--ease); }
.list a.row:hover { padding-left: 10px; }
.list .name { font-weight: 700; font-size: 18px; }
.list .text { color: #d2d2d7; }
.list .stack { color: var(--mute); font-size: 14px; }
.list .go { color: var(--mute); transition: transform 200ms var(--ease), color 160ms; }
.list a.row:hover .go { transform: translateX(4px); color: var(--white); }

/* Photo pair */
.pair { display: grid; grid-template-columns: 2fr 1fr; gap: 4px; }
.pair img { width: 100%; height: min(86svh, 54vw); object-fit: cover; }
.pair figcaption { font-size: 13px; color: var(--mute); padding: 12px var(--m) 28px; }

/* About: the one light band */
.about { background: var(--paper); color: var(--ink); padding: var(--section) var(--m); }
.about-lead { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.6rem); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; max-width: 30ch; margin: 32px 0 80px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 96px; }
.facts dt { font-size: 13px; color: var(--ink-mute); margin-bottom: 6px; }
.facts dd { font-size: 17px; font-weight: 600; }
.record { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.record h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px; }
.rows li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 11px 0; border-top: 1px solid #d2d2d7; font-size: 15px; }
.rows .val { color: var(--ink-mute); font-size: 13px; white-space: nowrap; }
.about-photo { margin-top: 120px; }
.about-photo img { width: 100%; height: min(78svh, 50vw); object-fit: cover; border-radius: 18px; }
.about-photo figcaption { font-size: 13px; color: var(--ink-mute); margin-top: 12px; }

/* Contact */
.contact { padding: var(--section) var(--m); min-height: 90svh; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.contact > p { color: var(--mute); font-size: 19px; }
.email { font-size: clamp(2.2rem, 0.8rem + 6.4vw, 7.4rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; text-decoration: none; width: fit-content; transition: color 200ms; overflow-wrap: anywhere; }
.email:hover { color: var(--mute); }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

.footer { border-top: 1px solid var(--line); padding: 28px var(--m) 40px; display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; font-size: 13px; color: var(--mute); }
.footer a { margin-right: 18px; text-decoration: none; }
.footer a:hover { color: var(--white); }

/* Entrances */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .band img { transform: none; }
  .drawer { animation: none; }
}

@media (max-width: 760px) {
  .nav nav a:not(.pill) { display: none; }
  .robot { height: 300vh; }
  .hero-copy { bottom: 28px; right: var(--m); }
  .kicker { font-size: 11px; }
  .panel { top: auto; bottom: 16px; right: var(--m); width: auto; transform: translateY(16px); gap: 10px; }
  .stage.apart .panel { transform: none; }
  .panel-claim, .note { display: none; }
  .parts { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .parts a { border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; min-height: 36px; align-items: center; font-size: 13px; background: rgba(0,0,0,0.6); }
  .parts a .val { display: none; }
  .tag { display: none; }
  .drawer { width: 100%; top: 12svh; border-radius: 18px 18px 0 0; padding-top: 20px; }

  .runs { grid-template-columns: 1fr; }
  .list .row { grid-template-columns: 1fr 20px; gap: 6px 12px; }
  .list .name { grid-column: 1; }
  .list .go { grid-column: 2; grid-row: 1; }
  .list .text, .list .stack { grid-column: 1 / -1; }
  .pair { grid-template-columns: 1fr; }
  .pair img { height: auto; aspect-ratio: 4 / 3; }
  .facts { grid-template-columns: 1fr 1fr; gap: 24px; }
  .record { grid-template-columns: 1fr; gap: 40px; }
  .about-photo img { height: auto; aspect-ratio: 3 / 2; }
}
