/* महफ़िल — an Amitabh Bachchan mixtape
   Palette lifted off the artwork: bitumen ink, painted-signboard cream,
   Bombay-local red, Padmini-taxi yellow, monsoon sky, palm green. */

:root {
  --ink:    #17110C;
  --ink-2:  #241a12;
  --cream:  #F4E6C8;
  --brick:  #B04A32;
  --taxi:   #E9A81C;
  --dusk:   #7A8CA3;
  --paan:   #3C5544;

  --tape:   #2B1D14;   /* magnetic tape brown */
  --paper:  #EFE2C6;   /* inlay card stock */

  --display: 'Rozha One', Georgia, serif;
  --body:    'Mukta', system-ui, sans-serif;
  /* Courier Prime carries no Devanagari, so Mukta picks up those glyphs
     wherever a label mixes scripts. */
  --type:    'Courier Prime', 'Mukta', ui-monospace, monospace;

  --gap: clamp(14px, 2.2vw, 26px);

  --shadow: 0 24px 60px -18px rgba(0,0,0,.75), 0 2px 0 rgba(255,255,255,.06) inset;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  font-family: var(--body);
  color: var(--cream);
  background: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

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

/* ── the artwork ─────────────────────────────────────────────────────────── */

.stage { position: fixed; inset: 0; z-index: -1; background: var(--ink); }

/* The artwork carries the whole page, so it runs at full brightness — no
   dimming filter, no colour wash over it. */
.art {
  position: absolute; inset: 0;
  background-image: url("assets/mehfil.jpg");
  background-size: cover;
  background-position: 58% center;
  filter: saturate(1.04);
  transform: scale(1.02);
}

/* Only what the type actually needs: a whisper at the top for the clock, and a
   soft floor at the very bottom so the deck has ground to stand on. */
.veil {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(23,17,12,.20) 0%,
    rgba(23,17,12,.04) 13%,
    transparent 34%,
    transparent 62%,
    rgba(23,17,12,.30) 84%,
    rgba(23,17,12,.55) 100%);
}

/* ── corners ─────────────────────────────────────────────────────────────── */

.corner { position: fixed; top: calc(var(--gap) + env(safe-area-inset-top, 0px)); z-index: 5; }
.corner-tl { left: var(--gap); }
.corner-tc { left: 50%; transform: translateX(-50%); }

.clock {
  margin: 0;
  font-family: var(--type);
  font-size: 19px;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(12,8,5,.85), 0 2px 12px rgba(12,8,5,.7);
}
.clock .tick { animation: blink 1.1s step-end infinite; }
.clock .ampm { margin-left: .45em; opacity: .7; font-size: 15px; }
@keyframes blink { 50% { opacity: 0; } }

.wordmark {
  margin: 3px 0 0;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: .01em;
  text-shadow: 0 1px 3px rgba(12,8,5,.8), 0 3px 18px rgba(12,8,5,.8);
}
.wordmark span {
  display: block;
  font-family: var(--type);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .7;
  margin-top: 6px;
  text-shadow: 0 1px 3px rgba(12,8,5,.9);
}

/* A fixed label, not a control — the dot beside it carries the only live
   information this slot needs. */
.mehfil {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 4px 2px;
  color: var(--cream);
  font-family: var(--type); font-size: 15px; letter-spacing: .05em;
  text-shadow: 0 1px 3px rgba(12,8,5,.85), 0 2px 12px rgba(12,8,5,.7);
  opacity: .92;
}
.mehfil-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--taxi);
  box-shadow: 0 0 0 0 rgba(233,168,28,.6);
}
[data-state="playing"] .mehfil-dot { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(233,168,28,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(233,168,28,0); }
  100% { box-shadow: 0 0 0 0 rgba(233,168,28,0); }
}

/* ── the deck ────────────────────────────────────────────────────────────── */

/* The deck lands in the gap between the painted title on the left and the line
   drawn on Amitabh's forearm on the right — रेखा means line, so that mark is
   the point of the picture and must never be covered. 27vw of leading margin
   against a centred flex line offsets the deck 13.5vw right of centre, which
   tracks that gap from 1024px up. */
