/* ==========================================================================
   Home — Imprint #imprint (24:17, H4): the triptych of timbres.
   The head sits on paper; then a full-bleed deck of three dark worlds
   (night / teal / violet) split by 2 px paper mullions. One string runs
   through all three panes at the same height: a triangle in the night, a
   sine in the teal, a square in the violet. Opening a pane strikes its
   segment (a damped scaleY) and then plays that world's one accent:
   a glass glint, three rings, a stepped jitter.
   Desktop: an accordion (flex-grow 1 → 2.6). Each pane lays its open
   composition out at the open width, so nothing reflows while it widens —
   the pane is a window sliding open over a fixed sheet.
   ≤900 px: the panes stack, sized to their content, every body visible.
   ========================================================================== */

html[data-page="home"] .imprints {
  --pad: clamp(20px, 2.4vw, 40px);
  --num: clamp(3.25rem, 7vw, 8.5rem);
  --num-h: calc(var(--num) * 0.8);
  --row-gap: clamp(40px, 5vw, 80px);
  --wave-y: calc(var(--pad) + var(--num-h) + var(--row-gap) / 2 - 12px);
  --drift-w: clamp(68px, 6.6vw, 112px);
  /* 88svh, but never taller than the room under the bar (short viewports). */
  --deck-h: clamp(480px, min(88svh, 100svh - var(--bar-h) - 8px), 1000px);
  --lead-first: max(var(--pad), var(--gutter));
  /* The section ends on a paper band, so the next boundary string has one colour above it. */
  padding-bottom: 10svh;
}

html[data-page="home"] .imprints .section-head {
  margin-bottom: clamp(40px, 5.5vw, 96px);
}

html[data-page="home"] .imprints .section-head__aside {
  text-wrap: balance;
}

/* The three timbres, foreshadowed after the subtitle in the worlds' own grounds. */
html[data-page="home"] .imprints .section-head__aside::after {
  content: "";
  display: inline-block;
  width: 96px;
  height: 12px;
  margin-left: 0.9em;
  vertical-align: -0.05em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 12' fill='none' stroke-width='1.5'%3E%3Cpath d='M0 6L3.5 1.5L10.5 10.5L17.5 1.5L24.5 10.5L28 6' stroke='%23141842' stroke-linejoin='round'/%3E%3Cpath d='M34 6Q37.5 -3 41 6T48 6T55 6T62 6' stroke='%232F5E57'/%3E%3Cpath d='M68.75 6V1.5H75.75V10.5H82.75V1.5H89.75V10.5H95.25V6' stroke='%2326246E'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* --- The deck ---------------------------------------------------------------- */
html[data-page="home"] .imprints .deck {
  container-type: inline-size;
  position: relative;
  display: flex;
  gap: 2px;
  width: 100%;
  height: var(--deck-h);
  background: var(--paper);
}

html[data-page="home"] .imprints .deck__item {
  /* The open pane's content width, known to every pane (container units of the
     deck). Flex grows the space left after the 2 px mullions and the three
     panes' padding (each pane's base size is its padding): 2.6 / 4.6 of it. */
  --free: calc(100cqw - 4px - 5 * var(--pad) - var(--lead-first));
  --inner: calc(var(--free) * 2.6 / 4.6);
  --lead: var(--pad);
  --stage: calc(var(--inner) - var(--drift-w) - var(--col-gap));
  position: relative;
  z-index: 0;
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--num-h) minmax(0, 1fr) auto;
  row-gap: var(--row-gap);
  padding: var(--pad);
  overflow: hidden;
  isolation: isolate;
  background: var(--ground);
  color: var(--fg);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: flex-grow var(--d-scene) var(--ease-settle);
}

html[data-page="home"] .imprints .deck__item.is-active {
  flex-grow: 2.6;
}

/* The first pane keeps the page gutter on its left, clear of the timecode HUD. */
html[data-page="home"] .imprints .deck__item:first-child {
  --lead: var(--lead-first);
  padding-left: var(--lead-first);
}

