/* About, Toolkit and Beyond the pixels (js/about.js).

   About (.story): one scene that plays with the scroll. The three
   statements take turns in the middle of the screen; the last one rises to
   the top as your portrait comes up with your character and a few lines.

   Toolkit (.kit): cards on your gradient, dealt two at a time onto a stack;
   they gather into one, and that one grows until its gradient fills the
   screen: the top of Beyond the pixels.

   Beyond the pixels (.beyond): a bento of tiles in three columns, the
   middle one offset. Each opens its own thing: the gallery (full screen),
   the songs, or the game.

   --grad is the hero's paper light (paperField in js/shaders.js) in CSS: a
   terracotta haze at the top settling into sand and paper, a pale bloom on
   the right. The cards, the growing card and the top of Beyond all use it,
   so the hand-over has no seam. */

:root {
  --grad:
    radial-gradient(70% 55% at 100% 42%, rgba(243, 239, 231, 0.55), rgba(243, 239, 231, 0) 70%),
    radial-gradient(60% 40% at 8% 0%, rgba(182, 106, 75, 0.28), rgba(182, 106, 75, 0) 70%),
    linear-gradient(to bottom, #CAA188 0%, #D3B9A3 26%, #E4DACB 58%, #F3EFE7 96%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.14 0 0 0 0 0.13 0 0 0 0 0.12 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.story, .kit, .beyond { --muted: rgba(36, 34, 31, 0.62); }

/* the small labels: a terracotta pixel, then the words (as elsewhere) */
.story__label,
.repeat__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--text);
  font-size: var(--t-label);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.story__label::before,
.repeat__title::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--terra);
}

/* =====================================================================
   About: one scene
   ===================================================================== */

/* still (no JS, reduced motion): the statements one under another, then you */
.story {
  position: relative;
  padding: clamp(96px, 14vh, 160px) var(--gutter) clamp(80px, 12vh, 140px);
}
.story__label { justify-content: center; margin-bottom: clamp(36px, 6vh, 64px); }
.story__lines {
  display: grid;
  gap: clamp(40px, 8vh, 96px);
  text-align: center;
}
.beat__line {
  max-width: 13ch;
  margin: 0 auto;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t-display);
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
  transform-origin: 50% 50%;
}
.beat__line .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.beat__line .w > span { display: inline-block; will-change: transform; }

.meet {
  display: grid;
  grid-template-columns: auto minmax(0, 40ch);
  align-items: center;
  justify-content: center;
  column-gap: clamp(48px, 7vw, 120px);
  margin-top: clamp(72px, 12vh, 140px);
}
.meet__pic {
  position: relative;
  width: min(420px, 70vw);
  aspect-ratio: 4 / 5;
}
/* me on a soft blob. Once it's up the photo comes into focus: it fades in
   from a soft blur, settling from a touch larger (js/about.js adds .is-in).
   Without the script, or with reduced motion: just the photograph */
.meet__photo { position: absolute; inset: 0; margin: 0; }
.meet__blob { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--sand); }
.meet__photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.story.is-live .meet__photo img {
  opacity: 0;
  filter: blur(16px);
  transform: scale(1.06);
  transition: opacity 0.9s ease, filter 1.2s var(--ease-out), transform 1.4s var(--ease-out);
}
.story.is-live .meet__photo.is-in img { opacity: 1; filter: none; transform: none; }
.meet__me {
  position: absolute;
  z-index: 2;
  left: -24%;
  bottom: -3%;
  width: 42%;
  aspect-ratio: 0.72;
  margin: 0;
  transform-origin: 50% 100%;
}
.meet__me canvas { display: block; width: 100%; height: 100%; }
.no-cutout .meet__me { display: none; }

.meet__text {
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
}
.meet__text p + p { margin-top: 0.9em; }
.meet__text .meet__hey {
  font-family: var(--display);
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.15;
}

/* live: the stage holds still while the scene plays (js/about.js sets every
   transform from the scroll) */
.story.is-live {
  height: 420svh;
  padding: 0;
}
.story.is-live .story__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
.story.is-live .story__label {
  position: absolute;
  left: 0;
  right: 0;
  top: max(96px, 13svh);
  margin: 0;
}
.story.is-live .story__lines {
  position: absolute;
  inset: 0 var(--gutter);
  display: block;
}
.story.is-live .beat__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  translate: 0 -50%;
}
.story.is-live .meet {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 33svh;
  bottom: 7svh;
  margin: 0;
  grid-template-rows: 100%;
}
.story.is-live .meet__pic {
  width: auto;
  height: 100%;
  max-height: 600px;
  align-self: center;
}

