/* Signal Drift FM site, in the app's Grid direction (design/site-a.html is the prototype):
   square-ish tiles on one 6-column grid (12 on desktop), hairline gaps, poster colours.
   The home page is one fixed-height screen on desktop; the text pages scroll. */

@font-face { font-family: "PP Mori"; font-weight: 200; font-display: swap; src: url(/fonts/PPMori-Extralight.otf) format("opentype"); }
@font-face { font-family: "PP Mori"; font-weight: 400 500; font-display: swap; src: url(/fonts/PPMori-Regular.otf) format("opentype"); }
@font-face { font-family: "PP Mori"; font-weight: 600 700; font-display: swap; src: url(/fonts/PPMori-SemiBold.otf) format("opentype"); }
@font-face { font-family: "PP Mori"; font-weight: 800; font-display: swap; src: url(/fonts/PPMori-ExtraBold.otf) format("opentype"); }
@font-face { font-family: "Doto"; font-weight: 900; font-display: swap; src: url(/fonts/doto-latin-900-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #0d0d0d; --paper: #fff; --yellow: #f6a800; --red: #e0161c; --blue: #1f6fd1; --green: #1a9e55; --grey: #5b5b5b;
  --rule: #cfcfcf; --muted: #666;
  --gap: 6px; --pad: 12px; --cols: 6;
  --unit: calc((100vw - 2 * var(--pad) - (var(--cols) - 1) * var(--gap)) / var(--cols));
  --sans: "PP Mori", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--paper); padding: .5rem .75rem; z-index: 10; }