/* Each world: its tone (wave, tags, ring), its light from below. */
html[data-page="home"] .imprints .deck__item--feature {
  --tone: #7bd8fd;
  --tone-rgb: 123 216 253;
  --ring: #7bd8fd;
  /* Lilac kept faint at the top-right, under the vermilion 24:60 accent (normal-size
     text): 0.10 holds it ≥ 4.59:1 on the lit night; 0.14 dropped it to 4.4. */
  --glow: radial-gradient(130% 62% at 30% 112%, rgb(123 216 253 / 0.26), rgb(123 216 253 / 0.06) 46%, transparent 72%),
    radial-gradient(70% 40% at 92% -6%, rgb(169 169 255 / 0.1), transparent 70%);
}

html[data-page="home"] .imprints .deck__item--seasons {
  --tone: #bfe3da;
  --tone-rgb: 191 227 218;
  --ring: #e9c452;
  /* Gold kept low near the foot so #BFE3DA tags stay ≥ 4.5:1 on the lit teal. */
  --glow: radial-gradient(130% 62% at 40% 120%, rgb(233 196 82 / 0.14), rgb(233 196 82 / 0.03) 46%, transparent 72%),
    radial-gradient(60% 40% at 96% -4%, rgb(229 166 171 / 0.16), transparent 70%);
}

html[data-page="home"] .imprints .deck__item--originals {
  --stage: var(--inner); /* no drift column: Originals has no releases yet */
  --tone: #a9a9ff;
  --tone-rgb: 169 169 255;
  --ring: #a9a9ff;
  --glow: radial-gradient(130% 62% at 50% 112%, rgb(169 169 255 / 0.3), rgb(169 169 255 / 0.07) 46%, transparent 72%),
    radial-gradient(60% 40% at 6% -6%, rgb(123 216 253 / 0.1), transparent 70%);
}

html[data-page="home"] .imprints .deck__item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--glow);
  opacity: 0.45;
  transition: opacity var(--d-scene) var(--ease-settle);
  pointer-events: none;
}

html[data-page="home"] .imprints .deck__item.is-active::before {
  opacity: 1;
}

/* --- Head: the index numeral (outline) and, on 01, the 24:60 accent ------------ */
html[data-page="home"] .imprints .deck__head {
  grid-row: 1;
  grid-column: 1;
  position: relative;
  display: block;
  min-width: 0;
  height: var(--num-h);
}

html[data-page="home"] .imprints .deck__index {
  display: block;
  width: max-content;
  font-family: var(--f-latin);
  font-size: var(--num);
  font-weight: 900;
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  font-synthesis: none;
  line-height: 0.8;
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 1.2px rgb(var(--bone-rgb) / 0.78);
  white-space: nowrap;
  transition: -webkit-text-stroke-color var(--d-scene) var(--ease-settle), color var(--d-scene) var(--ease-settle);
}

html[data-page="home"] .imprints .deck__item.is-active .deck__index {
  -webkit-text-stroke-color: var(--tone);
}

@supports not (-webkit-text-stroke: 1px black) {
  html[data-page="home"] .imprints .deck__index {
    color: rgb(var(--bone-rgb) / 0.4);
  }
}

html[data-page="home"] .imprints .deck__accent {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--f-latin);
  font-size: clamp(0.9375rem, 1.15vw, 1.25rem);
  font-weight: 800;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--vermilion);
}

html[data-page="home"] .imprints .deck__accent .colon {
  color: inherit;
  animation: rec-blink 2.4s steps(1, end) infinite;
}

/* --- The string: one segment per pane, all at the same height ---------------- */
html[data-page="home"] .imprints .deck__wave {
  position: absolute;
  left: 0;
  top: var(--wave-y);
  z-index: 1;
  display: block;
  width: 100%;
  height: 24px;
  overflow: visible;
  pointer-events: none;
}

html[data-page="home"] .imprints .deck__wave path {
  fill: none;
  stroke: var(--tone);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  stroke-opacity: 0.62;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: stroke-opacity var(--d-scene) var(--ease-settle);
}

html[data-page="home"] .imprints .deck__item.is-active .deck__wave path {
  stroke-opacity: 1;
}

/* Struck: a damped swing through the rest line and back. The string also
   flares — thicker, full ink and a brief glow of its own tone — so the hit
   reads at deck scale, then settles back to the 1.5 px rest. */