@media (max-width: 860px) {
  .meet {
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 36px;
  }
  .meet__text { max-width: 44ch; text-align: center; }
  .meet__me { left: -18%; width: 44%; }
  .story.is-live .meet {
    top: 29svh;
    bottom: 5svh;
    grid-template-rows: minmax(0, 1fr) auto;
    row-gap: 24px;
  }
  .story.is-live .meet__pic { max-height: none; }
  .story.is-live .meet__text { font-size: 15px; line-height: 1.5; }
  .story.is-live .meet__text .meet__hey { font-size: 24px; }
}
@media (max-width: 760px) {
  .story.is-live { height: 400svh; }
  /* phones: the character steps onto the blob rather than off the screen */
  .meet__me { left: -7%; width: 38%; }
  /* the photo takes what the words leave, so the words take less: the full
     width, a touch smaller, and the block starts higher */
  .story.is-live .meet { top: 25svh; bottom: 3svh; row-gap: 16px; }
  .story.is-live .meet__text { max-width: none; font-size: var(--t-small); line-height: 1.45; }
  .story.is-live .meet__text p + p { margin-top: 0.7em; }
  .story.is-live .meet__text .meet__hey { font-size: 22px; }
}

/* =====================================================================
   Toolset: a sentence, and a cursor that places the logos
   ===================================================================== */

.kit {
  position: relative;
  padding: clamp(24px, 5vh, 64px) var(--gutter) clamp(40px, 6vh, 72px);
}
.kit__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.kit__line {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  /* four lines, always: as large as fits, the longest line being about
     19.5em with its logos in */
  font-size: min(var(--t-h2), calc((100vw - 2 * var(--gutter)) / 19.5));
  line-height: 1.32;
  letter-spacing: -0.02em;
  text-align: center;
}
.kit__row { display: block; white-space: nowrap; }
/* a logo's place in the line */
.chip {
  position: relative;
  display: inline-block;
  width: 1.08em;
  height: 1.08em;
  margin: 0 0.16em 0 0.04em;
  vertical-align: -0.2em;
}
.chip > img,
.chip > svg { display: block; width: 100%; height: 100%; }
.chip__pad { padding: 10%; }
.kit__cursor { display: none; }

/* live: the sentence starts whole, without logos; when it comes into
   view the cursors bring them in (js/about.js), and each logo's place opens
   up as it arrives, pushing the words apart */
.kit.is-live {
  overflow: hidden; /* the cursors come in from beyond the edges */
}
.kit.is-live .kit__stage { position: relative; }
.kit.is-live .chip {
  width: 0;
  margin: 0;
  transition: width 0.55s var(--ease-out), margin 0.55s var(--ease-out);
}
.kit.is-live .chip.is-open {
  width: 1.08em;
  margin: 0 0.16em 0 0.04em;
}
.kit.is-live .chip > * { opacity: 0; transform: scale(0.6); }
.kit.is-live .chip.is-in > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.2s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* a logo on its way, in a cursor's hand */
.kit__fly {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: var(--chip, 44px);
  height: var(--chip, 44px);
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(60, 34, 20, 0.3));
  will-change: transform;
}
.kit__fly > img,
.kit__fly > svg { display: block; width: 100%; height: 100%; }

/* the cursors: like collaborators' in a design file */
.kit.is-live .kit__cursor {
  display: block;
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}
.kit__cursor svg { display: block; width: 26px; height: 26px; filter: drop-shadow(0 3px 4px rgba(36, 34, 31, 0.25)); }
.kit__cursor b {
  position: absolute;
  left: 20px;
  top: 22px;
  padding: 4px 9px;
  border-radius: 6px 999px 999px 999px;
  background: var(--terra);
  color: var(--white);
  font: 600 12px/1 var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.kit__cursor--b b { background: var(--ink); color: var(--paper); }
.kit__cursor--c b { background: var(--sand); color: var(--ink); }

@media (max-width: 760px) {
  .kit__cursor svg { width: 22px; height: 22px; }
  .kit__cursor b { font-size: var(--t-label); left: 17px; top: 19px; }
}

/* =====================================================================
   Beyond the pixels
   ===================================================================== */

.beyond { position: relative; }
.beyond__canvas {
  position: relative;
  container-type: inline-size; /* the bento's rows are worked out from its width */
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(40px, 6vh, 72px) var(--gutter) clamp(64px, 8vw, 112px);
}
.beyond__head { max-width: 760px; }
.beyond__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t-h1);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.beyond__line {
  max-width: 44ch;
  margin-top: clamp(16px, 2vw, 24px);
  font-size: var(--t-lead);
  line-height: 1.55;
  color: rgba(36, 34, 31, 0.72);
}