/* ---------- grid and tiles ---------- */
.grid {
  width: 100%; padding: 0 var(--pad) var(--pad);
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-rows: var(--unit); gap: var(--gap);
}
.tile { position: relative; overflow: hidden; padding: 12px 14px; display: flex; flex-direction: column; text-decoration: none; }
.black { background: var(--ink); color: var(--paper); }
.yellow { background: var(--yellow); }
.red { background: var(--red); color: var(--paper); }
.green { background: var(--green); color: var(--paper); }
.grey { background: var(--grey); color: var(--paper); }
.line { box-shadow: inset 0 0 0 1.5px var(--rule); }
a.tile, button.tile { transition: transform .12s; }
a.tile:active, button.tile:active { transform: scale(.98); }
.label { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }
.mono { font-family: var(--mono); }
.big { font-size: clamp(24px, min(3.4vw, 6vh), 68px); font-weight: 600; letter-spacing: -.03em; line-height: 1.02; }
.mid { font-size: clamp(16px, min(1.5vw, 2.8vh), 28px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.body { font-size: clamp(14px, min(1.05vw, 2vh), 19px); line-height: 1.42; }
.end { margin-top: auto; }
.arrow::after { content: " →"; }
.muted { color: var(--muted); } .dim { opacity: .8; } .faint { opacity: .6; }
.narrow { max-width: 62%; } .w70 { max-width: 70%; } .w80 { max-width: 80%; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; }
.disc { position: absolute; border-radius: 50%; background: var(--ink); aspect-ratio: 1; z-index: 0; }
.tile > :not(.disc) { position: relative; z-index: 1; }
.soon { opacity: .6; font-size: 11px; font-family: var(--mono); font-weight: 400; }
.cta .soon, .inline .soon { margin-left: 8px; }
.inline { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
[aria-disabled="true"] { cursor: default; }

/* ---------- header: the app's wordmark, then three keys; the open one is black ---------- */
header.grid { grid-auto-rows: auto; padding-top: calc(var(--pad) + env(safe-area-inset-top)); padding-bottom: var(--gap); align-items: center; row-gap: 10px; }
.brand { grid-column: 1 / -1; text-decoration: none; }
/* Wordmark with its TM, as the app draws it (GridTuner.tsx, Wordmark): "signal drift" Mori SemiBold
   + " fm" Mori ExtraLight, tracking -0.05 em, line height 1.3 em; "TM" in Mori ExtraBold at 0.27 of
   the size, tracking -0.064 em, its cap tops just under the ascenders of d, l and f, a small gap
   after the m. In the TM's own em (0.27 of the wordmark): top offset 0.7 em, gap 0.333 em. */
.wm { display: inline-flex; align-items: flex-start; font-size: 20px; line-height: 1.3; letter-spacing: -0.05em; white-space: nowrap; padding-left: 10px; }
.wm b { font-weight: 600; } .wm i { font-style: normal; font-weight: 200; }
.wm .tm { font-size: .27em; font-weight: 800; line-height: 1.3; letter-spacing: -0.064em; margin-top: .7em; margin-left: .333em; vertical-align: baseline; }
.tabs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.tabs a { text-decoration: none; height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; box-shadow: inset 0 0 0 1.5px var(--rule); font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); box-shadow: none; }
[data-panel][hidden] { display: none; }

/* ---------- the radio: same parts and rules as the app, laid out wide on desktop ---------- */
.r-screen { grid-column: span 6; grid-row: span 5; background: #1c1917; }
.r-knob { grid-column: span 4; grid-row: span 4; display: grid; place-items: center; touch-action: none; cursor: grab; container-type: size; padding: 0; }
.dial { width: 82cqmin; aspect-ratio: 1; border-radius: 50%; background: var(--paper); position: relative; }
.dial .pointer { position: absolute; left: 48%; top: 0; width: 4%; height: 21%; background: var(--ink); border-radius: 0 0 1px 1px; }
.r-seek { grid-column: span 2; grid-row: span 2; padding: 0; container-type: size; }
.tile.r-seek > button { position: absolute; width: 46.7cqmin; aspect-ratio: 1; border-radius: 50%; background: var(--paper); display: grid; place-items: center; }
.r-seek button svg { width: 46%; height: 46%; display: block; }
.r-seek button:active { background: var(--yellow); }
#back { left: 7.5cqmin; top: 7.5cqmin; } #fwd { right: 7.5cqmin; bottom: 7.5cqmin; }
.r-pick { grid-column: span 2; grid-row: span 2; }
.r-pick .disc { width: 72%; right: -14%; bottom: -14%; }
.r-pick .what { font-size: clamp(14px, min(1.3vw, 2.4vh), 22px); font-weight: 600; line-height: 1.1; margin-top: 4px; max-width: 80%; }
.r-site { grid-column: span 4; grid-row: span 1; justify-content: center; }
.r-site .site-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-site[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.r-site, .r-sound { order: 1; } .pitch, .store { order: 2; } /* phones: keys first, then site + sound */
.r-sound { grid-column: span 2; grid-row: span 1; display: grid; place-items: center; padding: 0; }
.r-sound svg { width: min(35px, 60%); height: auto; aspect-ratio: 1; display: block; transition: opacity .2s; }
.r-sound[aria-pressed="false"] svg { opacity: .25; }
.key { padding: 5px 7px; display: flex; flex-direction: column; justify-content: space-between; user-select: none; -webkit-user-select: none; }
.preset { background: var(--ink); color: var(--paper); transition: background .25s, color .25s, transform .12s; }
.preset .num { font-size: clamp(18px, min(1.6vw, 3vh), 30px); font-weight: 600; line-height: 1; }
.preset .f { font-size: clamp(9px, .75vw, 12px); opacity: .75; font-variant-numeric: tabular-nums; }
.preset.empty { background: var(--paper); color: #9a9a9a; box-shadow: inset 0 0 0 1.5px var(--rule); }
.preset.active::after { content: ""; position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.preset.saving { transform: scale(.92); }
.drift { display: grid; place-items: center; background: var(--ink); color: var(--paper); padding: 0; }
.drift svg { width: min(62%, 56px); height: auto; display: block; overflow: visible; }
.drift[aria-pressed="true"] { background: var(--red); }

/* The black display: Doto numerals, mono labels, band-tinted on lock, frequency scale inside. */
.lcd { --fg: #f7f7f7; --lmuted: rgba(247,247,247,.5); --ldim: rgba(247,247,247,.16); --hot: oklch(0.66 0.22 38);
  color: var(--fg); padding: clamp(12px, 1.4vw, 24px); display: flex; flex-direction: column; font-family: var(--mono); transition: background .4s; }
.tile.lcd > .lcd-top { position: absolute; top: clamp(12px, 1.4vw, 24px); right: clamp(12px, 1.4vw, 24px); }
.lcd-bars { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.lcd-bars i { width: 4px; border-radius: 1px; background: var(--ldim); }
.lcd-bars i:nth-child(1) { height: 5px; } .lcd-bars i:nth-child(2) { height: 8px; } .lcd-bars i:nth-child(3) { height: 11px; }
.lcd-bars i:nth-child(4) { height: 14px; } .lcd-bars i:nth-child(5) { height: 18px; }
.lcd-bars i.on { background: var(--hot); }
.lcd-freq { font-family: Doto, monospace; font-weight: 900; font-size: clamp(64px, min(7.4vw, 13vh), 150px); line-height: .9; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.lcd-freq small { font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: .14em; color: var(--lmuted); margin-left: 6px; }
.lcd-band { font-size: clamp(10px, .75vw, 13px); letter-spacing: .16em; text-transform: uppercase; color: var(--lmuted); margin-top: 14px; }
.lcd-name { font-family: Doto, monospace; font-weight: 900; font-size: clamp(28px, min(3vw, 5.4vh), 60px); line-height: 1; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.lcd-tag { font-family: var(--sans); font-size: clamp(13px, min(1.1vw, 2vh), 19px); margin-top: 6px; min-height: 1.3em; }
.lcd-note { font-size: clamp(10.5px, .85vw, 14px); font-style: italic; color: var(--hot); margin-top: 4px; min-height: 1.3em; }
.lcd-scale { margin-top: auto; padding: 14px 22px 2px; }
.lcd-scale .track { position: relative; height: 10px; }
.lcd-scale .d { position: absolute; top: 0; width: 7px; height: 7px; border-radius: 50%; background: #4a4a4a; transform: translateX(-50%); }
.lcd-scale .d.on { background: #fff; }
.lcd-scale .needle { position: absolute; top: -9px; height: 28px; width: 3px; background: var(--red); transform: translateX(-50%); }
.lcd-scale .nums { display: flex; justify-content: space-between; margin: 12px -20px 0; font-family: var(--sans); font-size: 11px; color: #8a8a8a; font-variant-numeric: tabular-nums; }
/* End caps past each end of the band: lit at the end, red under pressure, then the needle hops round. */
.cap { position: absolute; top: -1px; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .08s, border-color .15s; }
.cap.r { right: -16px; border-left: 7px solid #4a4a4a; } .cap.l { left: -16px; border-right: 7px solid #4a4a4a; }
.cap.r.lit { border-left-color: #fff; } .cap.l.lit { border-right-color: #fff; }
.cap.r.push { border-left-color: var(--red); } .cap.l.push { border-right-color: var(--red); }
.hopflash { animation: hopflash .45s ease-out; }
@keyframes hopflash { from { opacity: .25; } to { opacity: 1; } }

/* ---------- pitch and store keys ---------- */
.pitch { grid-column: span 6; grid-row: span 5; }
.pitch h1 { font-size: clamp(22px, min(2.5vw, 4.4vh), 52px); font-weight: 600; letter-spacing: -.03em; line-height: 1.02; margin-top: 8px; }
.pitch .copy { margin-top: 12px; display: flex; flex-direction: column; }
.pitch .tune { font-weight: 600; margin-top: auto; padding-top: 10px; }
.store { grid-column: span 3; grid-row: span 2; }
.store svg { width: 26px; height: 26px; margin-bottom: auto; }

/* ---------- for listeners ---------- */
.intro { grid-column: span 6; grid-row: span 3; }
.stripe { grid-column: span 6; grid-row: span 4; }
.stripe .disc { width: 34%; right: -8%; bottom: -30%; background: var(--red); }
.faq { grid-column: span 6; grid-row: span 2; }
.faq .q { font-weight: 600; font-size: clamp(15px, min(1.2vw, 2.2vh), 21px); letter-spacing: -.01em; margin-bottom: 6px; }

/* ---------- for stations ---------- */
.feat { grid-column: span 6; grid-row: span 6; }
.feat .disc { width: 60%; right: -16%; bottom: -26%; }
.feat .cta { align-self: flex-start; background: var(--paper); color: var(--ink); padding: 12px 18px; font-weight: 600; font-size: 15px; text-decoration: none; margin-top: 14px; border-radius: 999px; }
.need { grid-column: span 6; grid-row: span 6; }
.need ol { padding-left: 18px; margin-top: 8px; display: grid; gap: .3em; }
.need li { font-size: clamp(13.5px, min(1vw, 1.9vh), 18px); line-height: 1.35; }
.promise { grid-column: span 3; grid-row: span 3; }
.promise .tick { font-family: Doto, monospace; font-weight: 900; font-size: 22px; line-height: 1; margin-bottom: auto; }
.optout { grid-column: span 3; grid-row: span 3; }

/* ---------- footer ---------- */
footer { padding: 20px var(--pad) 28px; color: #8a8a8a; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer p { margin-left: auto; }

/* ---------- text pages (privacy, terms, support, for stations) ---------- */
.prose { max-width: 46rem; margin: 24px auto 40px; padding: 0 var(--pad); font-size: 17px; line-height: 1.6; }
.prose h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; margin-bottom: 20px; }
.prose h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 32px 0 8px; }
.prose h3 { font-size: 18px; font-weight: 600; margin: 22px 0 4px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table { margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { border-left: 3px solid var(--yellow); padding-left: 14px; color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .9em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 6px 8px; text-align: left; vertical-align: top; }
.prose a { text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: .2em; }
mark.placeholder, .placeholder { background: #fff3c4; padding: 0 .2em; }
.notfound { min-height: 50vh; display: grid; place-content: center; text-align: center; gap: 10px; padding: 40px var(--pad); }

/* ---------- desktop: the home page is one fixed-height screen, 12 columns x 6 rows sharing the
   window's height (down to 640px; below that it scrolls a little) ---------- */
@media (min-width: 900px) {
  :root { --cols: 12; --gap: 8px; --pad: 24px; }
  .brand { grid-column: 1 / span 6; }
  .tabs { grid-column: 7 / span 6; }
  .tile { padding: clamp(12px, 1.2vw, 22px); }
  body.home { height: 100dvh; min-height: 640px; display: flex; flex-direction: column; }
  body.home main { flex: 1; min-height: 0; display: flex; }
  body.home main > [data-panel] { flex: 1; grid-template-rows: repeat(6, 1fr); grid-auto-rows: 0; padding-bottom: 0; }
  body.home footer { padding-top: 10px; padding-bottom: 14px; }

  /* radio across the top four rows, pitch and store keys under it */
  .r-screen { grid-column: 1 / span 5; grid-row: 1 / span 4; }
  .r-knob { grid-column: 6 / span 3; grid-row: 1 / span 3; }
  .r-seek { grid-column: 9 / span 2; grid-row: 1 / span 2; }
  .r-pick { grid-column: 11 / span 2; grid-row: 1 / span 2; }
  .r-site { grid-column: 9 / span 4; grid-row: 3; }
  .drift { grid-column: 6; grid-row: 4; }
  .preset { grid-row: 4; }
  .r-sound { grid-column: 12; grid-row: 4; }
  .pitch { grid-column: 1 / span 8; grid-row: 5 / span 2; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(16px, 2.5vw, 48px); }
  .pitch .label { grid-column: 1 / -1; }
  .pitch h1, .pitch .copy { margin-top: 6px; }
  .store.s1 { grid-column: 9 / span 4; grid-row: 5; }
  .store.s2 { grid-column: 9 / span 4; grid-row: 6; }
  #listen .store { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-content: center; }
  #listen .store svg { grid-row: 1 / span 3; align-self: center; margin: 0; width: 30px; height: 30px; }

  .intro { grid-column: 1 / span 6; grid-row: 1 / span 2; }
  .l1 { grid-column: 7 / span 3; grid-row: 1 / span 2; }
  .l2 { grid-column: 10 / span 3; grid-row: 1 / span 2; }
  .stripe { grid-column: 1 / span 6; grid-row: 3 / span 4; }
  .faq { grid-column: span 3; grid-row: span 2; }

  .feat { grid-column: 1 / span 7; grid-row: 1 / span 4; }
  .need { grid-column: 8 / span 5; grid-row: 1 / span 4; }
  .promise, .optout { grid-column: span 3; grid-row: 5 / span 2; }
}
