/* afferent. one stylesheet for every page.
   colours and the type pair come from the dendrite window:
   true black, greys, white, and one dark red that belongs to the itch.
   urbanist for words, fragment mono for numbers and labels. */

@font-face { font-family: "Urbanist"; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/Urbanist-Light.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/Urbanist-Regular.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/Urbanist-Medium.woff2") format("woff2"); }
@font-face { font-family: "Fragment Mono"; font-display: swap;
  src: url("/assets/fonts/FragmentMono-Regular.woff2") format("woff2"); }

:root {
  --bg: #000;
  --ink: #ededed;
  --dim: #979797;
  --faint: #575757;
  --line: #262626;
  --panel: rgba(18, 18, 18, 0.94);
  --red: #cf3a2e;
  --words: "Urbanist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  --nav: 52px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--words);
  font-size: 19px;
  line-height: 1.5;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
::selection { background: var(--ink); color: var(--bg); }

h1, h2, h3, p, ol, ul, dl, dd, dt, figure { margin: 0; padding: 0; font: inherit; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; text-transform: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
main:focus, .part:focus, section:focus { outline: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
.dim { color: var(--dim); }

/* ------------------------------------------------------------ event layer (behind everything) */

#marks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

.frame { position: relative; z-index: 1; }
.wrap { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }

.skip { position: fixed; left: 12px; top: -100px; z-index: 20; background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 999px; }
.skip:focus { top: 8px; }

/* ------------------------------------------------------------ top bar */

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  height: calc(var(--nav) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  /* no backdrop blur: blurring the moving layer behind it every frame was a main cause of lag */
  background: linear-gradient(rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.78));
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
}
.top nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.top a { padding-block: 12px; color: var(--dim); transition: color 0.2s; }
.top a:hover, .top a:focus-visible, .top a[aria-current="page"], .top .wordmark { color: var(--ink); }

/* ------------------------------------------------------------ floating player */

.player {
  position: fixed; z-index: 10;
  left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em;
  white-space: nowrap;
}
.player button { height: 38px; padding-inline: 16px; border-radius: 999px; color: var(--dim); transition: color 0.2s, background 0.2s; }
.player button:hover { color: var(--ink); }
.player button[aria-pressed="true"] { color: var(--ink); }
.seg { display: flex; gap: 2px; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.12); }

/* the dot on a sound control: hollow when off, lit when on */
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 10px; border: 1px solid currentColor; border-radius: 50%; vertical-align: -1px; transition: background 0.2s, box-shadow 0.2s; }
[aria-pressed="true"] > .dot { background: currentColor; box-shadow: 0 0 10px currentColor; }
[data-state="loading"] { cursor: progress; }
[data-state="loading"] > .dot { animation: pulse 0.9s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.25; } to { opacity: 1; } }

/* inline copy of the dry / dendrite switch, used inside pages */
.switch { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; background: rgba(0, 0, 0, 0.5); }
.switch button { height: 36px; padding-inline: 16px; border-radius: 999px; color: var(--dim); transition: color 0.2s, background 0.2s; }
.switch button:hover { color: var(--ink); }
.switch button[aria-pressed="true"] { color: var(--ink); background: rgba(255, 255, 255, 0.12); }

/* buttons */
.cta { display: inline-flex; align-items: center; height: 48px; padding-inline: 26px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 500; font-size: 17px; transition: transform 0.2s var(--ease), background 0.2s; }
.cta:hover { background: #fff; transform: scale(1.03); }
.cta:active { transform: scale(0.98); }
.cta .dot { border-color: var(--bg); }
.cta[aria-pressed="true"] .dot { background: var(--bg); box-shadow: none; }
.more { display: inline-flex; align-items: center; height: 48px; color: var(--ink); font-size: 17px; }
.more::after { content: "→"; margin-left: 8px; transition: transform 0.2s var(--ease); }
.more:hover::after { transform: translateX(4px); }
.cta.off { background: none; border: 1px solid var(--faint); color: var(--faint); cursor: default; }
.cta.off:hover { transform: none; background: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 28px; }

/* ------------------------------------------------------------ home: the product */

.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; align-content: center; justify-items: center; text-align: center;
  gap: 28px;
  padding-top: var(--nav); padding-bottom: 96px;
}
.hero h1 {
  font-weight: 300;
  font-size: clamp(64px, 19vw, 300px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin-block: -0.04em 0;
}
.lede { font-size: clamp(20px, 2.6vw, 30px); font-weight: 300; color: var(--dim); max-width: 24em; }

.scene {
  min-height: 100vh; min-height: 100svh;
  display: grid; align-content: center;
  padding-block: 120px;
}
.scene .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; max-width: 1240px; margin-inline: auto; width: 100%; }
.scene h2 { font-weight: 300; font-size: clamp(38px, 6.2vw, 92px); line-height: 1; letter-spacing: -0.035em; text-wrap: balance; }
.scene p { color: var(--dim); max-width: 26em; }
.copy { display: grid; gap: 24px; justify-items: start; }
.centre { justify-items: center; text-align: center; max-width: 1240px; margin-inline: auto; }
.centre p { max-width: 30em; }
.hint { color: var(--faint); }

