/* Gatefold launch page. Palette, type and logo from docs/site/BRIEF.md. */

:root {
  color-scheme: light dark;
  /* Light: paper */
  --bg: #f4efe4;
  --bg-deep: #ebe4d6;
  --surface: #fbf8f1;
  --ink: #1f1a15;
  --muted: #665c50;
  --line: #dcd2c1;
  --line-strong: #b9ac98;
  --accent: #a63d22;
  --accent-strong: #8a3019;
  --on-accent: #fff9f0;
  --accent-soft: rgb(166 61 34 / 0.1);
  --focus: #1f56c4;
  --vinyl: #171310;
  --shadow-tint: 62 42 22;
  --sa1: 0.1;
  --sa2: 0.1;
  --sa3: 0.12;

  /* Sleeve colours, the same eight as the app's placeholder covers */
  --sleeve-1: #7a2e2a;
  --sleeve-1-ink: #f7ead9;
  --sleeve-2: #d8a23e;
  --sleeve-2-ink: #2a1d0c;
  --sleeve-3: #2e6b66;
  --sleeve-3-ink: #eef5ef;
  --sleeve-4: #e6d8bb;
  --sleeve-4-ink: #3a2a1a;
  --sleeve-5: #263659;
  --sleeve-5-ink: #e9ecf6;
  --sleeve-6: #93a98c;
  --sleeve-6-ink: #1c2619;
  --sleeve-7: #bf5c2c;
  --sleeve-7-ink: #fff3e6;
  --sleeve-8: #5a3a5d;
  --sleeve-8-ink: #f3e8f2;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --page-max: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-space: clamp(4.5rem, 10vw, 8rem);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --shadow:
    0 1px 2px rgb(var(--shadow-tint) / var(--sa1)), 0 8px 20px rgb(var(--shadow-tint) / var(--sa2)),
    0 24px 48px rgb(var(--shadow-tint) / var(--sa3));
  --shadow-small: 0 1px 2px rgb(var(--shadow-tint) / var(--sa1)), 0 8px 20px rgb(var(--shadow-tint) / var(--sa2));
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark: warm charcoal */
    --bg: #1b1916;
    --bg-deep: #24211d;
    --surface: #2a2622;
    --ink: #efe8dc;
    --muted: #ab9f8f;
    --line: #38332c;
    --line-strong: #5a5247;
    --accent: #ef8b5e;
    --accent-strong: #f6a580;
    --on-accent: #1b1210;
    --accent-soft: rgb(239 139 94 / 0.14);
    --focus: #8fb7ff;
    --vinyl: #0c0a08;
    --shadow-tint: 0 0 0;
    --sa1: 0.3;
    --sa2: 0.35;
    --sa3: 0.4;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
  overflow-x: clip;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.375rem;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
}

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

main:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
}

.skip:focus {
  top: 0.5rem;
}

.sentinel {
  position: absolute;
  top: 0;
  height: 1px;
  width: 1px;
}

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label,
.smallprint,
.tile__meta,
.footer__etch,
.frame__name,
.json__name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.label {
  margin-bottom: 1rem;
}

.body {
  max-width: 52ch;
  margin-bottom: 2.5rem;
}

.caption {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 62ch;
}

.section,
.band {
  padding-block: var(--section-space);
}

.band {
  background: var(--bg-deep);
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-small);
  transition: background-color 0.15s;
}

.btn--primary:hover {
  background: var(--accent-strong);
}

.btn--small {
  min-height: 44px;
  padding: 0 1.1rem;
  font-size: 0.9375rem;
}