.deck-wrap {
  grid-row: 2;
  z-index: 4;
  display: flex;
  justify-content: center;
  padding-inline: var(--gap);
  padding-bottom: calc(clamp(12px, 2vh, 20px) + env(safe-area-inset-bottom, 0px));
}
/* Leading margin against a centred flex line offsets the deck to the right by
   half that margin — see the aspect-ratio rules at the foot of this file, which
   solve for the offset that lands the deck's right edge just short of the रेखा
   line at any window shape. A flat vw value cannot do it: where that line falls
   on screen depends on which axis `cover` fills. */
.unit { width: min(452px, 100%); margin-left: 0; }

/* file-folder tabs: one per side of the tape */
.tabs { display: flex; align-items: flex-end; gap: 3px; padding-left: 14px; }

.tab {
  appearance: none; cursor: pointer;
  border: 1px solid rgba(244,230,200,.14);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: rgba(23,17,12,.5);
  backdrop-filter: blur(14px);
  color: var(--cream);
  padding: 6px 12px 7px;
  display: flex; align-items: baseline; gap: 7px;
  transition: background .2s, transform .2s, opacity .2s;
  opacity: .62;
  transform: translateY(3px);
}
.tab b { font-family: var(--type); font-size: 12.5px; letter-spacing: .12em; }
.tab span { font-family: var(--body); font-size: 15.5px; }
.tab:hover { opacity: .85; }
.tab[aria-selected="true"] {
  opacity: 1;
  transform: translateY(1px);
  background: rgba(23,17,12,.82);
  border-color: rgba(244,230,200,.24);
  box-shadow: 0 -6px 20px -8px rgba(0,0,0,.6);
}
.tab[aria-selected="true"] b { color: var(--taxi); }

/* the deck: the dark well the tape drops into */
.deck {
  background: linear-gradient(180deg, rgba(13,9,6,.90), rgba(8,5,3,.94));
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(244,230,200,.16);
  border-radius: 4px 12px 12px 12px;
  box-shadow: var(--shadow);
  padding: 11px;
}