/* ---------- the bento ----------
   Three columns on four rows. The sides hold two tall tiles each (two rows
   apiece); the middle holds a short tile over a taller poster (three rows),
   so it steps out of line with the sides and they all end level. A row is half a
   tall tile less half a gap, the tall tiles being a touch wider than tall. */
.bento {
  --g: clamp(12px, 1.6vw, 22px);
  --w: 100cqw; /* the bento's own width: the inside of .beyond__canvas */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, calc(((var(--w) - 2 * var(--g)) / 3 / 1.08 - var(--g)) / 2));
  gap: var(--g);
  margin-top: clamp(40px, 5vw, 64px);
}
.tile--a { grid-area: 1 / 1 / 3 / 2; }
.tile--e { grid-area: 3 / 1 / 5 / 2; }
.tile--b { grid-area: 1 / 2 / 2 / 3; }
.tile--d { grid-area: 2 / 2 / 5 / 3; }
.tile--c { grid-area: 1 / 3 / 3 / 4; }
.tile--f { grid-area: 3 / 3 / 5 / 4; }

/* a tile */
.tile {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: clamp(16px, 1.8vw, 24px);
  background: var(--sand);
  color: var(--ink);
  font: inherit;
  text-align: left;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
button.tile { cursor: pointer; }
.tile:focus-visible { outline: 2px solid var(--terra); outline-offset: 4px; }
/* its picture fills it, and leans in a little on hover */
.tile__media {
  position: absolute;
  inset: 0;
  display: block;
  transition: transform 0.8s var(--ease-out);
}
.tile__media > img,
.tile__media > .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile:hover .tile__media,
.tile:focus-visible .tile__media { transform: scale(1.04); }
/* what it is, bottom left: small plain text, only on hover or focus, over
   a soft shade so it reads on light pictures too. The designed tiles (On
   repeat, the rally) have no tag; they say what they are themselves */
.tile__tag {
  position: absolute;
  z-index: 2;
  left: clamp(14px, 1.6vw, 20px);
  bottom: clamp(12px, 1.4vw, 16px);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #FBF9F5;
  opacity: 0;
  translate: 0 4px;
  transition: opacity 0.3s ease, translate 0.4s var(--ease-out);
}
.tile__media::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(20, 18, 16, 0.45), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tile:hover .tile__tag,
.tile:focus-visible .tile__tag { opacity: 1; translate: 0 0; }
.tile:hover .tile__media::after,
.tile:focus-visible .tile__media::after { opacity: 1; }
/* touch screens can't hover: the label stays, quietly */
@media (hover: none) {
  .tile__tag { opacity: 1; translate: 0 0; }
  .tile__media::after { opacity: 1; }
}
/* and that it opens, top right, on hover */
/* rising in once, each as it comes into view (js/about.js adds .is-in) */
.beyond.is-live .tile { opacity: 0; transform: translateY(24px); }
.beyond.is-live .tile.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease calc(var(--i) * 0.07s), transform 0.8s var(--ease-out) calc(var(--i) * 0.07s);
}

/* words on a tile (On repeat, Fancy a rally?) */
.tile__big {
  display: block;
  font-family: var(--display);
  font-size: var(--t-h2);
  line-height: 1;
  letter-spacing: -0.02em;
}
.tile__small { display: block; margin-top: 8px; font-size: var(--t-small); opacity: 0.7; }

