/* SPDX-License-Identifier: Apache-2.0 */
/*
 * The Boom Box website, drawn like the app: an 80s boom box (docs/DESIGN.md).
 * Dark = black & chrome, light = silver & black, following the system theme.
 * Text sits on recessed black panels in both; text printed on the case uses --body-ink.
 */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: italic; font-display: swap; src: url(fonts/barlow-condensed-latin-700-italic.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"); }
@font-face { font-family: "Permanent Marker"; font-weight: 400; font-display: swap; src: url(fonts/permanent-marker-latin-400-normal.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --room: #0b0b0c;
  --body: #1b1b1e;
  --body-hi: #2a2a2e;
  --body-lo: #111113;
  --panel: #101012;
  --panel-2: #18181b;
  --rule: #2c2c31;
  --ink: #ece9e2;
  --ink-2: #a9a59b;
  --body-ink: #d8d5cd;
  --vfd: #ffb547;
  --accent: #ff5a36;
  --chrome: linear-gradient(180deg, #fafafa 0%, #c9c9c9 22%, #8d8d8d 48%, #eaeaea 62%, #9d9d9d 82%, #6f6f6f 100%);
  --case-texture: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1.5px);
  --case-texture-size: 3px 3px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --legend: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --marker: "Permanent Marker", "Comic Sans MS", cursive;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --room: #cfd0cc;
    --body: #c9cac6;
    --body-hi: #e9eae6;
    --body-lo: #a7a8a4;
    --panel: #121214;
    --panel-2: #1b1b1e;
    --rule: #2e2e33;
    --body-ink: #1d1d1f;
    --vfd: #7fd8ff;
    /* Brushed silver: fine horizontal grain. */
    --case-texture: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0 1px, rgba(0, 0, 0, 0.03) 1px 3px);
    --case-texture-size: auto;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0%, var(--body-lo), var(--room) 70%) no-repeat, var(--room);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--vfd);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection {
  background: var(--vfd);
  color: #000;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

/* ---- the case ---- */

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
}

.handle {
  position: relative;
  width: 46%;
  min-width: 180px;
  max-width: 440px;
  height: 36px;
  margin: 0 auto;
}
.handle .grip {
  position: absolute;
  inset: 0 0 auto;
  height: 18px;
  border-radius: 999px;
  background: var(--chrome);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}