/* live stereo display and the playable field share one square stage */
.stage { width: 100%; max-width: 460px; justify-self: center; display: grid; gap: 16px; justify-items: center; }
.square { position: relative; width: 100%; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 28px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
.square canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.axis { position: absolute; color: var(--faint); pointer-events: none; }
.axis.up { top: 14px; left: 50%; transform: translateX(-50%); }
.axis.right { right: 16px; top: 50%; transform: translateY(-50%); }
.axis.left { left: 16px; top: 50%; transform: translateY(-50%); }
.axis.down { bottom: 14px; left: 50%; transform: translateX(-50%); }

.field { touch-action: none; cursor: grab; }
.field:active { cursor: grabbing; }
.cell { position: absolute; width: 44px; height: 44px; margin: -22px; border-radius: 50%; }
.cell::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--faint); transition: background 0.2s; }
.cell:hover::after { background: var(--ink); }
.light { position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: #fff; box-shadow: 0 0 24px 6px rgba(255, 255, 255, 0.35), 0 0 80px 30px rgba(255, 255, 255, 0.08); pointer-events: none; transition: left 0.3s var(--ease), top 0.3s var(--ease), opacity 0.3s; }
.field.dragging .light { transition: opacity 0.3s; }

.figures { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px clamp(32px, 8vw, 120px); }
.figure { display: grid; gap: 4px; justify-items: center; }
.figure b { font-family: var(--mono); font-weight: 400; font-size: clamp(44px, 9vw, 132px); line-height: 1; letter-spacing: -0.04em; color: var(--red); font-variant-numeric: tabular-nums; }

.foot { border-top: 1px solid var(--line); padding-block: 40px 140px; display: grid; gap: 28px; }
.foot .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.foot a { color: var(--dim); transition: color 0.2s; }
.foot a:hover, .foot a:focus-visible { color: var(--ink); }
.foot .links { display: flex; gap: 24px; }

/* the plug-in window on video */
.window { width: 100%; max-width: 1240px; margin-inline: auto; display: grid; gap: 28px; justify-items: center; text-align: center; }
.window .shot { max-width: calc((100svh - 230px) * 1.5714); }
.scene .window p, .centre .hint { max-width: none; }
.window .shot.wide { max-width: 1240px; }
.window .narrow { max-width: 30em; }
.window .title { font-weight: 300; font-size: clamp(38px, 6.2vw, 92px); line-height: 1; letter-spacing: -0.035em; }
.tiles { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 32px); text-align: left; }
.tiles .span { grid-column: 1 / -1; }
.tiles li { display: grid; gap: 14px; align-content: start; }
.tiles .shot { max-width: none; box-shadow: none; border-radius: clamp(12px, 1.6vw, 20px); }
.tiles p { font-size: 17px; max-width: 34em; }
.tiles b { font-weight: 500; }
@media (max-width: 760px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.shot { width: 100%; border: 1px solid var(--line); border-radius: clamp(14px, 2vw, 28px); overflow: hidden; background: #000; line-height: 0; box-shadow: 0 40px 120px rgba(255, 255, 255, 0.05); }
.shot video { width: 100%; height: auto; display: block; }
.part .shot { border-radius: 14px; box-shadow: none; }

/* sections ease in the first time they are seen (only when the script is running) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ text pages */

main[data-page="text"] { padding-top: calc(var(--nav) + 14vh); padding-bottom: 40px; max-width: 1000px; margin-inline: auto; }
.head { display: grid; gap: 16px; padding-bottom: 24px; }
.head h1 { font-weight: 300; font-size: clamp(48px, 9vw, 120px); line-height: 0.95; letter-spacing: -0.04em; }
.head p { color: var(--dim); }

.index { display: flex; flex-wrap: wrap; gap: 4px 22px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
.index a { color: var(--dim); padding-block: 8px; transition: color 0.2s; }
.index a:hover, .index a:focus-visible { color: var(--ink); }

.part { display: grid; grid-template-columns: 150px minmax(0, 34em); column-gap: 40px; padding-block: 56px; border-top: 1px solid var(--line); scroll-margin-top: var(--nav); }
.head + .part, .index + .part { margin-top: 40px; }
.part > h2 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--dim); padding-top: 6px; }
.part > div { display: grid; gap: 1.1em; min-width: 0; }
.text a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.listen { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.rows { display: grid; grid-template-columns: 110px minmax(0, 1fr); column-gap: 20px; row-gap: 0.7em; }
.rows dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--dim); padding-top: 6px; }

/* ------------------------------------------------------------ small screens */

@media (max-width: 760px) {
  body { font-size: 17px; }
  .scene { padding-block: 88px; }
  .scene .cols { grid-template-columns: minmax(0, 1fr); }
  .stage { max-width: 380px; }
  .part { grid-template-columns: minmax(0, 1fr); row-gap: 14px; padding-block: 44px; }
  .rows { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .rows dd { margin-bottom: 0.9em; }
  .player button { padding-inline: 13px; }
}

@media (max-width: 420px) {
  .top nav a[href="/legal/"] { display: none; }      /* still in the footer */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .light, .cta, .more::after { transition: none; }
  [data-state="loading"] > .dot { animation: none; }
}
.top .wordmark { display: inline-flex; align-items: flex-start; }
.wordmark .wm { display: block; height: 30px; width: auto; transform: translateY(4px); }
@media (max-width: 480px) { .wordmark .wm { height: 22px; transform: translateY(3px); } }
