/* Loupe — quiet cartographic editorial landing page, light & dark. */
@font-face { font-family: "Inter"; src: url(fonts/inter.woff) format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(fonts/jbmono.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --bg: light-dark(#f6f6f4, #0f0f11);
  --surface: light-dark(#ffffff, #161618);
  --surface-2: light-dark(#eeeeea, #19191c);
  --nav-glass: light-dark(rgba(246, 246, 244, .88), rgba(15, 15, 17, .86));

  --ink: light-dark(#141416, #f3f3f5);
  --ink-2: light-dark(#4b4b52, #a4a4ac);
  --ink-3: light-dark(#64646b, #8a8a93);

  --line: light-dark(rgba(20, 20, 22, .11), rgba(255, 255, 255, .11));
  --line-strong: light-dark(rgba(20, 20, 22, .19), rgba(255, 255, 255, .20));
  --line-subtle: light-dark(rgba(20, 20, 22, .065), rgba(255, 255, 255, .065));

  --accent: light-dark(#005ec4, #5aa7ff);
  --focus: light-dark(#005ec4, #5aa7ff);

  --btn-bg: light-dark(#141416, #f3f3f5);
  --btn-bg-hover: light-dark(#2d2d32, #ffffff);
  --btn-ink: light-dark(#ffffff, #111113);
  --btn-done: light-dark(#18794e, #30a46c);

  --cmd-bg: light-dark(#ffffff, #161618);
  --cmd-shadow: 0 1px 2px light-dark(rgba(0, 0, 0, .04), transparent);

  --dot: light-dark(rgba(20, 20, 22, .13), rgba(255, 255, 255, .10));

  --canvas: light-dark(#ffffff, #161618); /* the Loupe viewer's own canvas colour */

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --content-w: 1060px; /* one column for header, demo, sections and footer */
  --stage-w: calc(var(--content-w) + var(--gutter) * 2);
  --gutter: 48px;
  color-scheme: light dark;
}
/* theme.js pins an explicit choice; without it (or without JS) the OS setting decides */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }


*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.58 var(--sans);
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
code {
  font-family: var(--mono);
  font-size: .875em;
  letter-spacing: 0;
  color: var(--ink);
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, p, pre, dl, dd { margin: 0; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 14px; border-radius: 8px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); font-weight: 500; transition: top .18s var(--ease);
}
.skip:focus { top: 12px; text-decoration: none; }

/* header: transparent at the top, frosted with a hairline once the page scrolls */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--line-subtle);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nav.scrolled {
    background: var(--nav-glass);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
  }
}
.nav-in {
  max-width: var(--stage-w);
  margin: 0 auto;
  height: 60px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font: 600 16px/1 var(--display);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; opacity: .8; }
.brand img { display: block; border-radius: 6px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-text {
  color: var(--ink-2);
  font: 500 14px/1 var(--sans);
  letter-spacing: -0.006em;
  transition: color .16s var(--ease);
  white-space: nowrap;
}
.nav-text:hover { color: var(--ink); text-decoration: none; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px/1 var(--sans);
  letter-spacing: -0.006em;
  white-space: nowrap;
  transition: background-color .16s var(--ease), border-color .16s var(--ease);
}
.nav-btn:hover { text-decoration: none; background: var(--surface-2); }
.nav-btn .gh { fill: currentColor; flex: none; }

/* centered editorial hero — balanced over the live map stage */
/* Zoom handoff: hero + demo read as one camera move into the map. JS writes --z (0 → 1, eased) from scroll onto .intro
   and adds .zooming, so without JS or with reduced motion everything stays at rest. Three depths move at different rates:
   the headline drifts past the lens (grows, blurs, fades), the frame opens to full size, and the canvas grid zooms
   toward the frame's centre (--oy) while a finer grid fades in between its dots, the way the viewer reveals detail. */
.intro {
  position: relative;
  isolation: isolate;
  overflow: clip;
}
.zoom-grid,
.zoom-grid::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-size: 22px 22px;
}
.zoom-grid {
  z-index: -1;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.5px);
  background-position: center 11px;
  -webkit-mask-image: radial-gradient(ellipse 78% 72% at 50% 38%, #000 35%, transparent 85%);
  mask-image: radial-gradient(ellipse 78% 72% at 50% 38%, #000 35%, transparent 85%);
  transform-origin: 50% var(--oy, 60%);
}
.zoom-grid::after {
  content: "";
  background-image: radial-gradient(circle, var(--dot) .75px, transparent 1.15px);
  background-position: calc(50% + 11px) 22px;
  opacity: 0;
}
.intro.zooming .zoom-grid {
  transform: scale(calc(1 + var(--z) * .25));
  opacity: calc(1 - var(--z) * .3);
  will-change: transform, opacity;
}
.intro.zooming .zoom-grid::after { opacity: clamp(0, (var(--z) - .15) * 1.6, 1); }

/* entrance: the grid spreads out from behind the headline, led by a brighter accent wavefront (::before).
   Motion-only: with reduced motion the grid is simply there. */
@property --ripple-r { syntax: "<length>"; inherits: true; initial-value: 0px; }
@keyframes grid-ripple { from { --ripple-r: 0px; } to { --ripple-r: 150vmax; } }
@media (prefers-reduced-motion: no-preference) {
  .zoom-grid {
    animation: grid-ripple 2.8s cubic-bezier(.3, .6, .4, 1) .15s both;
    -webkit-mask-image: radial-gradient(circle var(--ripple-r) at 50% 34%, #000 calc(100% - 60px), transparent), radial-gradient(ellipse 78% 72% at 50% 38%, #000 35%, transparent 85%);
    -webkit-mask-composite: source-in;
    mask-image: radial-gradient(circle var(--ripple-r) at 50% 34%, #000 calc(100% - 60px), transparent), radial-gradient(ellipse 78% 72% at 50% 38%, #000 35%, transparent 85%);
    mask-composite: intersect;
  }
  .zoom-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle, var(--accent) 1.4px, transparent 2px) center 11px / 22px 22px;
    -webkit-mask-image: radial-gradient(circle var(--ripple-r) at 50% 34%, transparent calc(100% - 70px), #000 calc(100% - 22px), transparent);
    mask-image: radial-gradient(circle var(--ripple-r) at 50% 34%, transparent calc(100% - 70px), #000 calc(100% - 22px), transparent);
    opacity: .7;
  }
}

/* spotlight: dots near the cursor brighten a little (not grow). site.js writes --mx/--my in the grid's own
   coordinates and adds .on; fine pointers only. */
.grid-spot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, light-dark(rgba(20, 20, 22, .3), rgba(255, 255, 255, .24)) 1px, transparent 1.5px) center 11px / 22px 22px;
  -webkit-mask-image: radial-gradient(circle 150px at var(--mx, -999px) var(--my, -999px), #000, transparent);
  mask-image: radial-gradient(circle 150px at var(--mx, -999px) var(--my, -999px), #000, transparent);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.grid-spot.on { opacity: 1; }
/* only once the camera is moving (.moving), so the headline renders crisp, unlayered text at rest */
.intro.zooming.moving .hero-in {
  transform: scale(calc(1 + var(--z) * .05));
  filter: blur(calc(max(0, var(--z) - .3) * 7px));
  opacity: calc(1 - max(0, var(--z) - .2) * 1.25);
}
/* the frame opens like an aperture (a clip, not a scale, so the map keeps its true size and pointer coordinates) */
.intro.zooming .frame {
  clip-path: inset(calc((1 - var(--z)) * 14px) calc((1 - var(--z)) * 30px) round 28px);
}
@media (max-width: 680px) {
  .intro.zooming .frame { clip-path: inset(calc((1 - var(--z)) * 6px) calc((1 - var(--z)) * 10px) round 18px); }
}
.hero {
  padding: 72px var(--gutter) 56px;
  text-align: center;
}
.hero-in {
  max-width: 720px;
  margin: 0 auto;
}

/* entrance: copy rises in sequence, then the map comes into focus like a lens */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes focus-in { from { opacity: 0; filter: blur(10px); transform: scale(.985); } }
.hero h1 { animation: rise .8s var(--ease) both; }
.hero .sub { animation: rise .8s var(--ease) .07s both; }
.hero .hero-act { animation: rise .8s var(--ease) .14s both; }
.stage { animation: focus-in 1s var(--ease) .26s backwards; }
.stage-meta { animation: rise .8s var(--ease) .5s backwards; }
.hero h1 {
  margin: 0 auto;
  font: 600 clamp(32px, 4.1vw, 54px)/1.07 var(--display);
  letter-spacing: -0.036em;
  color: var(--ink);
  max-width: 19ch;
  text-wrap: balance;
}
.sub {
  margin: 14px auto 0;
  font: 400 clamp(15.5px, 1.3vw, 17.5px)/1.5 var(--sans);
  letter-spacing: -0.01em;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: balance;
}
.hero-act {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
}

/* crisp rectilinear terminal command bar */
.cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 4px 4px 4px 14px;
  border-radius: 12px;
  background: var(--cmd-bg);
  border: 1px solid var(--line-strong);
  box-shadow: var(--cmd-shadow);
  max-width: 100%;
}
.cmd .prompt {
  font: 14px var(--mono);
  color: var(--ink-3);
  user-select: none;
}
.cmd code {
  font-size: 14px;
  white-space: nowrap;
}
.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  min-width: 76px;
  margin-left: 4px;
  padding: 0 11px 0 10px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: 500 12.5px/1 var(--sans);
  letter-spacing: -0.008em;
  transition: background-color .16s var(--ease), transform .12s var(--ease);
}
.copy:hover { background: var(--btn-bg-hover); }
.copy:active { transform: scale(.97); }
.copy svg {
  fill: none; stroke: currentColor; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.copy .ic-check { display: none; }
.copy.done { background: var(--btn-done); color: #ffffff; }
.copy.done .ic-copy { display: none; }
.copy.done .ic-check { display: block; }

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color .16s var(--ease);
}
.hero-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .22em; }
.hero-link span { font-size: .95em; opacity: .7; }

/* interactive map — a window onto a real Loupe artifact (its own canvas, dot grid and toolbar).
   Scrolling over the map zooms it; the side gutters stay free for scrolling the page. */
.demo {
  width: 100%;
  /* frame ≈ 16:10, the shape the map fits itself to, on the shared content column */
  --side: max(var(--gutter), calc((100vw - var(--content-w)) / 2));
}
.stage {
  position: relative;
  width: auto;
  margin-inline: var(--side);
}
.frame {
  position: relative;
  width: 100%;
  height: clamp(460px, calc(100svh - 240px), 720px);
  border-radius: 28px; /* at least as round as the map's own outer card, so the corners nest */
  overflow: hidden;
  background: var(--canvas);
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line-subtle);
  pointer-events: none;
}
.frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.frame iframe:focus-visible { outline-offset: -3px; border-radius: inherit; }
.frame.scaled iframe {
  width: var(--lw);
  height: calc(100% / var(--s));
  transform: scale(var(--s));
  transform-origin: 0 0;
}

/* one quiet caption line under the map: source on the left, full-screen link on the right */
.stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-top: 14px;
  padding: 0 calc(var(--side) + 6px);
}
.specimen-meta {
  font: 400 12px/1.4 var(--mono);
  color: var(--ink-3);
}
.full {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font: 500 12.5px/1.4 var(--sans);
  letter-spacing: -0.006em;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color .16s var(--ease);
}
.full:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .22em; }
.full span[aria-hidden] { font-size: .95em; opacity: .7; }

/* touch veil */
.veil { display: none; }
@media (hover: none) and (pointer: coarse) {
  .veil {
    display: grid;
    place-items: end center;
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 0 0 36px;
    border: 0;
    cursor: pointer;
    font: inherit;
    background: linear-gradient(to bottom, transparent 58%, color-mix(in srgb, var(--canvas) 62%, transparent) 100%);
    -webkit-tap-highlight-color: transparent;
  }
  .veil span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .35);
  }
  .veil svg {
    fill: none; stroke: currentColor; stroke-width: 1.55;
    stroke-linecap: round; stroke-linejoin: round;
  }
}
html.is-touch .veil {
  display: grid;
  place-items: end center;
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0 0 36px;
  border: 0;
  cursor: pointer;
  font: inherit;
  background: linear-gradient(to bottom, transparent 58%, color-mix(in srgb, var(--canvas) 62%, transparent) 100%);
  -webkit-tap-highlight-color: transparent;
}
html.is-touch .veil span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .35);
}
html.is-touch .veil svg {
  fill: none; stroke: currentColor; stroke-width: 1.55;
  stroke-linecap: round; stroke-linejoin: round;
}

/* sections: one hairline above each, whitespace everywhere else */
.band {
  margin-top: 112px;
  padding: 0 var(--gutter);
}
.band:last-of-type {
  padding-bottom: 112px;
}
.band-in {
  max-width: var(--content-w);
  margin: 0 auto;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}
.band h2 {
  font: 600 clamp(24px, 2.4vw, 32px)/1.15 var(--display);
  letter-spacing: -0.026em;
  color: var(--ink);
  text-wrap: balance;
}

/* Getting started — plain setup instructions */
.doc { max-width: 620px; }
.doc p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}
.doc p + p,
.doc .cmd + p { margin-top: 14px; }
.doc .cmd { margin-top: 14px; }

/* Reading the map — short intro beside the connection key */
.split {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 32px 64px;
  align-items: start;
}
.lead-copy {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-2);
}
.trace-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.trace-list li {
  display: grid;
  grid-template-columns: 52px 92px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-subtle);
}
.swatch {
  display: inline-flex;
  align-items: center;
  align-self: start;
  margin-top: 5px;
  color: var(--ink);
}
.swatch svg { display: block; overflow: visible; }

/* swatches carry traffic. When the key scrolls into view each line draws in, then one packet runs it;
   hovering a row keeps that packet running. Each type moves the way its connection does:
   code flows straight through, HTTP goes and comes back, data streams slowly, async hops, external leaves the frame. */
.swatch .pkt { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; opacity: 0; }
.trace-list.armed .swatch svg { clip-path: inset(-6px 100% -6px -6px); }
.trace-list.in .swatch svg { animation: sw-draw .75s var(--ease) var(--d, 0s) both; }
.trace-list.in .swatch .pkt { animation: var(--pk) calc(var(--d, 0s) + .55s) 1 both; }
@keyframes sw-draw { to { clip-path: inset(-6px -16px -6px -6px); } }
.sw-code  { --pk: pk-go 1s cubic-bezier(.45, 0, .55, 1); }
.sw-http  { --pk: pk-round 1.7s cubic-bezier(.45, 0, .55, 1); }
.sw-data  { --pk: pk-go 2.1s linear; }
.sw-async { --pk: pk-hop 1.5s linear; }
.sw-ext   { --pk: pk-out 1.3s cubic-bezier(.55, 0, .9, .45); }
@keyframes pk-go {
  0% { opacity: 0; transform: translateX(0); }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translateX(40px); }
}
@keyframes pk-round {
  0% { opacity: 0; transform: translateX(0); }
  8% { opacity: 1; }
  46%, 54% { transform: translateX(40px); }
  92% { opacity: 1; }
  100% { opacity: 0; transform: translateX(0); }
}
@keyframes pk-hop {
  0% { opacity: 0; transform: translateX(0); animation-timing-function: steps(1, end); }
  4% { opacity: 1; transform: translateX(0); animation-timing-function: steps(6, end); }
  92% { opacity: 1; transform: translateX(40px); animation-timing-function: linear; }
  100% { opacity: 0; transform: translateX(40px); }
}
@keyframes pk-out {
  0% { opacity: 0; transform: translateX(0); }
  10% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateX(54px); }
}
.trace-list li:nth-child(2) { --d: .12s; }
.trace-list li:nth-child(3) { --d: .24s; }
.trace-list li:nth-child(4) { --d: .36s; }
.trace-list li:nth-child(5) { --d: .48s; }
.trace-list li { transition: background-color .2s var(--ease); }
@media (hover: hover) {
  .trace-list li:hover .swatch .pkt { animation: var(--pk) 0s infinite both; }
}
.trace-name {
  font: 600 14px/1.4 var(--sans);
  color: var(--ink);
}
.trace-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* footer: one hairline, brand + links, small print below */
.foot {
  padding: 0 var(--gutter) 48px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}
.foot-in {
  max-width: var(--content-w);
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 40px;
}
.foot-brand p { margin-top: 10px; }
.foot-brand a { color: var(--ink-2); }
.foot-brand a:hover { color: var(--ink); text-decoration: none; }
/* appearance: System / Light / Dark (theme.js); hidden without JS, where the OS setting simply applies */
.theme-seg {
  display: inline-flex;
  gap: 2px;
  margin-top: 14px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.theme-seg[hidden] { display: none; }
.theme-seg button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.theme-seg button:hover { color: var(--ink); }
.theme-seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); text-decoration: none; }
.attrib {
  margin-top: 32px;
  max-width: 72ch;
  font-size: 12px;
}
.attrib a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
.attrib a:hover { color: var(--ink); }

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

/* tablet */
@media (max-width: 960px) {
  :root { --gutter: 24px; }
  .split { grid-template-columns: 1fr; gap: 24px; }
}

/* mobile */
@media (max-width: 680px) {
  :root { --gutter: 16px; }
  .nav-in { height: 54px; }
  .nav-links { gap: 16px; }

  .hero { padding: 44px var(--gutter) 36px; }
  .hero h1 { font-size: clamp(28px, 8.2vw, 36px); line-height: 1.09; letter-spacing: -0.032em; }
  .sub { margin-top: 12px; font-size: 15px; }
  .hero-act { margin-top: 16px; gap: 10px 16px; flex-direction: column; }
  .cmd { height: 38px; padding: 4px 4px 4px 10px; gap: 7px; }
  .cmd code, .cmd .prompt { font-size: 13px; }
  .copy { height: 28px; min-width: 66px; margin-left: 2px; padding: 0 9px; font-size: 12px; }
  .hero-link { font-size: 13.5px; }

  .demo { --side: var(--gutter); }
  .frame {
    height: auto;
    aspect-ratio: 1.28 / 1;
    border-radius: 18px;
  }

  .stage-meta { margin-top: 10px; }

  .band { margin-top: 72px; }
  .band:last-of-type { padding-bottom: 72px; }
  .band-in { padding-top: 32px; }
    .trace-list li {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px 12px;
  }
  .trace-desc { grid-column: 2; }

  .foot { padding-bottom: 36px; }
  .foot-row { flex-direction: column; gap: 20px; }
  .foot-links { gap: 8px 20px; }
}

@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .cmd { padding: 3px 3px 3px 9px; gap: 6px; }
  .cmd code, .cmd .prompt { font-size: 12px; }
  .copy { min-width: 58px; margin-left: 0; padding: 0 8px; font-size: 11.5px; }
  html.is-touch .veil { padding-bottom: 28px; }
  html.is-touch .veil span { height: 32px; padding: 0 12px; font-size: 12.5px; }
}