/* the cassette itself, sitting in the well */
.cassette {
  background: linear-gradient(168deg, #453222, #2a1e14 68%);
  border: 1px solid rgba(244,230,200,.2);
  border-radius: 6px;
  padding: 9px 11px 10px;
  position: relative;
  box-shadow: 0 1px 0 rgba(255,240,215,.13) inset, 0 8px 22px -10px #000;
}
/* the four case screws */
.cassette::before,
.cassette::after {
  content: ""; position: absolute; top: 6px; bottom: 6px; width: 5px;
  background:
    radial-gradient(circle at 50% 4px, #8a7256 1.6px, transparent 2px),
    radial-gradient(circle at 50% calc(100% - 4px), #8a7256 1.6px, transparent 2px);
}
.cassette::before { left: 5px; }
.cassette::after  { right: 5px; }

/* inlay label — the typed paper strip */
.inlay {
  background:
    linear-gradient(178deg, var(--paper), #e3d3b2);
  color: #241a12;
  border-radius: 3px;
  padding: 9px 12px 11px;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 3px 12px -4px rgba(0,0,0,.6);
}
.inlay-top {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 7px;
  font-family: var(--type); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(36,26,18,.62);
}
.inlay-rule { flex: 1; height: 1px; background: rgba(36,26,18,.25); }
#track-no { font-variant-numeric: tabular-nums; }

.song {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 5.2vw, 40px);
  line-height: 1.1;
  letter-spacing: .005em;
  color: #1d1409;
}
.song-en {
  margin: 4px 0 0;
  font-family: var(--type); font-size: 14.5px;
  letter-spacing: .02em; color: rgba(36,26,18,.74);
}
.credit {
  margin: 8px 0 0;
  font-size: 15px; line-height: 1.35;
  color: rgba(36,26,18,.7);
}
.credit b { font-weight: 600; color: rgba(36,26,18,.85); }

/* reels + tape window: this is the progress bar */
.window {
  margin-top: 10px;
  height: 64px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  cursor: ew-resize;
  position: relative;
  touch-action: none;
}

.reel { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.reel::before {                       /* the empty reel well, behind the tape */
  content: ""; position: absolute; inset: 2px;
  border-radius: 50%;
  background: #080604;
  box-shadow: 0 0 0 1px rgba(244,230,200,.08), 0 2px 6px rgba(0,0,0,.6) inset;
}
.spool {                              /* wound tape — its radius IS the progress */
  position: absolute;
  width: var(--r, 60%); height: var(--r, 60%);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgba(255,240,215,.10) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 40% 34%, #6a4a2e, #3b281a 72%, #241809);
  box-shadow: 0 0 0 1px rgba(255,235,200,.14), 0 3px 8px -2px rgba(0,0,0,.7);
  transition: width .3s linear, height .3s linear;
}
.hub {                                /* the toothed hub — this is what spins */
  position: absolute;
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4);
}
.hub::before, .hub::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  background: #1c140e;
}
.hub::before { width: 5px;  height: 25px; }
.hub::after  { width: 25px; height: 5px;  }

.reel-l .hub { animation: spin 2.6s linear infinite; animation-play-state: paused; }
.reel-r .hub { animation: spin 3.4s linear infinite; animation-play-state: paused; }
[data-state="playing"] .reel-l .hub,
[data-state="playing"] .reel-r .hub { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the stretch of tape running between the reels, past the head */
.band {
  height: 6px;
  border-radius: 1px;
  position: relative;
  background: linear-gradient(180deg, #2f2015, #1b120b);
  box-shadow: 0 0 0 1px rgba(244,230,200,.07);
  transition: height .15s;
}
.band-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(180deg, #8a6038, #5b3d23);
  border-radius: 1px 0 0 1px;
}
.band-fill::after {                   /* the playback head */
  content: ""; position: absolute; right: -1px; top: -5px; bottom: -5px;
  width: 2px; border-radius: 1px;
  background: var(--taxi);
  box-shadow: 0 0 8px rgba(233,168,28,.7);
}
.window:hover .band { height: 8px; }

/* deck controls */
.controls {
  margin-top: 9px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.time {
  margin: 0;
  font-family: var(--type); font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: rgba(244,230,200,.62);
  white-space: nowrap;
}
.time i { margin: 0 5px; opacity: .4; font-style: normal; }

.transport { display: flex; align-items: center; gap: 4px; }
.transport button {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--cream); opacity: .78;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%;
  transition: opacity .18s, background .18s, transform .1s;
}
.transport button:hover { opacity: 1; background: rgba(244,230,200,.09); }
.transport button:active { transform: scale(.92); }

.play {
  width: 46px !important; height: 46px !important;
  background: var(--cream) !important;
  color: var(--ink) !important;
  opacity: 1 !important;
  box-shadow: 0 3px 16px -4px rgba(0,0,0,.7);
}
.play:hover { background: #fff !important; }
.i-pause { display: none; }
[data-state="playing"] .i-play  { display: none; }
[data-state="playing"] .i-pause { display: block; }
[data-state="idle"] .play { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 3px 16px -4px rgba(0,0,0,.7), 0 0 0 0 rgba(244,230,200,.35); }
  50%      { box-shadow: 0 3px 16px -4px rgba(0,0,0,.7), 0 0 0 11px rgba(244,230,200,0); }
}

.utils { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.txt {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 3px 1px;
  color: var(--cream); opacity: .66;
  font-family: var(--body); font-size: 15.5px;
  border-bottom: 1px solid transparent;
  transition: opacity .18s, border-color .18s;
}
.txt:hover { opacity: 1; border-bottom-color: var(--taxi); }

.vol { display: flex; align-items: center; gap: 5px; color: rgba(244,230,200,.55); }
.vol:hover { color: var(--cream); }
#vol {
  appearance: none; -webkit-appearance: none;
  width: 48px; height: 14px; background: none; cursor: pointer;
}
#vol::-webkit-slider-runnable-track { height: 2px; background: rgba(244,230,200,.28); border-radius: 2px; }
#vol::-moz-range-track { height: 2px; background: rgba(244,230,200,.28); border-radius: 2px; }
#vol::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 9px; height: 9px; border-radius: 50%; background: var(--cream);
  margin-top: -3.5px; border: 0;
}
#vol::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--cream); }

/* The liner note used to sit under the deck, which made the whole unit ~58px
   taller and pushed it up over his hands. It now lives in the empty street at
   bottom-left, where it costs the deck no height at all. */
.liner {
  position: fixed;
  left: var(--gap);
  bottom: calc(var(--gap) + env(safe-area-inset-bottom, 0px));
  z-index: 4;
  margin: 0;
  /* 30ch lands around 240px, which clears the deck's left edge at every window
     shape the offset rules produce (narrowest case ~315px) */
  max-width: min(30ch, calc(50vw - 254px));
  text-align: left;
  font-size: 15px; line-height: 1.45;
  color: rgba(244,230,200,.8);
  text-shadow: 0 1px 3px rgba(12,8,5,.95), 0 2px 16px rgba(12,8,5,.92);
  transition: opacity .35s;
}
.liner.swap { opacity: 0; }
/* the trim panel takes the same corner */
.trim.on ~ .deck-wrap .liner, body:has(.trim.on) .liner { opacity: 0; }

/* ── inlay card (full tracklist) ─────────────────────────────────────────── */

.sheet[hidden] { display: none; }

.sheet {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: var(--gap);
  background: rgba(12,8,5,.72);
  backdrop-filter: blur(7px);
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }

.sheet-card {
  width: min(760px, 100%);
  max-height: min(84dvh, 780px);
  display: flex; flex-direction: column;
  background: linear-gradient(172deg, var(--paper), #e0cfad);
  color: #241a12;
  border-radius: 4px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9);
  animation: rise .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(18px); opacity: 0; } }

.sheet-head { padding: 20px 24px 14px; border-bottom: 1px solid rgba(36,26,18,.2); position: relative; }
.sheet-kicker { margin: 0; font-family: var(--type); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: rgba(36,26,18,.5); }
#sheet-title { margin: 2px 0 0; font-family: var(--display); font-size: 34px; line-height: 1; }
.sheet-sub { margin: 5px 0 0; font-family: var(--type); font-size: 12px; color: rgba(36,26,18,.6); }
.sheet-x {
  position: absolute; top: 16px; right: 16px;
  appearance: none; background: none; border: 1px solid rgba(36,26,18,.25);
  border-radius: 50%; width: 30px; height: 30px; cursor: pointer;
  color: #241a12; font-size: 13px; line-height: 1;
}
.sheet-x:hover { background: rgba(36,26,18,.08); }

.sheet-body { overflow-y: auto; padding: 6px 24px 18px; }

.side-block { margin-top: 16px; }
.side-block h3 {
  margin: 0 0 4px;
  font-family: var(--type); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(36,26,18,.55);
  display: flex; align-items: center; gap: 10px;
}
.side-block h3::after { content: ""; flex: 1; height: 1px; background: rgba(36,26,18,.22); }

.row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px; align-items: baseline;
  width: 100%; text-align: left;
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 7px 6px 7px 4px; margin: 0 -6px;
  border-radius: 3px;
  color: inherit;
  border-bottom: 1px solid rgba(36,26,18,.09);
}
.row:hover { background: rgba(36,26,18,.06); }
.row-n { font-family: var(--type); font-size: 11px; color: rgba(36,26,18,.45); font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: -10px; }
.row-t { min-width: 0; }
.row-hi { display: block; font-family: var(--display); font-size: 19px; line-height: 1.2; }
.row-meta { display: block; font-family: var(--type); font-size: 11.5px; color: rgba(36,26,18,.6); margin-top: 2px; }
.row-len { font-family: var(--type); font-size: 11.5px; color: rgba(36,26,18,.45); font-variant-numeric: tabular-nums; }
.row[data-on="1"] { background: rgba(176,74,50,.13); }
.row[data-on="1"] .row-n { color: var(--brick); }
.row[data-on="1"] .row-n::before { content: "▸ "; }

.sheet-foot {
  margin: 0; padding: 11px 24px 14px;
  border-top: 1px solid rgba(36,26,18,.2);
  font-family: var(--type); font-size: 11px; color: rgba(36,26,18,.6);
  display: flex; flex-wrap: wrap; gap: 4px 10px;
}
.sheet-foot kbd {
  font-family: var(--type); font-size: 10px;
  border: 1px solid rgba(36,26,18,.3); border-bottom-width: 2px;
  border-radius: 3px; padding: 1px 4px; margin-right: 2px;
  background: rgba(255,255,255,.4);
}

/* ── trim panel (press T) ────────────────────────────────────────────────── */

.trim {
  position: fixed; left: var(--gap); bottom: var(--gap); z-index: 35;
  width: 268px;
  background: rgba(12,8,5,.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(244,230,200,.22);
  border-radius: 10px;
  padding: 13px 14px 14px;
  font-family: var(--type);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.trim.on { opacity: 1; transform: none; pointer-events: auto; }
.trim-head {
  margin: 0 0 8px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--taxi); display: flex; justify-content: space-between; align-items: baseline;
}
.trim-head span { color: rgba(244,230,200,.4); letter-spacing: .06em; text-transform: none; }
.trim-song { margin: 0 0 8px; font-family: var(--body); font-size: 14px; color: rgba(244,230,200,.8); }
.trim-clock { margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; }
.trim-clock b { font-size: 30px; font-variant-numeric: tabular-nums; color: var(--cream); }
.trim-clock span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: rgba(244,230,200,.4); }
.trim-row { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.trim button {
  appearance: none; cursor: pointer;
  background: rgba(244,230,200,.09);
  border: 1px solid rgba(244,230,200,.2);
  color: var(--cream);
  border-radius: 6px; padding: 6px 9px;
  font-family: var(--type); font-size: 12.5px;
}
.trim button:hover { background: rgba(244,230,200,.17); }
.trim .trim-go { flex: 1; background: var(--taxi); border-color: var(--taxi); color: #1d1409; font-weight: 700; }
.trim .trim-go:hover { background: #f4b62c; }
.trim-now { margin: 0 0 9px; font-size: 12px; color: rgba(244,230,200,.55); }

/* ── plumbing ────────────────────────────────────────────────────────────── */

.yt-pit { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--gap) + 4px); transform: translateX(-50%) translateY(8px);
  margin: 0; z-index: 40;
  padding: 7px 15px;
  background: rgba(23,17,12,.92);
  border: 1px solid rgba(244,230,200,.2);
  border-radius: 40px;
  font-family: var(--type); font-size: 12px; letter-spacing: .03em;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── smaller screens ─────────────────────────────────────────────────────── */

@media (max-width: 940px) {
  /* the crop has moved past the painted title by here, so recentre */
  .unit { margin-left: 0; }
}

/* ── how far right the deck can sit ──────────────────────────────────────────
   The deck's right edge should land ~24px short of the रेखा line on Amitabh's
   forearm, since his fingertip and that line are only 70px apart in the source
   art and the deck is 452px wide — there is nothing to fit between them.

   With `justify-content: center`, a leading margin X moves the item right by
   X/2, so the right edge sits at (100vw + 452px + X) / 2. Setting that equal to
   lineX − 24px gives X = 2·lineX − 100vw − 500px.

   lineX itself depends on which axis `background-size: cover` fills, and on
   which background-position-x applies — hence three branches. Each is gated on
   min-width so the ≤940px recentre above always wins on small screens. */

@media (min-width: 941px) and (min-aspect-ratio: 1672/941) {
  /* wider than the art: cover fills width, no horizontal crop. lineX = 84.04vw */
  .unit { margin-left: max(0px, calc(68.08vw - 500px)); }
}
@media (min-width: 941px) and (max-aspect-ratio: 1672/941) {
  /* taller: cover fills height and pans at 58%. lineX = 58vw + 46.24vh */
  .unit { margin-left: max(0px, calc(16vw + 92.48vh - 500px)); }
}
@media (min-width: 941px) and (max-aspect-ratio: 6/5) {
  /* near-square and up: the art pans at 82%. lineX = 82vw + 3.6vh */
  .unit { margin-left: max(0px, calc(64vw + 7.2vh - 500px)); }
}

@media (max-width: 720px) {
  :root { --gap: 14px; }
  /* Hold the deck off the right edge so the रेखा line sits in a clear gutter.
     The crop itself is handled by the aspect-ratio rule below. */
  .deck-wrap { justify-content: flex-start; }
  .unit { width: min(452px, calc(100% - 58px)); }
  .clock { font-size: 17px; }
  .clock .ampm { font-size: 13px; }
  .wordmark { font-size: 27px; }
  .wordmark span { display: none; }
  .mehfil { font-size: 13px; letter-spacing: .03em; }
  .trim { width: calc(100% - var(--gap) * 2); }

  /* Most visitors arrive on a phone, where the deck was taking 40% of the
     screen and burying the artwork. Everything below trims it to roughly 30%
     without dropping a single control or line of information. */
  .tabs { padding-left: 0; }
  .tab { padding: 4px 9px 5px; }
  .tab b { font-size: 11px; }
  .tab span { font-size: 13.5px; }

  .deck { border-radius: 12px; padding: 9px; }
  .cassette { padding: 7px 9px 8px; }
  .inlay { padding: 7px 10px 9px; }
  .inlay-top { font-size: 10.5px; letter-spacing: .12em; margin-bottom: 5px; }
  .song { font-size: 22px; }
  .song-en { font-size: 12.5px; margin-top: 3px; }
  .credit { font-size: 13px; margin-top: 5px; }

  .window { height: 52px; margin-top: 8px; grid-template-columns: 52px 1fr 52px; }
  .reel { width: 52px; height: 52px; }
  .hub { width: 20px; height: 20px; }
  .hub::before { width: 4px;  height: 20px; }
  .hub::after  { width: 20px; height: 4px;  }

  /* This row has to fit timecode + transport + three labels into ~284px. It was
     overflowing the deck by ~47px, because Courier Prime is monospaced and
     "0:00 / 7:49" alone cost 80px of it. Mukta's tabular figures do the same job
     in ~55px, which buys back the room the tap targets need. */
  .controls { margin-top: 7px; grid-template-columns: 1fr auto 1fr; gap: 4px; }
  .time { font-family: var(--body); font-size: 13.5px; }
  .time i { margin: 0 2px; }
  .play { width: 40px !important; height: 40px !important; }
  /* the row's height is set by the play button, so these grow for free */
  .transport { gap: 1px; }
  .transport button { width: 36px; height: 36px; }
  .utils { gap: 3px; }
  .utils .vol { display: none; }
  .txt { font-size: 13.5px; padding: 10px 3px; }
  .liner { display: none; }
  .sheet-body { padding: 6px 16px 18px; }
  .sheet-head { padding: 16px 18px 12px; }
  .sheet-foot { display: none; }        /* no keyboard to shortcut with */
  .row { grid-template-columns: 22px 1fr auto; gap: 9px; }
  .row-hi { font-size: 17px; }
}

@media (max-width: 420px) {
  .song { font-size: 21px; }
  .credit { font-size: 12.5px; }
  /* A 58px gutter is a big slice of a 360px screen and the controls row can't
     fit in what's left. 40px still leaves the रेखा line clearly in the open. */
  .unit { width: calc(100% - 40px); }
  .time { font-size: 12.5px; }
  .transport button { width: 34px; height: 34px; }
  .txt { font-size: 12.5px; padding: 11px 2px; }
}

/* Portrait and near-square viewports crop the artwork hard from the sides, and
   at the default 58% the forearm — the रेखा line — falls off the right edge.
   Framing on aspect ratio rather than width catches portrait tablets too, which
   are wide enough to miss every phone breakpoint. 82% keeps his face and that
   line both in shot. */
@media (max-aspect-ratio: 6/5) {
  .art { background-position: 82% 44%; }
}

/* very short viewports: drop the credit line rather than crush the deck */
@media (max-height: 620px) {
  .liner { display: none; }
  .credit { display: none; }
  .window { height: 60px; grid-template-columns: 60px 1fr 60px; }
  .reel { width: 60px; height: 60px; }
  .hub { width: 21px; height: 21px; }
  .hub::before { width: 4px; height: 21px; }
  .hub::after  { width: 21px; height: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .clock .tick { opacity: 1; }
}