.btn--large {
  min-height: 56px;
  padding: 0 2rem;
  font-size: 1.125rem;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 44px;
  font-weight: 600;
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.textlink:hover {
  color: var(--accent-strong);
}

/* ---------- 1. Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.header.is-scrolled,
.no-js .header {
  border-bottom-color: var(--line);
}

.header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.logo__mark {
  height: 28px;
  width: 28px;
  flex: none;
}

.logo__word {
  font: italic 600 1.375rem/1 var(--font-display);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header__link {
  display: none;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
}

.header__link:hover {
  color: var(--accent);
}

@media (min-width: 640px) {
  .header__link {
    display: inline-flex;
  }
  .header__nav .btn {
    margin-left: 0.5rem;
  }
}

/* ---------- Sleeve colours ---------- */

.cover-oxblood {
  background-color: var(--sleeve-1);
  color: var(--sleeve-1-ink);
}
.cover-mustard {
  background-color: var(--sleeve-2);
  color: var(--sleeve-2-ink);
}
.cover-teal {
  background-color: var(--sleeve-3);
  color: var(--sleeve-3-ink);
}
.cover-cream {
  background-color: var(--sleeve-4);
  color: var(--sleeve-4-ink);
}
.cover-navy {
  background-color: var(--sleeve-5);
  color: var(--sleeve-5-ink);
}
.cover-sage {
  background-color: var(--sleeve-6);
  color: var(--sleeve-6-ink);
}
.cover-rust {
  background-color: var(--sleeve-7);
  color: var(--sleeve-7-ink);
}
.cover-plum {
  background-color: var(--sleeve-8);
  color: var(--sleeve-8-ink);
}

/* ---------- 2. Hero ---------- */

.hero {
  padding-block: clamp(2rem, 4vw, 3.5rem) var(--section-space);
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

.hero__title {
  font-size: clamp(2.6rem, 1.4rem + 4.2vw, 4.75rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin-bottom: 1.5rem;
}

.hero__sub {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  }
}

/* The gatefold: a sleeve that opens. --s is the sleeve's side. */
.gf {
  margin: 0;
  container-type: inline-size;
  --s: min(24rem, 48cqi);
  --peek: 18%;
}

.gf__stage {
  position: relative;
  width: calc(var(--s) * 2);
  height: var(--s);
  margin-inline: auto;
  /* Closed: shifted left half a sleeve so the sleeve sits centred. Open: the spread is centred. */
  translate: calc(var(--s) * -0.5) 0;
  transform: perspective(1200px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
  transition:
    transform 0.3s ease-out,
    translate 0.9s var(--ease);
}

.gf__sleeve {
  position: absolute;
  left: var(--s);
  top: 0;
  width: var(--s);
  height: var(--s);
}

.gf__disc-wrap {
  position: absolute;
  inset: 0;
}

.gf__disc {
  position: absolute;
  left: 6%;
  top: 3%;
  width: 94%;
  height: 94%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, transparent 0 18%, rgb(255 255 255 / 0.05) 30%, transparent 46%),
    repeating-radial-gradient(
      circle,
      var(--vinyl) 0 3px,
      color-mix(in srgb, var(--vinyl), white 6%) 3px 4px
    );
  box-shadow: var(--shadow-small);
  translate: 19% 0;
}

.gf__disc-label {
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 0.75rem/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.gf__page,
.gf__face {
  position: absolute;
  inset: 0;
  padding: 7%;
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.gf__page--right {
  background: var(--surface);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.gf__head {
  font: 0.75rem/1.2 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.gf__tracks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gf__tracks li,
.gf__total {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.25rem;
  padding-block: 0.1rem;
}

.gf__total {
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  font-weight: 600;
}

.gf__num,
.gf__time {
  font: 0.75rem/1.6 var(--font-mono);
  color: var(--muted);
}

.gf__total .gf__time {
  color: var(--ink);
}

.gf__credits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.75rem;
  margin: 0.6rem 0 0;
}

.gf__credits dt {
  font: 0.75rem/1.2 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.gf__credits dd {
  margin: 0;
}

.gf__panel {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: perspective(1600px) rotateY(0deg);
  transition: transform 0.9s var(--ease);
}

.gf__face {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.gf__face--front,
.gf__thumb {
  overflow: hidden;
  isolation: isolate;
}

.gf__face--front::before,
.gf__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  background:
    repeating-radial-gradient(circle at 17% 32%, #000 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 73% 61%, #fff 0 1px, transparent 1px 4px);
}

.gf__face--front {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    var(--shadow);
}

.gf__artist {
  position: absolute;
  top: 8%;
  left: 8%;
  font: 0.75rem/1.2 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gf__cover-title {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 7%;
  font: italic 600 calc(var(--s) * 0.15) / 0.95 var(--font-display);
  letter-spacing: -0.02em;
}

.gf__face--back {
  background: var(--bg-deep);
  color: var(--ink);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gf__by {
  font: italic 600 1.125rem/1.25 var(--font-display);
  margin-bottom: 0.5rem;
}

.gf__note {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 24ch;
}

.gf__thumb {
  display: none;
}

/* Open state: the fallback class, and the end of the scroll animation. */
.gf.is-open .gf__panel {
  transform: perspective(1600px) rotateY(-165deg);
}

.gf.is-open .gf__stage {
  translate: 0 0;
}

.gf.is-open .gf__disc-wrap {
  translate: -18% 0;
  transition: translate 0.9s var(--ease);
}

@keyframes gf-open-y {
  to {
    transform: perspective(1600px) rotateY(-165deg);
  }
}

@keyframes gf-open-x {
  to {
    transform: perspective(1600px) rotateX(165deg);
  }
}

@keyframes gf-stage-in {
  to {
    translate: 0 0;
  }
}

@keyframes gf-disc-in {
  to {
    translate: -18% 0;
  }
}

@keyframes gf-disc-out {
  from {
    translate: 0 0;
  }
}

/* Phone: the sleeve opens upward, top page above bottom page. */
@media (max-width: 639.98px) {
  .gf {
    --s: 88vw;
  }
  .gf__stage {
    width: var(--s);
    height: calc(var(--s) * 2);
    margin-inline: 0;
  }
  .gf__stage,
  .gf.is-open .gf__stage {
    translate: none;
  }
  .gf__sleeve {
    left: 0;
    top: var(--s);
  }
  .gf__panel {
    transform-origin: center top;
    transform: perspective(1600px) rotateX(0deg);
  }
  .gf__face--back {
    transform: rotateX(180deg);
  }
  .gf.is-open .gf__panel {
    transform: perspective(1600px) rotateX(165deg);
  }
  .gf__page--right {
    font-size: 0.9375rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .gf__disc {
    animation: gf-disc-out 0.7s var(--ease) 0.2s both;
  }

  @supports (animation-timeline: view()) {
    .gf__stage,
    .gf__panel,
    .gf__disc-wrap {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-duration: auto;
      animation-timeline: scroll(root);
      animation-range: 0px 40vh;
    }
    .gf__panel {
      animation-name: gf-open-y;
    }
    .gf__disc-wrap {
      animation-name: gf-disc-in;
    }
    .gf__stage {
      animation-name: gf-stage-in;
    }

    @media (max-width: 639.98px) {
      .gf {
        view-timeline: --gf block;
      }
      .gf__stage {
        animation: none;
      }
      .gf__panel {
        animation-name: gf-open-x;
      }
      .gf__panel,
      .gf__disc-wrap {
        animation-timeline: --gf;
        animation-range: entry 75% contain 100%;
      }
    }
  }
}

/* Reduced motion: a static open spread, with the closed cover as a thumbnail. */
@media (prefers-reduced-motion: reduce) {
  .gf__stage,
  .gf__panel,
  .gf__disc-wrap {
    transition: none;
  }
  .gf__stage,
  .gf.is-open .gf__stage {
    transform: none;
    translate: none;
  }
  .gf .gf__panel {
    transform: rotateY(-180deg);
  }
  .gf .gf__disc-wrap {
    display: none;
  }
  .gf__thumb {
    display: block;
    position: absolute;
    z-index: 2;
    left: calc(var(--s) * 0.02);
    top: calc(var(--s) * 0.02);
    width: var(--s);
    height: var(--s);
    border-radius: 3px;
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.22),
      var(--shadow);
    transform: scale(0.3) rotate(-4deg);
    transform-origin: top left;
  }
  @media (max-width: 639.98px) {
    .gf .gf__panel {
      transform: rotateX(180deg);
    }
  }
}

/* ---------- 3. The wall ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding-block: 0.875rem;
  margin-bottom: 2rem;
  border-block: 1px solid var(--line-strong);
}

.controls[hidden] {
  display: none;
}

.controls__group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 500 0.9375rem/1 var(--font-body);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.wall {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1rem;
}

@media (min-width: 640px) {
  .wall {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 1.25rem;
  }
}

@media (min-width: 1024px) {
  .wall {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .wall .sleeve__i {
    font-size: min(88cqi, 7rem);
  }
}

.tile[hidden] {
  display: none;
}

.sleeve {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  /* Percent, not cqi: the sleeve is its own container, so cqi here would read the viewport. */
  padding: 9%;
  border-radius: 2px;
  display: flex;
  box-shadow: var(--shadow-small);
  transition:
    translate 0.2s ease-out,
    box-shadow 0.2s ease-out;
  margin-bottom: 0.75rem;
}

.sleeve::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
  pointer-events: none;
}

.motif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.25;
  z-index: -1;
}

.sleeve__t {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1;
}

/* (a) large italic, bottom left */
.lay-a {
  align-items: flex-end;
}
.lay-a .sleeve__t {
  font-style: italic;
  font-size: max(0.75rem, 15cqi);
  letter-spacing: -0.02em;
}

/* (b) small caps centred between two rules */
.lay-b {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.lay-b .sleeve__t {
  font-variant: small-caps;
  font-size: max(0.75rem, 10cqi);
  letter-spacing: 0.08em;
  padding-block: 5cqi;
  border-block: 1px solid currentColor;
}

/* (c) one huge initial, title small beneath */
.lay-c {
  flex-direction: column;
  justify-content: flex-end;
}
.sleeve__i {
  font: 600 88cqi/0.8 var(--font-display);
  margin-bottom: 3cqi;
}
.lay-c .sleeve__t {
  font-size: max(0.75rem, 8cqi);
}

/* (d) set vertically along the left edge */
.lay-d .sleeve__t {
  writing-mode: vertical-rl;
  rotate: 180deg;
  /* cqw, not cqi: in vertical writing cqi maps to the container's height, which isn't queried. */
  font-size: max(0.75rem, 13cqw);
  font-style: italic;
}

.tile__title {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  transition: color 0.2s;
}

.tile__meta {
  margin-top: 0.25rem;
}

.tile:hover .sleeve {
  translate: 0 -3px;
  box-shadow: var(--shadow);
}

.tile:hover .tile__title {
  color: var(--accent);
}

.wall__status {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  min-height: 1.6em;
}

/* ---------- 4. How it works ---------- */

.steps {
  position: relative;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0 0 0 1.5rem;
}

.steps::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform-origin: top;
}

@keyframes draw {
  from {
    transform: scaleY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .steps::before {
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 50%;
    }
  }
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num time"
    "title title"
    "desc desc";
  gap: 0.5rem 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.step:last-child {
  border-bottom: 1px solid var(--line);
}

.step__num,
.step__time {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  padding-top: 0.3rem;
}

.step__num {
  grid-area: num;
}

.step__time {
  grid-area: time;
}

.step__title {
  grid-area: title;
  font-size: 1.5rem;
}

.step__desc {
  grid-area: desc;
  max-width: 62ch;
}

@media (min-width: 760px) {
  .step {
    grid-template-columns: 3rem minmax(10rem, 15rem) minmax(0, 1fr) auto;
    grid-template-areas: "num title desc time";
    gap: 1.5rem;
    align-items: baseline;
  }
  .step__time {
    text-align: right;
  }
}

/* ---------- 5. The details ---------- */

.details {
  display: grid;
  gap: 3rem;
  margin-top: 2.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .details {
    grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
  }
}

.specs {
  margin: 0;
}

.spec {
  display: grid;
  gap: 0.35rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line-strong);
}

.spec:last-child {
  border-bottom: 1px solid var(--line-strong);
}

.spec dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 0.25rem;
}

.spec dd {
  margin: 0;
  max-width: 62ch;
}

@media (min-width: 760px) {
  .spec {
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1.5rem;
  }
}

.js .specs:not(.is-in) .spec {
  opacity: 0;
  translate: 0 8px;
}

.js .spec {
  transition:
    opacity 0.5s var(--ease),
    translate 0.5s var(--ease);
  transition-delay: calc(var(--i) * 40ms);
}

.json {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

@media (min-width: 1024px) {
  .json {
    position: sticky;
    top: 6rem;
  }
}

.json__name {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.json__code {
  margin: 0;
  overflow-x: auto;
  font: 0.8125rem/1.6 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

@media (max-width: 399.98px) {
  .json {
    padding: 1rem 0.75rem;
  }
  .json__code {
    font-size: 0.75rem;
  }
}

.json .k {
  color: var(--muted);
}
.json .s {
  color: var(--ink);
}
.json .n {
  color: var(--accent);
}

/* ---------- 6. See it working ---------- */

.frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.js .frame {
  opacity: 0;
  translate: 0 16px;
  transition:
    opacity 0.7s var(--ease),
    translate 0.7s var(--ease);
}

.js .frame.is-in {
  opacity: 1;
  translate: 0 0;
}

.frame__bar {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.frame__dots {
  position: absolute;
  left: 1rem;
  display: flex;
  gap: 6px;
}

.frame__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.frame__view {
  display: block;
  width: 100%;
  height: min(46rem, 80vh);
  border: 0;
  background: var(--bg);
}

.frame__phone {
  display: none;
  margin-bottom: 1.25rem;
}

.tries {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem 2rem;
}

.tries li {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .tries {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 639.98px) {
  .frame {
    margin-inline: calc(var(--gutter) * -1);
    border-radius: 0;
    border-inline: 0;
  }
  .frame__view {
    height: min(46rem, 88svh);
  }
  .frame__phone {
    display: block;
  }
}

/* ---------- 7. Run-out ---------- */

.runout {
  position: relative;
  overflow: hidden;
  padding-block: var(--section-space);
  text-align: center;
}

.drift {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  translate: 0 -50%;
  /* The sleeves fade out behind the headline instead of being covered by a panel. */
  -webkit-mask-image: linear-gradient(90deg, #000 0 18%, transparent 36% 64%, #000 82% 100%);
  mask-image: linear-gradient(90deg, #000 0 18%, transparent 36% 64%, #000 82% 100%);
}

.drift__row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  width: max-content;
  animation: drift 40s linear infinite;
}

.drift__row .sleeve {
  flex: none;
  width: 9rem;
  /* 9% of the sleeve: percent padding here would read the whole row's width. */
  padding: calc(9rem * 0.09);
  margin-bottom: 0;
  opacity: 0.35;
  text-align: left;
}

.drift__row .lay-b {
  text-align: center;
}

.drift.is-paused .drift__row {
  animation-play-state: paused;
}

@keyframes drift {
  to {
    transform: translateX(calc(-50% - 0.75rem));
  }
}

.runout__inner {
  position: relative;
  max-width: 44rem;
  padding-block: 2.5rem;
}

.runout__inner .label {
  margin-bottom: 1.25rem;
}

.runout__title {
  font-size: clamp(2.2rem, 1.3rem + 4vw, 4.25rem);
  letter-spacing: -0.02em;
  max-width: none;
  margin-bottom: 1.25rem;
}

.runout__body {
  max-width: 40ch;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
}

/* ---------- 8. Footer ---------- */

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-block: 1.5rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer {
  padding-top: 0;
}

.footer__mark {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
}

.footer__mark svg {
  width: 22px;
  height: 22px;
}

.footer__line {
  flex: 1 1 20rem;
}

.footer__etch {
  margin-left: auto;
}

/* ---------- Reduced motion everywhere ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .drift__row {
    animation: none;
  }
  .js .specs .spec,
  .js .frame {
    opacity: 1;
    translate: none;
    transition: none;
  }
  .sleeve,
  .tile__title {
    transition: none;
  }
}
