/* Carmen Sings - "Side A / Side B". Tokens come from DESIGN.md; no ad-hoc colours or stacks below. */

@font-face {
  font-family: "Tanker";
  src: url("/fonts/tanker-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: oklch(0.95 0.018 85);
  --tobacco: oklch(0.27 0.045 45);
  --tangerine: oklch(0.70 0.175 48);
  --vinyl: oklch(0.17 0.008 50);
  --muted: oklch(0.47 0.04 50);

  --font-display: "Tanker", "Impact", "Haettenschweiler", sans-serif;
  --font-text: "Newsreader", "Iowan Old Style", "Georgia", serif;

  --step--1: clamp(0.9rem, 0.87rem + 0.15vw, 1rem);
  --step-0: clamp(1.06rem, 1rem + 0.3vw, 1.25rem);
  --step-1: clamp(1.33rem, 1.2rem + 0.6vw, 1.66rem);
  --step-2: clamp(1.75rem, 1.5rem + 1.2vw, 2.4rem);
  --step-3: clamp(2.2rem, 1.8rem + 2vw, 3.4rem);
  --step-4: clamp(2.8rem, 2rem + 4vw, 5.5rem);
  --step-5: clamp(3.5rem, 2rem + 7vw, 8rem);

  --space-xs: 0.5rem; --space-s: 1rem; --space-m: 2rem; --space-l: 4rem; --space-xl: 8rem;
  --rule: 2px solid var(--tobacco);
  --radius: 0;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --gutter: max(clamp(1rem, 4vw, 3rem), env(safe-area-inset-left), env(safe-area-inset-right));
  --max: 1440px;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
/* iOS Safari 26 tints its bars from fixed/sticky elements at the screen edge, otherwise from the
   page background. The sticky paper .top sets the status bar; the root background is tobacco so
   the footer runs on under the floating toolbar. The body carries the paper. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4rem; background: var(--tobacco); }
body {
  position: relative;
  margin: 0;
  background: var(--paper);
  color: var(--tobacco);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.5;
  font-optical-sizing: auto;
  overflow-x: clip;
}
/* Uncoated paper: a faint grain over everything. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration: none; background: linear-gradient(var(--tangerine), var(--tangerine)) 0 88% / 100% 0.45em no-repeat; }
:focus-visible { outline: 3px solid var(--tobacco); outline-offset: 3px; }
::selection { background: var(--tobacco); color: var(--paper); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 200; background: var(--tobacco); color: var(--paper); padding: 0.5rem 1rem; }
.skip:focus { top: 0.5rem; }

.smallcaps, .top, .lang, .track__state, .track__note, .player__now, .field > span, .occasion__no, .record__brand, .record__rpm, .small {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}

/* ---------- top strip ---------- */

.top {
  display: flex;
  align-items: baseline;
  gap: var(--space-m);
  padding: var(--space-s) max(var(--gutter), (100% - var(--max)) / 2 + var(--gutter));
  /* Sticky, flat paper and above the grain: Safari takes its status-bar colour from it. */
  position: sticky;
  top: 0;
  z-index: 101;
  background: var(--paper);
  border-bottom: var(--rule);
  font-size: var(--step-0);
}
.top a { text-decoration: none; white-space: nowrap; }
.top__mark { margin-right: auto; }
.top__cat { font-weight: 600; margin-right: 0.6em; }
.lang a[aria-current] { text-decoration: underline; }
.top__book { font-weight: 600; }

/* ---------- the sleeve ---------- */

.sleeve {
  --S: min(40vw, 620px, 76svh);
  display: grid;
  grid-template-columns: calc(var(--S) * 1.8) 1fr;
  align-items: end;
  gap: var(--space-m);
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-l) var(--gutter);
  /* The record is a square box with a radius: while it rolls, its rotated bounding box pokes
     ~20% past each side and made the page scroll sideways. Only those empty corners get clipped. */
  overflow-x: clip;
}
.sleeve__stage { position: relative; width: calc(var(--S) * 1.8); height: var(--S); }

.cover {
  position: absolute;
  inset: 0 auto auto 0;
  width: var(--S);
  height: var(--S);
  background: var(--tangerine);
  overflow: hidden;
  z-index: 2;
  box-shadow: inset 0 0 0 1px oklch(0.27 0.045 45 / 0.25);
}
.cover__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__name {
  position: absolute;
  right: calc(var(--S) * 0.015);
  bottom: calc(var(--S) * 0.03);
  writing-mode: vertical-rl;
  rotate: 180deg;
  font-family: var(--font-display);
  font-size: calc(var(--S) * 0.331); /* CARMEN in Tanker is 2.839em long: fills 94% of the side */
  line-height: 0.74;
  text-transform: uppercase;
  color: var(--tobacco);
}
.cover__sings {
  position: absolute;
  right: calc(var(--S) * 0.27);
  top: calc(var(--S) * 0.035);
  font-style: italic;
  font-size: calc(var(--S) * 0.075);
  line-height: 1;
}
.cover__cat {
  position: absolute;
  left: calc(var(--S) * 0.035);
  bottom: calc(var(--S) * 0.03);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: calc(var(--S) * 0.032);
}

/* The record: .record slides out of the sleeve on load, .record__roll rolls it further
   as the page scrolls, .record__disc spins while a take plays. */
.record {
  --D: calc(var(--S) * 0.94);
  position: absolute;
  top: calc(var(--S) * 0.03);
  left: calc(var(--S) * 0.03);
  width: var(--D);
  height: var(--D);
  z-index: 1;
  translate: calc(var(--S) * 0.68) 0;
  container-type: inline-size;
}
.record__roll, .record__disc { width: 100%; height: 100%; border-radius: 50%; }
.record__disc {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, transparent 0 34%, oklch(0.24 0.008 50) 34.5% 35.5%, transparent 36%),
    repeating-radial-gradient(circle, var(--vinyl) 0 2px, oklch(0.215 0.008 50) 2px 3px),
    var(--vinyl);
  box-shadow: 0 calc(var(--S) * 0.02) calc(var(--S) * 0.05) oklch(0.17 0.008 50 / 0.35);
}
/* Fixed light on the vinyl: sits on the non-rotating parent, so the sheen stays put while the disc turns. */
.record::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 20deg, transparent 0 8%, oklch(1 0 0 / 0.1) 13%, transparent 20% 52%, oklch(1 0 0 / 0.07) 60%, transparent 68%);
  -webkit-mask: radial-gradient(circle, transparent 0 34%, #000 34.5%);
  mask: radial-gradient(circle, transparent 0 34%, #000 34.5%);
}
.record__label {
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--tangerine);
  color: var(--tobacco);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1cqi;
  text-align: center;
  line-height: 1;
}
.record__brand, .record__rpm { font-size: 2.2cqi; font-weight: 600; }
.record__side {
  font-family: var(--font-display);
  font-size: 3.6cqi;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.record__side:hover { background: var(--tobacco); color: var(--tangerine); }
.record__hole { width: 2.6cqi; aspect-ratio: 1; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 0.3cqi var(--vinyl); }

@media (prefers-reduced-motion: no-preference) {
  .record { animation: slide-out 1100ms var(--ease-out) 250ms both; }
  .record__disc { animation: settle 1100ms var(--ease-out) 250ms both; }
  @supports (animation-timeline: scroll()) {
    .record__roll {
      animation: roll linear both;
      animation-timeline: scroll(root);
      animation-range: 0 70svh;
    }
  }
  .record.is-playing .record__disc { animation: spin 1.8s linear infinite; } /* 33 1/3 rpm */
}
@keyframes slide-out { from { translate: 0 0; } }
@keyframes settle { from { rotate: -140deg; } }
@keyframes roll { to { translate: calc(var(--S) * 0.1) 0; rotate: 360deg; } }
@keyframes spin { to { rotate: 360deg; } }

.sleeve__standfirst {
  font-size: var(--step-1);
  font-style: italic;
  line-height: 1.35;
  max-width: 22ch;
  padding-bottom: calc(var(--S) * 0.03);
  border-top: var(--rule);
  padding-top: var(--space-s);
}

/* ---------- sides ---------- */

.side { max-width: var(--max); margin: 0 auto; padding: var(--space-xl) var(--gutter); }
.side__head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: var(--space-s) var(--space-l);
  border-bottom: var(--rule);
  padding-bottom: var(--space-s);
}
.side__head h2 { display: flex; align-items: baseline; gap: 0.25em; line-height: 0.8; }
.side__letter { font-family: var(--font-display); font-size: var(--step-5); text-transform: uppercase; }
.side__verb { font-style: italic; font-size: var(--step-3); }
.side__intro { max-width: 38ch; justify-self: end; color: var(--muted); }