.handle .grip::after {
  content: "";
  position: absolute;
  inset: 4px 18%;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #151517 0 3px, #26262a 3px 5px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}
.handle .mount {
  position: absolute;
  top: 10px;
  width: 34px;
  height: 26px;
  border-radius: 6px 6px 0 0;
  background: var(--body);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.handle .l {
  left: 4%;
}
.handle .r {
  right: 4%;
}

.chassis {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 28px;
  background-color: var(--body);
  background-image:
    linear-gradient(180deg, var(--body-hi) 0%, transparent 6%, transparent 94%, rgba(0, 0, 0, 0.35) 100%),
    var(--case-texture);
  background-size: auto, var(--case-texture-size);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -4px 0 rgba(0, 0, 0, 0.35),
    0 2px 0 var(--body-lo),
    0 40px 80px -20px rgba(0, 0, 0, 0.7);
}
.chassis::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.chrome {
  background: var(--chrome);
  color: #141414;
}

/* Recessed black console panel. */
.well {
  position: relative;
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.08);
}

.legend {
  font-family: var(--legend);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-legend {
  margin-bottom: 14px;
  color: var(--ink-2);
  font-size: 14px;
}

.vfd {
  font-family: var(--mono);
  color: var(--vfd);
  text-shadow: 0 0 6px color-mix(in srgb, var(--vfd) 55%, transparent);
}
.vfd-glass {
  border-radius: 6px;
  background: linear-gradient(180deg, #050506, #0c0c0e);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.grille {
  background-color: #0b0b0d;
  background-image: radial-gradient(circle, #34343a 1.15px, transparent 1.7px);
  background-size: 7px 7px;
  background-position: center;
}

/* A round driver: chrome rim (5% of its width), ribbed cone, dust cap; or a dome tweeter. */
.driver {
  position: relative;
  display: block;
  flex-shrink: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--chrome);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
}
.driver::before {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: radial-gradient(circle, #2e2e34 0 11%, #060607 12% 14%, #1d1d22 15% 30%, #16161a 31% 33%, #1b1b20 34% 52%, #141417 53% 55%, #19191d 56% 74%, #060607 75% 78%, #26262b 79% 90%, #0e0e10 91%);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.95);
}
.driver::after {
  content: "";
  position: absolute;
  inset: 38%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #55555c, #1c1c20 70%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}
.driver.tweeter::before {
  background: #0b0b0d;
}
.driver.tweeter::after {
  inset: 22%;
  background: radial-gradient(circle at 40% 35%, #6b6b72, #26262b 45%, #121214 75%);
  box-shadow: 0 0 0 3px #050506;
}

/* ---- controls ---- */

.key {
  --key-face:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, rgba(0, 0, 0, 0.035) 1px 2px),
    linear-gradient(180deg, #f4f4f1 0%, #d6d6d2 38%, #bdbdb8 100%);
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  margin-bottom: 5px;
  padding: 0 14px;
  border: 1px solid #0b0b0b;
  border-radius: 4px 4px 3px 3px;
  background: var(--key-face);
  color: #121214;
  font-family: var(--legend);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12),
    0 4px 0 #77776f,
    0 5px 0 #0b0b0b,
    0 7px 9px rgba(0, 0, 0, 0.55);
  transition: transform 60ms ease, box-shadow 60ms ease, filter 120ms ease;
}
.key:hover {
  filter: brightness(1.06);
}
.key:active,
.key[aria-selected="true"] {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 3px 5px rgba(0, 0, 0, 0.22),
    0 1px 0 #77776f,
    0 2px 0 #0b0b0b,
    0 2px 3px rgba(0, 0, 0, 0.5);
}
.key-main {
  background:
    linear-gradient(180deg, var(--accent) 0 5px, rgba(0, 0, 0, 0.35) 5px 6px, transparent 6px),
    var(--key-face);
}

.keybank {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px 4px 4px;
  border-radius: 6px;
  background: #050506;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.08);
}
.keybank > .key {
  min-width: 96px;
  border-radius: 2px 2px 3px 3px;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

/* ---- radio band ---- */

.band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 4px 6px 0;
}
.badge {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plate-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plate {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  font-family: var(--legend);
  font-weight: 700;
  font-style: italic;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}
.sticker {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--accent);
  color: #000;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.sticker b {
  font-family: var(--legend);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sticker span {
  font-family: var(--mono);
  font-size: 10px;
}
.model {
  color: var(--body-ink);
  font-size: 11px;
  opacity: 0.85;
}
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- the front: speakers and console ---- */

.grille-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 112px;
  padding: 12px;
}
.grille-strip .driver {
  height: 100%;
}

.front {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.cabinet {
  display: none;
}

@media (min-width: 1000px) {
  .grille-strip {
    display: none;
  }
  .front {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3.4fr) minmax(0, 1fr);
  }
  .cabinet {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: 24px;
    padding: 28px 12%;
  }
  .cabinet .driver {
    width: 100%;
  }
  .cabinet .driver.tweeter {
    width: 42%;
  }
}

.console {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* The dial window: an FM scale, a red pointer, and the tagline in the display. */
.dial {
  position: relative;
  overflow: hidden;
  padding: 8px 14px 12px;
}
.dial-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--vfd);
  opacity: 0.6;
}
.dial-ticks {
  height: 6px;
  margin: 3px 0 8px;
  background: repeating-linear-gradient(90deg, var(--vfd) 0 1px, transparent 1px 5%);
  opacity: 0.4;
}
.dial-text {
  font-size: clamp(13px, 2.4vw, 17px);
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}
.dial-pointer {
  position: absolute;
  top: 0;
  /* Across the scale only, not through the text. */
  height: 34px;
  left: 63%;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.hero {
  padding: clamp(20px, 4vw, 36px);
}
.hero h1 {
  font-family: var(--legend);
  font-weight: 700;
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.lede {
  max-width: 62ch;
  margin-top: 14px;
  font-size: clamp(16px, 1.9vw, 18px);
}
.facts {
  margin-top: 18px;
  color: var(--vfd);
  line-height: 1.5;
}

/* ---- install ---- */

.install {
  padding: clamp(16px, 3vw, 28px);
}
.tabs {
  display: flex;
  flex-wrap: nowrap;
  max-width: 420px;
  margin-bottom: 16px;
}
.tabs > .key {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
}
html:not(.js) .tabs {
  display: none;
}
.os {
  display: grid;
  gap: 12px;
}
.os + .os {
  margin-top: 20px;
}
.js .os + .os {
  margin-top: 0;
}
.os[hidden] {
  display: none;
}
.js .os-name {
  display: none;
}
.os-name {
  color: var(--ink);
  font-size: 16px;
}
.cmd {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}
.cmd code {
  flex: 1 1 320px;
  min-width: 0;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  user-select: all;
}
.cmd .key {
  min-width: 96px;
}
.soon {
  padding: 12px 14px;
  font-size: 14px;
}
.small {
  color: var(--ink-2);
  font-size: 14px;
}
.small code,
.prose code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9em;
  white-space: nowrap;
}
.checked {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.phone-note {
  margin-top: 10px;
  color: var(--vfd);
}
.status:empty {
  display: none;
}
.status {
  margin-top: 10px;
  color: var(--vfd);
  font-family: var(--mono);
  font-size: 13px;
}

/* ---- below the front ---- */

.shots,
.features,
.downloads,
.prose {
  padding: clamp(16px, 3vw, 28px);
}
.shots-row {
  display: grid;
  grid-template-columns: minmax(0, 3.1fr) minmax(0, 1fr);
  gap: clamp(10px, 2vw, 20px);
  align-items: start;
}
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px #000,
    0 0 0 3px #5d5d62,
    0 8px 20px rgba(0, 0, 0, 0.6);
}
.shots .phone img {
  border-radius: 12px;
}
/* On a phone, the screenshots stack so the desktop one is big enough to read. */
@media (max-width: 640px) {
  .shots-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .shots .phone {
    width: min(60%, 220px);
    margin: 0 auto;
  }
}

/* Feature cards as cassettes: a tape shell with two colour stripes and a hand-written label. */
.tapes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}
.tape {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1d1d21, #141417);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.7),
    0 2px 6px rgba(0, 0, 0, 0.45);
}
.tape::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 5px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent) 0 50%, var(--vfd) 50%);
}
.tape:nth-child(3n + 2)::before {
  background: linear-gradient(90deg, #5ce27a 0 50%, var(--accent) 50%);
}
.tape:nth-child(3n)::before {
  background: linear-gradient(90deg, var(--vfd) 0 50%, #7fa8ff 50%);
}
.tape .side {
  color: var(--ink-2);
  font-size: 11px;
}
.tape h3 {
  margin: 8px 0 6px;
  font-family: var(--marker);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.2;
}
.tape p {
  color: var(--ink-2);
  font-size: 15px;
}

.table {
  display: grid;
  margin: 14px 0;
}
.row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.row:last-child {
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 760px) {
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
  }
}
.what {
  display: grid;
  gap: 2px;
}
.what span {
  color: var(--ink-2);
  font-size: 14px;
}
.files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.files .key {
  font-size: 14px;
}

.duo {
  display: grid;
  gap: 16px;
}
@media (min-width: 860px) {
  .duo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.prose p + p {
  margin-top: 12px;
}
.prose ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

/* ---- the maker's plate, printed on the case ---- */

.foot {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 4px 8px 6px;
  color: var(--body-ink);
  text-align: center;
}
.maker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 6px;
}
.maker .legend {
  font-size: 13px;
}
.maker-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: inherit;
  text-decoration: underline;
}
.fine {
  max-width: 70ch;
  font-size: 13px;
}
.fine a {
  color: inherit;
}

@media (max-width: 640px) {
  .chassis {
    padding: 12px;
    border-radius: 18px;
    gap: 12px;
  }
  .chassis::before {
    inset: 4px;
    border-radius: 14px;
  }
  .grille-strip {
    height: 84px;
  }
  .plate {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .key {
    transition: none;
  }
}
