@font-face {
  font-family: "Pitch Sans";
  src: url("assets/sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pitch Serif";
  src: url("assets/serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pitch Serif";
  src: url("assets/serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #161514;
  --panel: #1e1d1b;
  --line: rgba(242, 237, 228, 0.09);
  --line-2: rgba(242, 237, 228, 0.18);
  --ink: #f2ede4;
  --ink-2: #c8c1b5;
  --muted: #8f887d;
  --bar: #4a4642;
  --vermilion: #ff5a36;
  --vermilion-hi: #ffa58f;
  --mint: #7de8c0;
  --mint-hi: #c4f7e3;
  --sig: var(--vermilion);
  --sig-hi: var(--vermilion-hi);
  --sig-ink: #200b05;
  --sig-rgb: 255, 90, 54;
  --sans: "Pitch Sans", "DM Sans", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Pitch Serif", "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page {
  width: min(1240px, 100% - 2 * clamp(20px, 4vw, 56px));
  margin-inline: auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Masthead */
.masthead { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.mark { width: 26px; height: 21px; fill: var(--ink); }
.wordmark { font-weight: 560; font-size: 19px; letter-spacing: -0.02em; }
.how-btn {
  background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 450; color: var(--ink-2); cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.how-btn:hover { border-color: var(--ink-2); color: var(--ink); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 21rem);
  align-items: end;
  gap: 20px clamp(28px, 4vw, 64px);
  padding: clamp(24px, 5vh, 56px) 0 clamp(20px, 3.4vh, 36px);
}
h1 {
  margin: 0 0 0 -.06em;
  font-weight: 560;
  font-size: clamp(3rem, 7.6vw, 7.8rem);
  line-height: .9;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
h1 em {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.015em; font-size: 1.14em; color: var(--vermilion);
}
.br-m { display: none; }
.lede { margin: 0 0 .4em; font-size: clamp(1.02rem, 1.3vw, 1.18rem); line-height: 1.45; color: var(--ink-2); font-weight: 380; }

.app-launch { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; }
.open-app {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; text-decoration: none;
}
.open-app:hover { background: white; }
.app-launch p { flex: 1 1 10rem; margin: 0; max-width: 24em; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.app-launch code { font: inherit; white-space: nowrap; }

/* Player */
.player[data-take="amused"] { --sig: var(--mint); --sig-hi: var(--mint-hi); --sig-ink: #06231a; --sig-rgb: 125, 232, 192; }
.player {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  padding: clamp(18px, 2.4vw, 28px) clamp(16px, 3vw, 40px) clamp(16px, 2vw, 24px);
}
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 520; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* Performance selector */
.takes { margin: 0; padding: 4px; display: inline-flex; gap: 4px; border-radius: 999px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.take { position: relative; cursor: pointer; }
.take input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.take-face {
  display: inline-flex; white-space: nowrap; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 520; color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.take:hover .take-face { color: var(--ink); }
.take input:checked + .take-face { background: var(--sig); color: var(--sig-ink); }
.take input:focus-visible + .take-face { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Stage */
.stage {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: clamp(18px, 3vw, 40px);
  margin-top: 28px;
}
.play {
  --s: clamp(68px, 7vw, 88px);
  width: var(--s); height: var(--s); border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center;
  color: var(--sig-ink); background: var(--sig);
  box-shadow: 0 0 0 8px rgba(var(--sig-rgb), .1);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.play:hover { transform: translateY(-1px); box-shadow: 0 0 0 11px rgba(var(--sig-rgb), .14); }
.play:active { transform: translateY(1px) scale(.97); }
.play:focus-visible { outline-offset: 6px; border-radius: 50%; }
.ico { width: 38%; height: 38%; fill: currentColor; display: none; }
.player[data-state="idle"] .ico-play,
.player[data-state="paused"] .ico-play { display: block; transform: translateX(6%); }
.player[data-state="playing"] .ico-pause { display: block; }
.player[data-state="ended"] .ico-replay { display: block; }
.player[data-state="loading"] .ico-load { display: block; animation: spin .9s linear infinite; }
.player[data-state="error"] .ico-error { display: block; }
.player[data-state="error"] .play { background: #34302c; color: var(--vermilion-hi); box-shadow: none; cursor: not-allowed; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.scope { min-width: 0; }
.tag {
  display: inline-block; max-width: 100%; min-height: 1.9em; margin-bottom: 10px;
  font-size: 11px; font-weight: 600; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--sig); padding: 4px 10px; border-radius: 8px;
  border: 1px solid rgba(var(--sig-rgb), .4);
  transition: background .2s, color .2s, border-color .2s;
}
.tag:empty { visibility: hidden; }
.player.live .tag { background: var(--sig); color: var(--sig-ink); }
.wave {
  position: relative;
  height: clamp(90px, 13vh, 136px);
  cursor: pointer;
  touch-action: none;
}
.player[data-state="error"] .wave { cursor: default; }
.bars {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(var(--n, 160), 1fr); gap: clamp(1px, .25vw, 3px);
  align-items: center;
}
.bar {
  height: calc(var(--h, .02) * 100%);
  min-height: 2px;
  border-radius: 99px;
  background: var(--bar);
  transition: height .7s var(--ease), background .12s linear;
}
.bar.p { background: var(--ink-2); }
.bar.c { background: rgba(var(--sig-rgb), .55); }
.bar.c.p { background: var(--sig); }
.wave.empty .bar { background: var(--line-2); }

.band {
  position: absolute; top: -6px; bottom: -6px; left: 0; width: 0;
  border-radius: 8px;
  background: rgba(var(--sig-rgb), .07);
  border: 1px solid rgba(var(--sig-rgb), .3);
  opacity: 0; transition: opacity .3s var(--ease), background .2s, border-color .2s;
  pointer-events: none;
}
.band.ready { opacity: 1; }
.player.live .band { background: rgba(var(--sig-rgb), .16); border-color: var(--sig); }
.head {
  position: absolute; top: -10px; bottom: -10px; left: 0; width: 2px; margin-left: -1px;
  background: var(--ink); border-radius: 2px; opacity: 0; pointer-events: none;
}
.player[data-state="playing"] .head,
.player[data-state="paused"] .head { opacity: 1; }

.timeline { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 16px; }
.time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: .03em; min-width: 4.6em; }
.time:last-child { text-align: right; }
.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; margin: 0; --pct: 0%; }
.seek::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--sig) var(--pct), var(--line-2) var(--pct)); }
.seek::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line-2); }
.seek::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--sig); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; background: var(--ink); border: 0; }
.seek::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--ink); border: 0; }
.seek:disabled { cursor: default; opacity: .4; }

/* Cue: the payoff */
.cue {
  margin-top: clamp(18px, 3vh, 30px);
  padding-top: clamp(16px, 2.6vh, 26px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas: "k k" "v d";
  gap: 8px clamp(24px, 4vw, 56px); align-items: end;
}
.cue p { margin: 0; }
.cue-k { grid-area: k; font-size: 12px; font-weight: 520; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cue-t { margin-left: .8em; letter-spacing: .04em; color: var(--ink-2); font-variant-numeric: tabular-nums; text-transform: none; }
.cue-v {
  grid-area: v; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3.3rem); line-height: 1; letter-spacing: -0.01em;
  color: var(--sig); overflow-wrap: anywhere; transition: color .2s;
}
.cue-d { grid-area: d; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 34em; }

.status { margin: 10px 0 0; min-height: 1.4em; font-size: 13px; color: var(--muted); }
.player[data-state="error"] .status { color: var(--vermilion-hi); }

/* Footer */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px;
  padding: clamp(18px, 3vh, 32px) 0 clamp(18px, 3vh, 28px);
  font-size: 13px; color: var(--muted);
}
.foot-note { margin-left: auto; }

/* Dialog */
.how {
  width: min(560px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 22px;
  background: var(--panel); color: var(--ink);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow-y: auto; overscroll-behavior: contain;
}
.how::backdrop { background: rgba(10, 9, 8, .75); backdrop-filter: blur(6px); }
.how[open] { animation: rise .32s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.how-inner { padding: 28px 30px 32px; }
.how-top { display: flex; align-items: center; justify-content: space-between; }
.how h2 { margin: 0; font-weight: 560; font-size: 28px; letter-spacing: -0.03em; }
.close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.close:hover { border-color: var(--ink-2); color: var(--ink); }
.close svg { width: 16px; height: 16px; }
.steps { list-style: none; margin: 22px 0 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.steps .n { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--vermilion); line-height: 1; }
.steps h3 { margin: 0 0 4px; font-size: 16px; font-weight: 560; }
.steps p { margin: 0; color: var(--ink-2); font-size: 15px; }
.shot { margin: 8px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.shot figcaption { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line-2); }

/* Laptop fit */
@media (min-width: 900px) and (max-height: 820px) {
  .hero { padding-top: 20px; padding-bottom: 20px; }
  h1 { font-size: clamp(3rem, 6.4vw, 6.4rem); }
  .wave { height: clamp(80px, 11vh, 104px); }
  .cue-v { font-size: clamp(1.8rem, 3vw, 2.6rem); }
}

/* Stack */
@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  h1 { font-size: clamp(3rem, 11vw, 6.4rem); }
  .lede { max-width: 30em; }
  .cue { grid-template-columns: 1fr; grid-template-areas: "k" "v" "d"; }
}
@media (max-width: 640px) {
  .masthead { padding-top: 14px; }
  .br-m { display: inline; }
  h1 { font-size: clamp(2.6rem, 14.5vw, 4.4rem); line-height: .92; }
  .player { border-radius: 20px; }
  .player-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .takes { display: grid; grid-template-columns: 1fr 1fr; border-radius: 16px; }
  .take { min-width: 0; }
  .take-face { width: 100%; justify-content: center; border-radius: 12px; padding: 10px 6px; }
  .stage { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; margin-top: 20px; }
  .play { --s: 48px; box-shadow: 0 0 0 5px rgba(var(--sig-rgb), .1); }
  .play:hover { box-shadow: 0 0 0 6px rgba(var(--sig-rgb), .14); }
  .wave { height: 80px; }
  .tag { font-size: 10px; letter-spacing: .06em; padding: 3px 8px; min-height: calc(2.6em + 8px); }
  .timeline { gap: 8px; margin-top: 12px; }
  .time { min-width: 0; font-size: 11px; }
  .cue-v { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .foot { gap: 4px 18px; }
  .foot-note { margin-left: 0; }
  .how-inner { padding: 22px 18px 24px; }
}

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