/* ---------- On repeat: ink, with a record coming out of the side ---------- */
.tile--music {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(18px, 2vw, 28px);
  background: var(--ink);
  color: var(--paper);
}
.tile__disc {
  position: absolute;
  z-index: -1;
  right: -14%;
  top: 50%;
  width: 62%;
  aspect-ratio: 1;
  translate: 0 -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--ink) 0 3%, var(--terra) 3.5% 18%, transparent 18.5%),
    repeating-radial-gradient(circle, #34312C 0 1px, #2A2723 1px 3px);
  transition: right 0.7s var(--ease-out);
}
.tile--music:hover .tile__disc,
.tile--music:focus-visible .tile__disc { right: -6%; animation: spin 3s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }


/* the slots until your work is there: plainly marked */
.ph {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 8%;
  background: repeating-linear-gradient(135deg, rgba(36, 34, 31, 0.035) 0 6px, transparent 6px 12px), #EDE4D8;
  font-size: var(--t-label);
  line-height: 1.3;
  color: rgba(36, 34, 31, 0.62);
}
.ph b { font-weight: 600; color: var(--ink); }
.tile .ph { justify-content: center; align-items: center; text-align: center; padding-bottom: 18%; background: repeating-linear-gradient(135deg, rgba(36, 34, 31, 0.035) 0 7px, transparent 7px 14px), #E8DFD2; }

/* ---------- the songs, opened from the record: a little player ----------
   Dark and warm, like the record: the song playing on the left with its
   cover, the songs on the right, play, back and next under them. */
.songs {
  --cream: #F4EADF;
  --soft: rgba(244, 234, 223, 0.62);
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
  padding: clamp(20px, 2.6vw, 28px) clamp(20px, 2.8vw, 32px);
  border: 0;
  border-radius: 24px;
  background:
    radial-gradient(70% 60% at 0% 100%, rgba(214, 128, 70, 0.75), transparent 70%),
    radial-gradient(60% 70% at 100% 0%, rgba(150, 82, 52, 0.55), transparent 70%),
    linear-gradient(160deg, #2A211D, #1E1916 60%, #2B1E18);
  color: var(--cream);
  box-shadow: 0 40px 80px -24px rgba(20, 10, 4, 0.6);
}
.songs::backdrop { background: rgba(36, 34, 31, 0.55); }
/* the page holds still behind it (and behind the game) */
html:has(.songs[open], .rally[open]) { overflow: hidden; }
.songs { overscroll-behavior: contain; }
.songs[open] { animation: songs-in 0.45s var(--ease-out); }
@keyframes songs-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.songs__close {
  position: absolute;
  top: clamp(14px, 2vw, 22px);
  right: clamp(14px, 2vw, 22px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  font: 300 30px/1 var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.songs__close:hover { background: rgba(244, 234, 223, 0.1); }
.songs__close:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.songs .repeat__title { color: var(--cream); margin-bottom: clamp(16px, 2vw, 22px); }

.deck {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(20px, 2.8vw, 32px);
}
/* the song playing */
.now { min-width: 0; padding-right: clamp(20px, 2.8vw, 32px); border-right: 1px solid rgba(244, 234, 223, 0.1); }
.now__art {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(244, 234, 223, 0.08);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.6);
}
.now__art img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s ease; }
.now__art img.is-in { opacity: 1; }
.now__song {
  margin: 16px 0 0;
  font-family: var(--display);
  font-size: clamp(22px, 2vw, 26px);
  line-height: 1.1;
}
.now__artist { margin: 4px 0 0; font-size: var(--t-small); color: var(--soft); }
.now__time {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: var(--t-label);
  font-variant-numeric: tabular-nums;
  color: var(--soft);
}
.now__bar { position: relative; height: 3px; border-radius: 2px; background: rgba(244, 234, 223, 0.18); }
.now__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--cream);
  transition: width 0.5s linear;
}
.now__fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--cream);
}