html[data-page="home"] .imprints .deck__item.is-struck .deck__wave path {
  animation:
    imprint-strike 900ms cubic-bezier(0.37, 0, 0.63, 1) both,
    imprint-strike-ink 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-page="home"] .imprints .deck__item.is-struck .deck__wave {
  animation: imprint-strike-glow 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes imprint-strike {
  0% { transform: scaleY(1); }
  11% { transform: scaleY(4); }
  30% { transform: scaleY(-2.5); }
  50% { transform: scaleY(1.6); }
  72% { transform: scaleY(-0.8); }
  100% { transform: scaleY(1); }
}

@keyframes imprint-strike-ink {
  0% { stroke-width: 1.5px; stroke-opacity: 1; }
  10% { stroke-width: 3px; stroke-opacity: 1; }
  100% { stroke-width: 1.5px; stroke-opacity: 1; }
}

@keyframes imprint-strike-glow {
  0% { filter: drop-shadow(0 0 0 rgb(var(--tone-rgb) / 0)); }
  12% { filter: drop-shadow(0 0 7px rgb(var(--tone-rgb) / 0.85)); }
  100% { filter: drop-shadow(0 0 0 rgb(var(--tone-rgb) / 0)); }
}

/* --- Folded: the title as a vertical spine --------------------------------------- */
html[data-page="home"] .imprints .deck__vertical {
  position: absolute;
  top: calc(var(--pad) + var(--num-h) + var(--row-gap));
  left: var(--lead);
  z-index: 1;
  max-height: calc(100% - var(--pad) * 2 - var(--num-h) - var(--row-gap));
  /* The spine fills its pane: imprint.js writes --len (the longest line in em)
     and --cols; the size is the smaller of the height fit and the width fit. */
  --spine-h: calc(var(--deck-h) - var(--pad) * 2 - var(--num-h) - var(--row-gap));
  --spine-w: calc((100cqw - 4px - 5 * var(--pad) - var(--lead-first)) / 4.6);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--f-serif);
  font-size: clamp(1.5rem, min(var(--spine-h) / var(--len, 6), var(--spine-w) / (var(--cols, 1) * 1.5)), 4.5rem);
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: 0.12em;
  white-space: nowrap;
  /* Folded worlds speak a little lower than the open one. */
  color: rgb(var(--bone-rgb) / 0.8);
  font-synthesis: none;
  /* Takes over as the closing art dissolves (art gone by ~270 ms, spine ~70 %
     by 250 ms), so a pane is never empty and the two barely overlap. */
  transition: opacity 380ms var(--ease-settle) 150ms;
}

html[data-page="home"] .imprints .deck__item.is-active .deck__vertical {
  opacity: 0;
  transition: opacity 160ms var(--ease-settle);
}

/* Latin titles run sideways in the same serif voice as the CJK spines and the
   open titles (Newsreader, display optical size). */
html[data-page="home"] .imprints .deck__vertical.is-latin {
  text-orientation: sideways;
  font-family: "Newsreader", var(--f-cjk-serif), serif;
  font-size: clamp(1.5rem, min(var(--spine-h) / var(--len, 8), var(--spine-w) / (var(--cols, 1) * 1.16)), 4.5rem);
  font-weight: 400;
  /* Display cut at every size, so the line's length in em never changes. */
  font-optical-sizing: none;
  font-variation-settings: "opsz" 72;
  line-height: 1.06;
  letter-spacing: 0.005em;
}

/* --- Open: the art, centred on the open sheet ------------------------------------ */
/* Art and rings share one grid cell; every in-flow child is pinned to
   column 1, so auto-placement never opens an implicit column. */
html[data-page="home"] .imprints .deck__art {
  grid-row: 2;
  grid-column: 1;
  justify-self: start;
  align-self: stretch;
  position: relative;
  z-index: 1;
  display: block;
  width: var(--stage);
  height: 100%;
  min-height: 0;
  container-type: size;
  opacity: 0;
  /* Closing: the narrowing pane already crops the fixed sheet, so the art
     stays a beat, then dissolves into the spine; the clip snaps shut only once
     it is invisible, so the next opening wipes in again (and a quick re-open
     mid-fade just fades back). */
  clip-path: inset(-60% 100% -60% -10%);
  transition: opacity 200ms var(--ease-in-out) 70ms, clip-path 1ms linear 280ms;
}