.side__body {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: var(--space-l);
  align-items: start;
  padding-top: var(--space-m);
}

/* tracklist */
.tracklist { list-style: none; margin: 0; padding: 0; }
.track { border-bottom: 1px solid var(--tobacco); }
.track__play {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  cursor: pointer;
  display: grid;
  grid-template-columns: 3.5rem 1fr auto 4.5rem 5.5rem;
  align-items: baseline;
  gap: var(--space-s);
  padding: 0.6em 0.4em;
  font-variant-numeric: tabular-nums;
}
.track__play:hover, .track__play[aria-pressed="true"] { background: var(--tangerine); }
.track__play:focus-visible { outline: 3px solid var(--tobacco); outline-offset: -3px; }
.track__no { font-family: var(--font-display); font-size: var(--step-1); }
.track__title { font-family: var(--font-display); font-size: var(--step-3); text-transform: uppercase; line-height: 1; }
.track__note { color: var(--muted); }
.track__play[aria-pressed="true"] .track__note { color: inherit; }
.track__dur { text-align: right; }
.track__state { text-align: right; font-weight: 600; }

.player { margin: 0; background: var(--paper); }
.player__video { width: 100%; aspect-ratio: 9 / 16; max-height: min(62svh, 480px); object-fit: cover; background: var(--paper); border: var(--rule); }
.player__caption { display: flex; gap: 0.5em; padding-top: var(--space-xs); font-size: var(--step--1); }
.player__now { color: var(--muted); }
.side__a-main { display: grid; gap: var(--space-l); align-content: start; }
.side__note { font-style: italic; font-size: var(--step-2); line-height: 1.25; max-width: 30ch; }
.side__elsewhere { margin-top: calc(var(--space-m) * -1); }