/* the songs */
.deck__side { display: flex; flex-direction: column; min-width: 0; }
.songs .repeat__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: track;
}
.songs .repeat__list li { counter-increment: track; }
.track__btn {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--cream);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.track__btn::before {
  content: counter(track, decimal-leading-zero);
  grid-row: 1 / 3;
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #E3A57C;
}
.track__song {
  grid-column: 2;
  font-family: var(--display);
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.15;
}
.track__artist { grid-column: 2; margin-top: 2px; font-size: var(--t-label); color: var(--soft); }
.track__btn:hover { background: rgba(244, 234, 223, 0.06); }
.track__btn[aria-current="true"] {
  background: linear-gradient(90deg, rgba(150, 86, 58, 0.55), rgba(176, 98, 62, 0.75));
}
.track__btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
/* the song playing: three bars that move while it plays */
.track__eq {
  grid-area: 1 / 3 / 3 / 4;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 15px;
  opacity: 0;
}
.track__eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--cream); transform-origin: bottom; transform: scaleY(0.4); }
.track__eq i:nth-child(2) { transform: scaleY(0.9); }
.track__eq i:nth-child(3) { transform: scaleY(0.6); }
.track__btn[aria-current="true"] .track__eq { opacity: 1; }
.songs.is-playing .track__btn[aria-current="true"] .track__eq i { animation: eq 0.9s ease-in-out infinite alternate; }
.songs.is-playing .track__btn[aria-current="true"] .track__eq i:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.7s; }
.songs.is-playing .track__btn[aria-current="true"] .track__eq i:nth-child(3) { animation-delay: -0.6s; animation-duration: 1.1s; }
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

/* play, back and next */
.deck__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 32px);
  margin-top: auto;
  padding-top: 16px;
}
.deck__btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}
.deck__btn svg { width: 22px; height: 22px; fill: currentColor; }
.deck__btn:hover { background: rgba(244, 234, 223, 0.1); }
.deck__btn:active { transform: scale(0.94); }
.deck__btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }
.deck__btn--play { width: 56px; height: 56px; background: var(--cream); color: #2A211D; }
.deck__btn--play:hover { background: #FFF6EC; }
.deck__btn--play svg { width: 24px; height: 24px; }
.deck__btn--play .i-pause,
.songs.is-playing .deck__btn--play .i-play { display: none; }
.songs.is-playing .deck__btn--play .i-pause { display: block; }

/* a song that won't load: the row fades and play does nothing */
.track__btn:disabled { opacity: 0.4; cursor: default; }
.track__btn:disabled:hover { background: transparent; }
.repeat__empty { padding-top: 10px; font-size: var(--t-label); color: var(--soft); }
.repeat__link[hidden] { display: none; }
.repeat__link {
  display: inline-block;
  margin-top: 14px;
  font-size: var(--t-small);
  color: var(--cream);
  text-underline-offset: 3px;
}
.repeat__link:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; border-radius: 3px; }

/* phones: the song playing is a row (a small cover beside its name), the
   songs under it */
@media (max-width: 700px) {
  .songs { border-radius: 22px; }
  .deck { grid-template-columns: minmax(0, 1fr); }
  .now {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
    padding: 0 0 16px;
    margin-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(244, 234, 223, 0.1);
  }
  .now__art { grid-row: 1 / 3; border-radius: 12px; }
  .now__song { margin: 0; align-self: end; font-size: 21px; }
  .now__artist { align-self: start; font-size: var(--t-small); }
  .now__time { grid-column: 1 / -1; }
  .track__btn { grid-template-columns: 26px minmax(0, 1fr) auto; padding: 7px 10px; border-radius: 10px; }
  .track__song { font-size: 17px; }
  .deck__btn--play { width: 52px; height: 52px; }
}

/* ---------- the gallery: one picture at a time, over the page itself, softly
   blurred and a little darker (no solid backdrop) ---------- */
.gallery {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(36, 34, 31, 0.32);
  -webkit-backdrop-filter: blur(28px) saturate(1.05);
  backdrop-filter: blur(28px) saturate(1.05);
}
.gallery[hidden] { display: none; }
/* opening: a plain, quick fade */
.gallery:not([hidden]) { animation: gallery-in 0.2s ease; }
@keyframes gallery-in { from { opacity: 0; } }
.has-gallery { overflow: hidden; }
/* the gallery owns every gesture: a sideways drag moves the picture
   (js/about.js), and there's nothing behind it to scroll */
.gallery { touch-action: none; }
.gallery__media {
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
}
.gallery__media > * { -webkit-user-drag: none; will-change: transform; }
/* each picture keeps its own shape (--ar, w / h, from js/about.js) and they
   all carry about the same weight: equal area, so a portrait stands tall and
   a landscape lies wide, never filling the screen */
.gallery__media img {
  --k: 68vmin;
  display: block;
  width: min(var(--k) * var(--sq, 1), 84vw, 82svh * var(--ar, 1));
  height: auto;
  aspect-ratio: var(--ar, auto);
  border-radius: 4px;
  box-shadow: 0 24px 60px -24px rgba(20, 18, 16, 0.45);
}
.gallery__media .ph {
  width: min(70vw, 70svh * var(--ar, 1.5));
  height: auto;
  aspect-ratio: var(--ar, 1.5);
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: var(--t-small);
  background: repeating-linear-gradient(135deg, rgba(36, 34, 31, 0.04) 0 7px, transparent 7px 14px), #E3D6C6;
}
.gallery__media .ph b { font-family: var(--display); font-weight: 400; font-size: var(--t-h2); }
.gallery__media > .is-in { animation: pic-in 0.55s var(--ease-out); }
@keyframes pic-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * var(--from, 40px))); } }
.gallery__arrow,
.gallery__close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font: 400 22px/1 var(--text);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.gallery__arrow { top: 50%; margin-top: -28px; }
.gallery__arrow--prev { left: clamp(16px, 2.4vw, 44px); }
.gallery__arrow--next { right: clamp(16px, 2.4vw, 44px); }
.gallery__close { top: clamp(16px, 2.4vw, 32px); right: clamp(16px, 2.4vw, 44px); }
.gallery__arrow .icon, .gallery__close .icon { width: 20px; height: 20px; }
.gallery__arrow:hover,
.gallery__close:hover { background: var(--terra); color: var(--white); }
.gallery button:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }

/* ---------- tablets: two columns, still offset ---------- */
@media (max-width: 860px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: calc((var(--w) - var(--g)) / 2 / 2.2);
  }
  .tile--a { grid-area: span 2 / span 1; }
  .tile--b { grid-area: span 2 / span 1; }
  .tile--c { grid-area: span 2 / span 1; }
  .tile--d { grid-area: span 2 / span 1; }
  .tile--e { grid-area: span 2 / span 1; }
  .tile--f { grid-area: span 2 / span 1; }
  .bento { grid-auto-flow: dense; }
}

/* ---------- phones: still a bento, two columns, so it's a short scroll:
   the photograph tall on the left beside the two posters; On repeat across;
   drawings and the second photograph side by side ---------- */
@media (max-width: 560px) {
  .beyond__canvas {
    padding-left: 16px;
    padding-right: 16px;
  }
  .bento {
    --g: 10px;
    --c: calc((var(--w) - var(--g)) / 2);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: var(--c) var(--c) calc(var(--c) * 0.62) calc(var(--c) * 1.1);
    grid-auto-rows: auto;
    grid-auto-flow: row;
  }
  .bento > .tile { aspect-ratio: auto; border-radius: 16px; }
  .bento > .tile--a { grid-area: 1 / 1 / 3 / 2; }
  .bento > .tile--c { grid-area: 1 / 2 / 2 / 3; }
  .bento > .tile--d { grid-area: 2 / 2 / 3 / 3; }
  .bento > .tile--b { grid-area: 3 / 1 / 4 / 3; }
  .bento > .tile--e { grid-area: 4 / 1 / 5 / 2; }
  .bento > .tile--f { grid-area: 4 / 2 / 5 / 3; }
  /* smaller tags and arrow on the small tiles */
  .bento .tile__tag { left: 12px; bottom: 10px; }
}
@media (max-width: 760px) {
  .gallery__media img { --k: 94vmin; width: min(var(--k) * var(--sq, 1), calc(100vw - 24px), calc(100svh - 190px) * var(--ar, 1)); }
  .gallery__arrow { top: auto; bottom: max(24px, env(safe-area-inset-bottom)); margin: 0; width: 52px; height: 52px; }
  .gallery__arrow--prev { left: calc(50% - 68px); }
  .gallery__arrow--next { right: calc(50% - 68px); }
}

/* ---------- reduced motion: nothing slides, tilts or shivers ---------- */
@media (prefers-reduced-motion: reduce) {
  .beat__line .w > span,
  .tile__media, .tile__disc, .tile__tag, .tile__media::after { transition: none; }
  .gallery:not([hidden]) { animation: none; }
  .gallery__media > .is-in,
  .songs[open], .songs .track__eq i { animation: none !important; }
  .meet__me, .meet__text { transition: none; }
  .tile--music:hover .tile__disc { animation: none; }
  .tile:hover .tile__media { transform: none; }
}