/* Opening: a front-loaded wipe from the left — the art is in (~95 %) by
   300 ms, before the accent plays on it. */
html[data-page="home"] .imprints .deck__item.is-active .deck__art {
  opacity: 1;
  clip-path: inset(-60% -10% -60% -10%);
  transition: opacity 220ms var(--ease-settle), clip-path 560ms var(--ease-settle);
}

html[data-page="home"] .imprints .deck__art img,
html[data-page="home"] .imprints .deck__glint {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  max-width: none;
}

/* 01: the square artwork holds its lettering in the middle 46 % band. */
html[data-page="home"] .imprints .deck__item--feature :is(.deck__art img, .deck__glint) {
  width: min(100cqw, 100cqh / 0.5);
  height: auto;
  aspect-ratio: 1;
}

/* 02: 1762 × 608 · 03: 1500 × 400, shown native. */
html[data-page="home"] .imprints .deck__item--seasons .deck__art img {
  width: min(96cqw, 100cqh * 2.4, 620px);
  height: auto;
}

html[data-page="home"] .imprints .deck__item--originals .deck__art img {
  width: min(92cqw, 100cqh * 3.2, 600px);
  height: auto;
}

/* --- Body ------------------------------------------------------------------------ */
html[data-page="home"] .imprints .deck__body {
  grid-row: 3;
  grid-column: 1;
  justify-self: start;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(36em, var(--stage));
  opacity: 0;
  translate: 0 14px;
  transition: opacity 160ms var(--ease-settle), translate 240ms var(--ease-settle);
}

html[data-page="home"] .imprints .deck__item.is-active .deck__body {
  opacity: 1;
  translate: none;
  transition: opacity 520ms var(--ease-settle) 130ms, translate 760ms var(--ease-settle) 100ms;
}

html[data-page="home"] .imprints .deck__title {
  display: block;
  font-family: var(--f-serif);
  font-size: clamp(1.5rem, 2.35vw, 2.625rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-wrap: balance;
  font-synthesis: none;
}

@media (hover: hover) {
  html[data-page="home"] .imprints .deck__item.is-active:hover .deck__title {
    text-decoration: underline 1px var(--tone);
    text-underline-offset: 0.24em;
  }
}

html[data-page="home"]:is([lang="zh-Hans"], [lang="ja-JP"]) .imprints .deck__title,
html[data-page="home"] .imprints .deck__title[lang="ja"] {
  line-height: 1.32;
  letter-spacing: 0.04em;
}

html[data-page="home"] .imprints .deck__text {
  display: block;
  max-width: 34em;
  font-size: clamp(0.9375rem, 0.9rem + 0.18vw, 1.0625rem);
  line-height: 1.62;
  color: var(--fg-2);
  text-wrap: pretty;
}

html[data-page="home"]:is([lang="zh-Hans"], [lang="ja-JP"]) .imprints .deck__text {
  line-height: 1.85;
}

html[data-page="home"] .imprints .deck__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

/* The waveform doubles as a legend: its glyph leads the tags that name the timbre. */
html[data-page="home"] .imprints .deck__tags::before {
  content: "";
  flex: none;
  width: 30px;
  height: 12px;
  margin-right: 14px;
  background: var(--tone);
  -webkit-mask: var(--glyph) center / 100% 100% no-repeat;
  mask: var(--glyph) center / 100% 100% no-repeat;
}

html[data-page="home"] .imprints .deck__item--feature .deck__tags {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 12'%3E%3Cpath d='M0 6L3.75 1.5L11.25 10.5L18.75 1.5L26.25 10.5L30 6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html[data-page="home"] .imprints .deck__item--seasons .deck__tags {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 12'%3E%3Cpath d='M0 6Q3.75 -3 7.5 6T15 6T22.5 6T30 6' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
}

html[data-page="home"] .imprints .deck__item--originals .deck__tags {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 12'%3E%3Cpath d='M0.75 6V1.5H8.25V10.5H15.75V1.5H23.25V10.5H29.25V6' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
}

html[data-page="home"] .imprints .deck__tags .tag {
  color: var(--tone);
  letter-spacing: 0.14em;
}

/* --- Drift: a column of the imprint's real covers at the far edge ---------------- */
html[data-page="home"] .imprints .deck__drift {
  position: absolute;
  top: calc(var(--wave-y) + 40px);
  bottom: 0;
  right: var(--pad);
  z-index: 0;
  width: var(--drift-w);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 78%, transparent);
  transition: opacity 300ms var(--ease-settle);
}

html[data-page="home"] .imprints .deck__item.is-active .deck__drift {
  opacity: 0.12;
  transition: opacity 1100ms var(--ease-settle) 380ms;
}

html[data-page="home"] .imprints .deck__drift-track {
  display: block;
  animation: imprint-drift 60s linear infinite;
  animation-play-state: paused;
}

html[data-page="home"] .imprints.is-live .deck__item.is-active .deck__drift-track {
  animation-play-state: running;
}

html[data-page="home"] .imprints .deck__drift img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin-bottom: 12px;
  border-radius: 4px;
  object-fit: cover;
}