/* ---------- liner notes ---------- */

.liner {
  background: var(--tangerine);
  padding: var(--space-xl) max(var(--gutter), (100% - var(--max)) / 2 + var(--gutter));
  display: grid;
  grid-template-columns: minmax(0, 34ch) minmax(0, 34ch) 1fr;
  column-gap: var(--space-l);
  row-gap: var(--space-m);
  align-items: start;
}
.liner__heading {
  grid-column: 1 / 3;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: var(--step-5);
  text-transform: uppercase;
  line-height: 0.85;
  border-bottom: var(--rule);
  padding-bottom: var(--space-s);
}
.liner__cols { display: contents; }
.liner__col:first-child { grid-column: 1; grid-row: 2 / span 2; }
.liner__quote { grid-column: 2; grid-row: 2; }
.liner__col:last-child { grid-column: 2; grid-row: 3; }
.liner__col p + p { margin-top: 1em; }
.liner__col:first-child p:first-child::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 4.6em;
  line-height: 0.8;
  margin: 0.04em 0.08em 0 0;
}
.liner__quote {
  margin: 0;
  font-style: italic;
  font-size: var(--step-2);
  line-height: 1.15;
  border-top: var(--rule);
  border-bottom: var(--rule);
  padding: var(--space-s) 0;
}
.liner__quote p::before { content: "\201C"; }
.liner__quote p::after { content: "\201D"; }
.liner__insert {
  grid-column: 3;
  grid-row: 1 / span 3;
  margin: 0;
  justify-self: center;
  width: min(100%, 420px);
  background: var(--paper);
  padding: 12px 12px 40px;
  rotate: 2deg;
}

/* ---------- side B ---------- */

.side__body--b { grid-template-columns: 1fr minmax(280px, 0.8fr); }
.occasions { list-style: none; margin: 0; padding: 0; }
.occasion {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  column-gap: var(--space-s);
  padding: var(--space-s) 0;
  border-bottom: 1px solid var(--tobacco);
}
.occasion__no { font-family: var(--font-display); font-variant-caps: normal; font-size: var(--step-1); letter-spacing: 0; }
.occasion__title { font-family: var(--font-display); font-size: var(--step-3); text-transform: uppercase; line-height: 1; }
.occasion__text { grid-column: 2; max-width: 46ch; margin-top: 0.4em; }
.side__photo { margin: 0; background: var(--tangerine); }
.side__photo img { width: 100%; }

