:root {
  color-scheme: dark;
  --bg: #000;
  --text: #f3f4f5;
  --muted: #8d959e;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --hover: rgba(255, 255, 255, 0.05);
  --max: 1080px;
  --font: Nunito, ui-sans-serif, system-ui, sans-serif;
  --display: Nunito, ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 16px/1.55 var(--font);
  background:
    radial-gradient(900px 480px at 50% -120px, rgba(255, 255, 255, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img, video { max-width: 100%; height: auto; }

a { color: inherit; }

a, button, summary, label, select { cursor: pointer; }

button:disabled { cursor: default; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

::selection { background: rgba(255, 255, 255, 0.18); color: #fff; }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: #fff;
  color: #000;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 4;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.nav-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
  min-height: 64px;
  min-width: 0;
}

.word {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  flex: 0 0 auto;
  white-space: nowrap;
}

.wordmark {
  display: block;
  height: 22px;
  width: auto;
}

.glow-foot {
  width: 28px;
  height: 28px;
  justify-self: center;
}

.nav-github {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.nav-github:hover { background: var(--hover); }

.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.nav-toggle:hover { background: var(--hover); }

.nav-links {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--hover);
}

.nav-links a.ext {
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.nav-links a.ext:hover { background: var(--hover); }

.hero {
  padding: 72px 0 28px;
  text-align: center;
}

.hero-mark {
  width: 168px;
  height: 168px;
  margin: 0 auto 18px;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(52px, 8vw, 84px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

h2 {
  margin: 0 0 12px;
  font-family: var(--font);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

h3 {
  margin: 0 0 10px;
  font-family: var(--font);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.one-liner {
  margin: 20px auto 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.45;
  text-wrap: pretty;
}

.one-liner span { display: block; color: var(--text); }

.command {
  margin: 32px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(440px, 100%);
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  text-align: left;
  background: #050505;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.command:focus-within {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06), 0 18px 50px rgba(0, 0, 0, 0.35);
}

.command code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  color: var(--text);
}

button {
  font: inherit;
  cursor: pointer;
}

.command button,
.snippet button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #fff;
  color: #0a0a0a;
  border-radius: 999px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 600;
  line-height: 1;
  flex: none;
  white-space: nowrap;
}

.command button:hover,
.snippet button:hover { background: #eceeed; }

.meta {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.meta a { color: var(--text); }

.hero-film {
  margin: 28px auto 0;
  width: min(960px, 100%);
  max-width: 100%;
  min-width: 0;
}

.hero-frame {
  /* iOS Safari lays out <video controls> from the 1920×1080 attributes and
     ignores aspect-ratio, so object-fit never gets a short box to fill.
     Height comes only from padding (9/16 of width). height: 0 stops the
     video's intrinsic size from adding to that. content-box is required:
     the global border-box would eat this padding and collapse the frame. */
  position: relative;
  display: block;
  box-sizing: content-box;
  width: calc(100% - 2px);
  height: 0;
  margin: 0;
  /* 1px border on each edge: subtract it so the border box, not the
     padding box, is width × 9/16. */
  padding: 0 0 calc(56.25% - 2px);
  overflow: hidden;
  background: #000;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 28px 80px rgba(0, 0, 0, 0.45);
  line-height: 0;
  transform: translateZ(0);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: 100%;
  min-height: 100%;
  margin: 0;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #000;
  border: 0;
  border-radius: 0;
}

.hero-film figcaption {
  margin-top: 10px;
  text-align: center;
}

.hero-film figcaption code {
  color: var(--text);
  font-size: 14px;
}

.run-copy {
  max-width: 40rem;
}

.run-copy p {
  margin: 0 0 12px;
  color: var(--muted);
  text-wrap: pretty;
}

.run-copy p:last-child { margin-bottom: 0; }

.run-copy strong,
.run-copy code { color: var(--text); }

section {
  padding: 72px 0;
  scroll-margin-top: 76px;
}

.section-lead {
  margin: 0 0 28px;
  max-width: 40rem;
  color: var(--muted);
  font-size: 17px;
  text-wrap: pretty;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: 14px;
}

.facts article,
.path {
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.facts article {
  padding: 22px 20px 20px;
  min-width: 0;
}

.facts p,
.path p {
  margin: 0 0 12px;
  color: var(--muted);
  text-wrap: pretty;
}

.facts p:last-child,
.path p:last-child { margin-bottom: 0; }

.path p strong,
.facts code,
.path code { color: var(--text); }

.paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: 14px;
}

.path {
  padding: 22px 22px 20px;
  min-width: 0;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.snippet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 8px 8px 8px 14px;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #000;
}

.snippet pre {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
}

.snippet button { margin: 0; }

.shot {
  margin: 0;
  padding: 10px 10px 14px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #070808;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 70px rgba(0, 0, 0, 0.45);
}

.shot-wide { margin-bottom: 14px; }

.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: 14px;
}

figcaption {
  margin: 12px 6px 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 56px;
}

.foot {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  min-width: 0;
}

.glow-foot { grid-row: span 2; }

.foot p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.foot-links { margin-top: 4px; }

.foot-links a { color: var(--text); }

.foot-links a + a::before {
  content: "·";
  margin: 0 0.55em;
  color: var(--muted);
}

@media (max-width: 64rem) {
  .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
  }

  .hero { padding-top: 56px; }
  section { padding: 56px 0; }

  .foot-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .foot-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 6px;
  }
}

@media (max-width: 42.5rem) {
  .wrap { width: min(var(--max), calc(100% - 40px)); }

  .nav-inner {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-height: 52px;
  }

  .word {
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .wordmark { height: 20px; }

  /* Menu is in the bar even when the js class never lands (inline script
     blocked, or a browser that drops html.js rules). GitHub stays in that
     row too, so the source link is visible before Menu opens. */
  .nav-github {
    display: inline-flex;
    margin-left: auto;
    min-height: 44px;
    padding: 0 10px;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: 0;
    flex: 0 0 auto;
    min-width: 44px;
    padding: 0 10px;
    font-size: 14px;
  }

  /* Closed bar is mark + wordmark + GitHub + Menu. Page links leave the
     flex row even if display:none is ignored on <nav>. */
  header.nav:not(.is-open) .nav-links {
    display: none;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  header.nav.is-open {
    background: rgba(0, 0, 0, 0.94);
  }

  header.nav.is-open .nav-links {
    display: flex;
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    top: 100%;
    width: auto;
    height: auto;
    margin: 0;
    padding: 8px 20px 16px;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    background: rgba(0, 0, 0, 0.94);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  }

  header.nav.is-open .nav-links a,
  header.nav.is-open .nav-links a.ext {
    min-height: 48px;
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 16px;
  }

  header.nav.is-open .nav-links a:hover,
  header.nav.is-open .nav-links a.ext:hover {
    background: var(--hover);
  }

  /* Without site.js the toggle cannot open, so put the links back.
     The in-nav GitHub item is on screen, so the extra header pill hides. */
  html:not(.js) .nav-github { display: none; }

  html:not(.js) .nav-toggle { display: none; }

  html:not(.js) .nav-inner {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 0 12px;
  }

  html:not(.js) header.nav .nav-links {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    flex: 1 0 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0;
    border: 0;
  }

  html:not(.js) header.nav .nav-links a,
  html:not(.js) header.nav .nav-links a.ext {
    min-height: 44px;
    justify-content: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
  }

  body.nav-locked { overflow: hidden; }

  .hero {
    padding: 12px 0 0;
    overflow-x: clip;
  }

  .hero-mark {
    width: 120px;
    height: 120px;
    margin-bottom: 8px;
  }

  h1 { font-size: clamp(2.75rem, 13vw, 3.5rem); }

  .one-liner {
    margin-top: 10px;
    font-size: 1.0625rem;
  }

  .command {
    margin-top: 14px;
    padding-left: 16px;
  }

  .meta { margin-top: 10px; }

  .hero-film { margin-top: 12px; }

  .hero-frame,
  .shot { border-radius: 16px; }

  .hero-film figcaption { margin-top: 8px; }

  .meta,
  figcaption { font-size: 15px; }

  section { padding: 44px 0; }

  .section-lead {
    margin-bottom: 20px;
    font-size: 1rem;
  }

  .foot-links { gap: 4px 8px; }

  .foot-links a + a::before { content: none; }

  footer {
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }
}

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