@keyframes imprint-drift {
  to { transform: translate3d(0, -33.3333%, 0); }
}

/* --- Accents (after the strike) -------------------------------------------------- */
/* 01: a glass glint sweeps across the lettering (masked by the artwork itself),
   with a soft sheen of light passing over the glass around it. */
html[data-page="home"] .imprints .deck__glint {
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    102deg,
    transparent 0 41%,
    rgb(123 216 253 / 0.92) 45.5%,
    #ffffff 49.4%,
    #ffffff 50.4%,
    rgb(123 216 253 / 0.92) 54.5%,
    transparent 59% 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  -webkit-mask: url("/assets/imprint-headphone-square.webp") center / contain no-repeat;
  mask: url("/assets/imprint-headphone-square.webp") center / contain no-repeat;
}

html[data-page="home"] .imprints .deck__item--feature .deck__art::after {
  content: "";
  position: absolute;
  inset: 4% -4%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    102deg,
    transparent 0 43%,
    rgb(123 216 253 / 0.12) 47.5%,
    rgb(247 241 243 / 0.16) 50%,
    rgb(123 216 253 / 0.12) 52.5%,
    transparent 57% 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(farthest-side, #000 46%, transparent);
  mask-image: radial-gradient(farthest-side, #000 46%, transparent);
}

/* Accents start at 380 ms: after the strike's first two swings, and once the
   art's wipe has landed (it is ~98 % open by then). */
html[data-page="home"] .imprints .deck__item.is-struck .deck__glint,
html[data-page="home"] .imprints .deck__item.is-struck .deck__art::after {
  animation: imprint-glint 700ms cubic-bezier(0.45, 0, 0.25, 1) 380ms both;
}

/* Left to right, trailing the wipe (background 300 % wide: at 100 % the band
   sits off the left edge, at 0 % off the right). */
@keyframes imprint-glint {
  0% { opacity: 1; background-position: 100% 0; }
  88% { opacity: 1; }
  100% { opacity: 0; background-position: 0 0; }
}

/* 02: three concentric rings from the logo centre. A sibling of the art, on
   the same grid cell, so the art's wipe can never cut them. */
html[data-page="home"] .imprints .deck__rings {
  grid-row: 2;
  grid-column: 1;
  justify-self: start;
  align-self: stretch;
  position: relative;
  z-index: 0; /* under the logo: the rings emerge from behind it */
  display: block;
  width: var(--stage);
  height: 100%;
  min-height: 0;
  container-type: size;
  pointer-events: none;
  transition: opacity 200ms var(--ease-settle);
}

html[data-page="home"] .imprints .deck__item:not(.is-active) .deck__rings {
  opacity: 0;
}

html[data-page="home"] .imprints .deck__rings i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92cqw, 150cqh);
  aspect-ratio: 1;
  border: 2px solid #e9c452;
  border-radius: 50%;
  translate: -50% -50%;
  scale: 0.06;
  opacity: 0;
}