.request { margin-top: var(--space-l); border-top: var(--rule); padding-top: var(--space-m); }
.request__heading { font-family: var(--font-display); font-size: var(--step-4); text-transform: uppercase; line-height: 0.9; margin-bottom: var(--space-m); }
.request__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-m) var(--space-l); }
.field { display: grid; gap: 0.2em; }
.field > span { color: var(--muted); font-weight: 600; }
.field--wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: var(--rule);
  border-radius: var(--radius);
  padding: 0.35em 0;
  min-height: 44px;
  width: 100%;
}
.field textarea { resize: vertical; }
.field select { appearance: none; background: linear-gradient(45deg, transparent 50%, var(--tobacco) 50%) right 0.4em center / 0.5em 0.5em no-repeat; }
.field :focus-visible { outline: none; border-bottom-color: var(--tangerine); box-shadow: 0 2px 0 var(--tangerine); }
.request__submit {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: var(--space-l);
  padding: 0.25em 0.3em 0.15em;
  border-top: var(--rule);
  border-bottom: var(--rule);
  font-family: var(--font-display);
  font-size: var(--step-4);
  text-transform: uppercase;
  line-height: 1;
}
.request__submit:hover { background: var(--tobacco); color: var(--paper); }
.request__submit:focus-visible { outline: 3px solid var(--tangerine); outline-offset: 2px; }
.request__alt, .request__sent { margin-top: var(--space-s); color: var(--muted); }
.request__sent { color: var(--tobacco); }

/* ---------- live ---------- */

.live { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) var(--space-xl); display: grid; grid-template-columns: auto 1fr; gap: var(--space-l); align-items: baseline; }
.live h2 { font-family: var(--font-display); font-size: var(--step-5); text-transform: uppercase; line-height: 0.85; }
.live__empty { font-style: italic; font-size: var(--step-1); border-top: var(--rule); padding-top: var(--space-s); }
.dates { list-style: none; margin: 0; padding: 0; border-top: var(--rule); }
.dates li { display: grid; grid-template-columns: 8rem 1fr auto; gap: var(--space-s); padding: 0.5em 0; border-bottom: 1px solid var(--tobacco); font-variant-numeric: tabular-nums; }

/* ---------- 404 ---------- */

.lost { min-height: 55svh; }
.lost .side__head h1 { display: flex; align-items: baseline; gap: 0.25em; line-height: 0.8; }
.lost__text { max-width: 38ch; margin-top: var(--space-m); font-size: var(--step-1); font-style: italic; }
.lost__links { margin-top: var(--space-m); }

/* ---------- small print ---------- */

.small {
  background: var(--tobacco);
  color: var(--paper);
  padding: var(--space-m) var(--gutter) calc(var(--space-m) + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-s) var(--space-l);
  font-size: var(--step-0);
}
.small a:hover { background: none; text-decoration: underline; }
.small :focus-visible { outline-color: var(--tangerine); }
.small__socials { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-m); }
.small__credit { margin-left: auto; font-size: 0.75rem; font-variant-caps: normal; letter-spacing: 0; }

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  .top { gap: var(--space-s); }
  .top__place { display: none; }
  .sleeve {
    --S: calc(100vw - 2 * var(--gutter));
    grid-template-columns: 1fr;
    padding-top: var(--space-m);
    padding-bottom: var(--space-l);
  }
  .sleeve__stage { width: 100%; height: calc(var(--S) * 1.68); }
  .record { translate: 0 calc(var(--S) * 0.68); }
  .sleeve__standfirst { max-width: none; }
  @keyframes slide-out { from { translate: 0 0; } }
  @keyframes roll { to { translate: 0 calc(var(--S) * 0.06); rotate: 360deg; } }

  .side { padding-block: var(--space-l); }
  .side__head { grid-template-columns: 1fr; }
  .side__intro { justify-self: start; }
  .side__body, .side__body--b { grid-template-columns: 1fr; }
  .player { width: min(100%, 320px); justify-self: center; }
  .track__play { grid-template-columns: 2.6rem 1fr auto; row-gap: 0.1em; }
  .track__note { grid-column: 2 / -1; grid-row: 2; }
  .track__state { display: none; }

  .liner { grid-template-columns: 1fr; padding-block: var(--space-l); }
  .liner__heading, .liner__col:first-child, .liner__col:last-child, .liner__quote, .liner__insert { grid-column: 1; grid-row: auto; }
  .liner__insert { width: min(86%, 380px); justify-self: center; }

  .request__grid { grid-template-columns: 1fr; }
  .live { grid-template-columns: 1fr; gap: var(--space-s); }
  .small { justify-content: center; text-align: center; }
  .small__copy { flex-basis: 100%; }
  .small__credit { margin-left: 0; }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .liner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .liner__insert { grid-column: 1 / -1; grid-row: 4; justify-self: end; width: min(60%, 420px); }
  .request__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