html[data-page="home"] .imprints .deck__rings i:nth-child(2) {
  border-color: #e5a6ab;
}

html[data-page="home"] .imprints .deck__rings i:nth-child(3) {
  border-color: #bfe3da;
}

html[data-page="home"] .imprints .deck__item.is-struck .deck__rings i {
  animation: imprint-ring 900ms cubic-bezier(0.22, 0.7, 0.3, 1) both;
  animation-delay: 380ms;
}

html[data-page="home"] .imprints .deck__item.is-struck .deck__rings i:nth-child(2) {
  animation-delay: 530ms;
}

html[data-page="home"] .imprints .deck__item.is-struck .deck__rings i:nth-child(3) {
  animation-delay: 680ms;
}

@keyframes imprint-ring {
  0% { scale: 0.06; opacity: 0; }
  10% { opacity: 1; }
  55% { opacity: 0.7; }
  100% { scale: 1; opacity: 0; }
}

/* 03: a stepped 2 px jitter of the logo and tags — four held positions over
   480 ms (steps(1) per keyframe = steps(4) across the run). */
html[data-page="home"] .imprints .deck__item--originals.is-struck :is(.deck__art img, .deck__tags) {
  animation: imprint-jitter 480ms steps(1, end) 400ms both;
}

@keyframes imprint-jitter {
  0% { transform: translate(2px, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(1px, -2px); }
  75% { transform: translate(-1px, 2px); }
  100% { transform: none; }
}

/* --- Focus: an inset double ring (the panes abut, so nothing may sit outside) --- */
html[data-page="home"] .imprints .deck__item:focus-visible {
  box-shadow: inset 0 0 0 3px var(--ring);
  outline: 2px solid var(--fg);
  outline-offset: -8px;
  border-radius: 0;
}

/* --- Entrance: the three worlds unroll down from the paper, one after another --
   Top-down, because the deck's top edge is the part in view when it starts;
   front-loaded (ease-settle), so the visible band fills almost at once. */
html[data-page="home"] .imprints .deck.is-armed .deck__item {
  clip-path: inset(0 0 100% 0);
}

html[data-page="home"] .imprints .deck.is-armed.is-open .deck__item {
  clip-path: inset(0 0 0 0);
  transition: flex-grow var(--d-scene) var(--ease-settle), clip-path 1100ms var(--ease-settle);
}

html[data-page="home"] .imprints .deck.is-armed.is-open .deck__item:nth-child(2) {
  transition-delay: 0ms, 90ms;
}

html[data-page="home"] .imprints .deck.is-armed.is-open .deck__item:nth-child(3) {
  transition-delay: 0ms, 180ms;
}

/* --- 901–1100: the shell shows the timecode pill (left) and the INDEX dock
   (right) at the foot of the viewport; the panes keep their text above them. */
@media (min-width: 901px) and (max-width: 1100px) {
  html[data-page="home"] .imprints {
    --foot: 56px;
  }

  html[data-page="home"] .imprints .deck__item {
    padding-bottom: calc(var(--pad) + var(--foot));
  }

  html[data-page="home"] .imprints .deck__vertical {
    --spine-h: calc(var(--deck-h) - var(--pad) * 2 - var(--foot) - var(--num-h) - var(--row-gap));
    max-height: calc(100% - var(--pad) * 2 - var(--foot) - var(--num-h) - var(--row-gap));
  }
}

/* --- ≤900: the panes stack, sized to their content -------------------------------- */
@media (max-width: 900px) {
  /* The legend glyph takes its own line, so it never drags the subtitle's last word down. */
  html[data-page="home"] .imprints .section-head__aside::after {
    display: block;
    margin: 16px 0 0;
  }

  html[data-page="home"] .imprints {
    --pad: clamp(20px, 5vw, 36px);
    --num: clamp(3.25rem, 15vw, 5.5rem);
    --row-gap: clamp(32px, 8vw, 48px);
    --drift-w: clamp(40px, 11vw, 72px);
    --art-h: min(clamp(170px, 54vw, 340px), 46svh);
    --lead-first: var(--pad);
  }

  html[data-page="home"] .imprints .deck {
    container-type: normal;
    flex-direction: column;
    height: auto;
  }

  html[data-page="home"] .imprints .deck__item,
  html[data-page="home"] .imprints .deck__item.is-active {
    flex: none;
    min-height: 72svh;
    grid-template-rows: var(--num-h) minmax(var(--art-h), 1fr) auto;
    transition: none;
  }

  html[data-page="home"] .imprints .deck__item::before {
    opacity: 1;
  }

  html[data-page="home"] .imprints .deck__vertical {
    display: none;
  }

  /* The artwork keeps clear of the drift column (Originals has none: full width). */
  html[data-page="home"] .imprints .deck__art,
  html[data-page="home"] .imprints .deck__item.is-active .deck__art {
    align-self: center;
    width: calc(100% - var(--drift-w) - 10px);
    height: var(--art-h);
    opacity: 1;
    clip-path: none;
    transition: none;
  }

  html[data-page="home"] .imprints .deck__rings {
    align-self: center;
    width: calc(100% - var(--drift-w) - 10px);
    height: var(--art-h);
  }

  html[data-page="home"] .imprints .deck__item--originals .deck__art,
  html[data-page="home"] .imprints .deck__item--originals.is-active .deck__art {
    width: 100%;
  }

  html[data-page="home"] .imprints .deck__body,
  html[data-page="home"] .imprints .deck__item.is-active .deck__body {
    width: 100%;
    opacity: 1;
    translate: none;
    transition: none;
  }

  html[data-page="home"] .imprints .deck__drift {
    top: calc(var(--wave-y) + 36px);
    bottom: auto;
    right: 0;
    height: calc(var(--art-h) + var(--row-gap));
    width: calc(var(--drift-w) + var(--pad) * 0.5);
    padding-right: calc(var(--pad) * 0.5);
  }

  html[data-page="home"] .imprints .deck__index {
    -webkit-text-stroke-color: var(--tone);
  }

  html[data-page="home"] .imprints .deck__wave path {
    stroke-opacity: 1;
  }

  html[data-page="home"] .imprints .deck.is-armed .deck__item {
    clip-path: none;
  }
}

/* --- Reduced motion and the low tier ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html[data-page="home"] .imprints .deck__item,
  html[data-page="home"] .imprints .deck__item :is(.deck__art, .deck__body, .deck__vertical, .deck__drift, .deck__index, .deck__wave path),
  html[data-page="home"] .imprints .deck__item::before {
    transition: none !important;
  }
  html[data-page="home"] .imprints .deck__item :is(.deck__wave, .deck__wave path, .deck__glint, .deck__rings i, .deck__art img, .deck__tags, .deck__drift-track),
  html[data-page="home"] .imprints .deck__art::after,
  html[data-page="home"] .imprints .deck__accent .colon {
    animation: none !important;
  }
  html[data-page="home"] .imprints .deck.is-armed .deck__item {
    clip-path: none;
  }
}

@media (prefers-reduced-motion: reduce) and (min-width: 901px) {
  /* The open pane is marked without motion. */
  html[data-page="home"] .imprints .deck__item.is-active::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border: 2px solid var(--tone);
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 900px) {
  html[data-page="home"] .imprints .deck__drift {
    opacity: 0.12;
  }
}

html[data-page="home"][data-tier="low"] .imprints .deck__item,
html[data-page="home"][data-tier="low"] .imprints .deck__item :is(.deck__art, .deck__body, .deck__vertical, .deck__drift, .deck__index, .deck__wave path),
html[data-page="home"][data-tier="low"] .imprints .deck__item::before {
  transition: none !important;
}

html[data-page="home"][data-tier="low"] .imprints .deck__item :is(.deck__wave, .deck__wave path, .deck__glint, .deck__rings i, .deck__art img, .deck__tags, .deck__drift-track),
html[data-page="home"][data-tier="low"] .imprints .deck__art::after {
  animation: none !important;
}

html[data-page="home"][data-tier="low"] .imprints .deck.is-armed .deck__item {
  clip-path: none;
}
