/* THE ARCHIVE — /abyss/archive/. Every WATERJON release as a physical CD in a clear jewel case.
   Scoped to .ar-page / .ar / .jc / .ar-dialog so nothing leaks into the main site.
   The case is pure CSS 3D (no WebGL); the water behind it is a small shader in water.js. */

@font-face {
  font-family: "Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

.ar-html { background: #0d1520; scrollbar-gutter: stable; }   /* no layout jump when the dialog locks scrolling */
.ar-page {
  --a-navy: #0d1520; --a-teal: #1a3a4a; --a-chrome: #8ba8c4; --a-green: #00ff66; --a-black: #05090d;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* the shader paints over this; it stays as the look when WebGL is off */
  background:
    radial-gradient(90% 55% at 50% -8%, rgba(60, 120, 140, 0.32) 0%, rgba(26, 58, 74, 0.18) 38%, rgba(13, 21, 32, 0) 72%),
    linear-gradient(180deg, #13283a 0%, #0d1520 46%, #070c12 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
.ar-page.has-water { background: transparent; }
.ar-water { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; display: block; pointer-events: none; opacity: 0; transition: opacity 1.6s ease; }
.ar-page.has-water .ar-water { opacity: 1; }
.ar-page .site-footer { background: rgba(5, 9, 13, 0.72); }

/* ---------- Site header: the WATERJON logo is the hero, the site nav sits under it ---------- */
.ar-site-header {
  background: none; border-bottom: 0; gap: clamp(8px, 1.4vw, 14px);
  padding-top: max(clamp(20px, 2.6vw, 32px), env(safe-area-inset-top) + 12px); padding-bottom: 0;
}
.ar-brand img {
  width: clamp(240px, min(26vw, 50vh), 440px);
  filter: drop-shadow(0 0 26px rgba(84, 230, 222, 0.14)) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
}
.ar-site-header .nav-list a { opacity: 0.86; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7); }
.ar-site-header .nav-list a:hover, .ar-site-header .nav-list a[aria-current="page"] { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .ar-brand img { animation: ar-logo-in 1.4s var(--ease) both; }
  .ar-site-header .site-nav { animation: ar-logo-in 1.4s var(--ease) 0.15s both; }
  @keyframes ar-logo-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
}

/* ---------- Archive header ---------- */
.ar-head { background: none; border-bottom: 0; padding-top: clamp(10px, 1.8vw, 20px); padding-bottom: 4px; }
.ar-head::after { display: none; }
.ar-kicker { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 20px; margin: 0; }
.ar-kicker .abyss-sys, .ar-kicker .abyss-station { margin: 0; }
.ar-head .abyss-title { margin-top: 10px; }
.ar-title { font-size: clamp(1.75rem, 4.6vw, 3rem); }
.ar-exit { margin: clamp(36px, 5vw, 56px) 0 0; text-align: center; }
.ar-exit .abyss-return { margin: 0 auto; }
.ar-exit .abyss-return svg { transform: none; }
.ar-sub {
  margin: 14px auto 0; font-family: var(--mono); font-size: clamp(0.66rem, 1.1vw, 0.76rem);
  letter-spacing: 0.32em; margin-right: -0.32em; text-transform: uppercase; color: var(--a-chrome);
}

/* ---------- Collection ---------- */
.ar { position: relative; padding: 6px 0 clamp(56px, 8vw, 96px); }
.ar-hud {
  display: flex; justify-content: space-between; gap: 16px; max-width: 980px; margin: 0 auto;
  padding: 0 var(--gutter); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(139, 168, 196, 0.85);
}
.ar-hud b { font-weight: 500; color: var(--a-green); }

.ar-stage { --w: clamp(250px, min(33vw, 48vh), 460px); position: relative; margin-top: 4px; }
.ar-track {
  --slot: calc(var(--w) * 0.58);
  display: flex; align-items: center; list-style: none; margin: 0;
  height: calc(var(--w) * 0.88 + 96px);
  padding: 0 calc(50% - var(--w) / 2);   /* each slot is a full case wide (the case sets its min width) */
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ar-track::-webkit-scrollbar { display: none; }
.ar-track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.ar-item { flex: 0 0 var(--slot); height: 100%; scroll-snap-align: center; position: relative; display: grid; place-items: center; }
.ar-pick {
  position: relative; display: grid; place-items: center; width: var(--w); height: calc(var(--w) * 0.88);
  margin: 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transform-style: preserve-3d; will-change: transform;
}
.ar-pick:focus-visible { outline: none; }
.ar-pick:focus-visible .jc-lid-out { box-shadow: inset 0 0 0 2px var(--a-green), 0 0 0 3px rgba(0, 255, 102, 0.25); }
/* pool of light under each case */
.ar-pick::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: calc(var(--w) * -0.1); height: calc(var(--w) * 0.12);
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 70%);
  transform: translateZ(-60px); pointer-events: none;
}
.ar-item.is-current .ar-pick::after {
  background: radial-gradient(50% 50% at 50% 50%, rgba(84, 200, 210, 0.16), rgba(0, 0, 0, 0.4) 45%, rgba(0, 0, 0, 0) 72%);
}

.ar-nav {
  position: absolute; top: 50%; z-index: 200; width: 48px; height: 48px; margin-top: -24px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(139, 168, 196, 0.35); background: rgba(5, 9, 13, 0.55); color: #d8f7f2;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
.ar-nav svg { width: 16px; height: 16px; fill: currentColor; }
.ar-nav--prev { left: max(12px, calc(50% - var(--w) * 0.5 - 92px)); }
.ar-nav--prev svg { transform: rotate(180deg); }
.ar-nav--next { right: max(12px, calc(50% - var(--w) * 0.5 - 92px)); }
.ar-nav:hover { border-color: var(--a-green); color: var(--a-green); }
.ar-nav:focus-visible { outline: 2px solid var(--a-green); outline-offset: 3px; }
.ar-nav[disabled] { opacity: 0.25; cursor: default; }

.ar-hint {
  margin: 0; text-align: center; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(139, 168, 196, 0.8);
}
.ar-hint-touch { display: none; }
@media (hover: none), (pointer: coarse) { .ar-hint-fine { display: none; } .ar-hint-touch { display: inline; } }

/* ---------- Release panel ---------- */
.ar-info { max-width: 620px; margin: clamp(22px, 3vw, 34px) auto 0; padding: 0 var(--gutter); text-align: center; }
.ar-info-kicker, .ar-d-kicker {
  margin: 0 0 10px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--a-green);
}
.ar-info-title, .ar-d-title {
  margin: 0; font-stretch: 125%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.05; color: #e4f6f8; overflow-wrap: anywhere;
}
.ar-info-credits, .ar-d-credits { margin: 10px 0 0; color: var(--a-chrome); font-size: 0.95rem; line-height: 1.5; }
.ar-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.ar-actions .btn { min-height: 48px; }
.ar-listen svg { width: 1.25em; height: 1.25em; }
.ar-preview svg { width: 0.9em; height: 0.9em; }
.ar-preview[aria-expanded="true"] { border-color: var(--a-green); color: var(--a-green); }
.ar-player:empty { display: none; }
.ar-player { margin-top: 16px; }
.ar-player iframe { display: block; width: 100%; border: 0; border-radius: 12px; background: #111; }
.ar-player-cap { margin: 0 0 8px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--a-green); }
.ar-next-link {
  margin-top: 18px; padding: 10px 4px; border: 0; background: none; cursor: pointer; color: var(--a-chrome);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
}
.ar-next-link:hover, .ar-next-link:focus-visible { color: var(--a-green); }

/* no-JS: a plain list instead of the cases */
.ar-fallback { display: none; }
@media (scripting: none) {
  .ar-stage, .ar-hint, .ar-info, .ar-hud { display: none; }
  .ar-fallback {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px;
    max-width: 980px; margin: 24px auto 0; padding: 0 var(--gutter); list-style: none; text-align: left;
  }
  .ar-fallback a { color: #d8f7f2; text-decoration: none; display: grid; gap: 6px; }
  .ar-fallback img { width: 100%; height: auto; }
  .ar-fb-meta { color: var(--a-chrome); font-size: 0.8rem; }
}

/* ---------- The jewel case ----------
   Proportions of a real case: 142 x 125 x 10.4 mm. --w is the case width; everything scales from it.
   Faces: tray (black), disc (artwork), clear lid (stickers, glare, wear), back card, spine, clear edges. */
.jc {
  --h: calc(var(--w) * 0.8803);
  --d: calc(var(--w) * 0.0732);
  --disc: calc(var(--h) * 0.9);
  --rx: 0deg; --ry: 0deg; --lid: 0deg; --lift: 0px; --spin: 0deg;
  --mx: 0.5; --my: 0.4; --shade: 0;
  position: relative; width: var(--w); height: var(--h);
  transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry));
  pointer-events: none;   /* the faces never catch input; the button / stage around them does */
  font-family: var(--mono); text-transform: uppercase; color: #dfe9ef;
}
.jc * { box-sizing: border-box; }
.jc-face { position: absolute; left: 0; top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }

/* tray: the black plastic the disc sits on */
.jc-tray {
  width: var(--w); height: var(--h); transform: translateZ(calc(var(--d) * -0.4));
  border-radius: calc(var(--w) * 0.008);
  background:
    radial-gradient(60% 60% at 52% 50%, #10171d 0%, #070b0f 70%),
    #06090c;
  box-shadow: inset 0 0 0 1px rgba(139, 168, 196, 0.16);
}
/* moulded tray details: disc well, finger notches, ribs at the hinge */
.jc-tray::before {
  content: ""; position: absolute; top: 3.2%; bottom: 3.2%; left: 6.5%; right: 2.8%;
  border: 1px solid rgba(139, 168, 196, 0.14); border-radius: calc(var(--w) * 0.012);
}
.jc-tray::after {
  content: ""; position: absolute; left: 50.5%; top: 0; width: 6%; height: 100%; transform: translateX(-50%);
  background:
    linear-gradient(rgba(139, 168, 196, 0.16), rgba(139, 168, 196, 0.16)) top / 100% 1.6% no-repeat,
    linear-gradient(rgba(139, 168, 196, 0.16), rgba(139, 168, 196, 0.16)) bottom / 100% 1.6% no-repeat;
}
.jc-rosette {
  position: absolute; width: calc(var(--disc) * 0.27); aspect-ratio: 1; border-radius: 50%;
  left: calc(var(--w) * 0.525); top: 50%; transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, #cfd9df 0 16%, #8796a0 18%, #2a343b 22%, rgba(0, 0, 0, 0) 23%),
    repeating-conic-gradient(from 8deg, rgba(205, 220, 228, 0.65) 0deg 7deg, rgba(0, 0, 0, 0) 7deg 36deg),
    radial-gradient(circle, #1a2228 0 60%, #0c1115 100%);
  -webkit-mask: radial-gradient(circle, #000 0 23%, rgba(0, 0, 0, 0) 23.5% 42%, #000 42.5% 100%);
          mask: radial-gradient(circle, #000 0 23%, rgba(0, 0, 0, 0) 23.5% 42%, #000 42.5% 100%);
  box-shadow: inset 0 0 0 2px rgba(210, 225, 232, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.8);
}

/* the disc: artwork printed edge to edge, clear hub punched out */
.jc-disc {
  position: absolute; width: var(--disc); height: var(--disc);
  left: calc(var(--w) * 0.525 - var(--disc) / 2); top: calc((var(--h) - var(--disc)) / 2);
  transform: translateZ(calc(var(--d) * -0.12 + var(--lift))) rotate(var(--spin));
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.jc-disc-print {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #0b1218;
  -webkit-mask: radial-gradient(circle, rgba(0, 0, 0, 0) 0 16.4%, #000 16.7%);
          mask: radial-gradient(circle, rgba(0, 0, 0, 0) 0 16.4%, #000 16.7%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
}
.jc-disc-print img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* lacquer: outer clear rim, faint iridescence that turns with the light, mirror band at the hub */
.jc-disc-print::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 48.6%, rgba(210, 232, 240, 0.32) 49.1%, rgba(255, 255, 255, 0.06) 49.6%, rgba(0, 0, 0, 0) 50%),
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 16.8%, rgba(200, 215, 225, 0.55) 17.2%, rgba(120, 140, 150, 0.25) 18.4%, rgba(0, 0, 0, 0) 19.2%),
    conic-gradient(from calc(var(--mx) * 220deg - 40deg), rgba(255, 255, 255, 0) 0deg, rgba(140, 255, 220, 0.10) 40deg, rgba(160, 190, 255, 0.12) 70deg, rgba(255, 255, 255, 0) 110deg, rgba(255, 255, 255, 0) 180deg, rgba(120, 220, 255, 0.08) 230deg, rgba(255, 255, 255, 0) 280deg);
  mix-blend-mode: screen;
}
.jc-hub {
  position: absolute; left: 50%; top: 50%; width: 33.4%; height: 33.4%; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 37.4%, rgba(220, 235, 242, 0.55) 37.8%, rgba(190, 210, 222, 0.10) 40%, rgba(190, 210, 222, 0.04) 78%, rgba(210, 228, 236, 0.22) 96%, rgba(0, 0, 0, 0) 100%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0) 1px 4px);
  box-shadow: inset 0 0 calc(var(--w) * 0.01) rgba(255, 255, 255, 0.08);
}

/* back card, spine and clear edges (only drawn when the case is fully 3D) */
.jc-back {
  width: var(--w); height: var(--h); transform: translateZ(calc(var(--d) / -2)) rotateY(180deg);
  padding: 7% 8% 6% 9%; display: flex; flex-direction: column;
  background:
    linear-gradient(160deg, rgba(26, 58, 74, 0.55), rgba(13, 21, 32, 0) 55%),
    #0a1118;
  box-shadow: inset 0 0 0 1px rgba(139, 168, 196, 0.2);
  font-size: calc(var(--w) * 0.024); letter-spacing: 0.08em; line-height: 1.55;
}
.jc-back-top { display: flex; align-items: center; justify-content: space-between; gap: 8%; opacity: 0.9; }
.jc-back-top img:first-child { height: calc(var(--w) * 0.045); width: auto; }
.jc-back-top img:last-child { height: calc(var(--w) * 0.06); width: auto; }
.jc-back-title {
  margin: 9% 0 0; font-family: var(--font); font-stretch: 125%; font-weight: 800; letter-spacing: 0.04em;
  font-size: calc(var(--w) * 0.062); line-height: 1.02; color: #eef8fa; overflow-wrap: anywhere;
}
.jc-back-credits { margin: 2.5% 0 0; color: var(--a-chrome); text-transform: none; letter-spacing: 0.04em; }
.jc-back-tracks { list-style: none; margin: 5% 0 0; padding: 0; color: #cad8e0; overflow: hidden; flex: 1 1 auto; min-height: 0; }
.jc-back-tracks li { display: flex; gap: 0.8em; white-space: nowrap; }
.jc-back-tracks li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.jc-back-tracks li span:first-child, .jc-back-tracks li span:last-child { color: rgba(139, 168, 196, 0.85); }
.jc-back-base { display: flex; align-items: flex-end; justify-content: space-between; gap: 6%; margin-top: 4%; color: var(--a-chrome); }
.jc-back-base .jc-bars { width: 30%; height: calc(var(--w) * 0.06); background: #e7ebeb; padding: 2% 3%; }

.jc-spine {
  width: var(--d); height: var(--h); transform-origin: 0 50%;
  transform: translateZ(calc(var(--d) / -2)) rotateY(-90deg);
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(90deg, #0b1218, #111b23 50%, #0b1218);
  box-shadow: inset 0 0 0 1px rgba(139, 168, 196, 0.22);
}
.jc-spine span {
  writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap;
  font-size: calc(var(--d) * 0.4); letter-spacing: 0.2em; color: #c9d7df;
}
.jc-spine b { font-weight: 500; color: var(--a-green); }
.jc-edge { background: linear-gradient(180deg, rgba(200, 222, 234, 0.30), rgba(160, 190, 205, 0.10)); box-shadow: inset 0 0 0 1px rgba(210, 230, 240, 0.25); }
.jc-edge--r { left: calc(var(--w) - var(--d)); width: var(--d); height: var(--h); transform-origin: 100% 50%; transform: translateZ(calc(var(--d) / -2)) rotateY(90deg); }
.jc-edge--t { width: var(--w); height: var(--d); transform-origin: 50% 0; transform: translateZ(calc(var(--d) / -2)) rotateX(90deg); }
.jc-edge--b { top: calc(var(--h) - var(--d)); width: var(--w); height: var(--d); transform-origin: 50% 100%; transform: translateZ(calc(var(--d) / -2)) rotateX(-90deg); }

/* clear lid, hinged on the left */
.jc-lid {
  position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d;
  transform: translateZ(calc(var(--d) / 2)) rotateY(var(--lid));
  transition: transform 0.95s cubic-bezier(0.25, 0.75, 0.15, 1);
}
.jc-lid-out, .jc-lid-in { position: absolute; inset: 0; border-radius: calc(var(--w) * 0.01); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.jc-lid-out {
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(215, 235, 245, 0.10) 0%, rgba(215, 235, 245, 0.025) 35%, rgba(215, 235, 245, 0.015) 70%, rgba(215, 235, 245, 0.06) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(215, 235, 245, 0.42),
    inset 0 0 0 calc(var(--w) * 0.011) rgba(215, 235, 245, 0.05),
    inset calc(var(--w) * 0.012) calc(var(--w) * 0.012) 0 calc(var(--w) * -0.004) rgba(255, 255, 255, 0.05);
}
/* glare that follows the pointer */
.jc-lid-out::before {
  content: ""; position: absolute; inset: -2%; pointer-events: none;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0) 32%, rgba(235, 250, 255, 0.17) 43%, rgba(235, 250, 255, 0.05) 48%, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, 0) 60%, rgba(235, 250, 255, 0.07) 64%, rgba(255, 255, 255, 0) 68%);
  background-size: 260% 100%; background-position: calc(100% - var(--mx) * 100%) 0;
  mix-blend-mode: screen;
}
/* handling wear: micro-scratches and dust (procedurally drawn texture) */
.jc-lid-out::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background: url("/assets/abyss/archive/wear.webp") 0 0 / calc(var(--w) * 0.62) auto;
  mix-blend-mode: screen;
}
.jc-hinge {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4.2%;
  background: repeating-linear-gradient(90deg, rgba(215, 235, 245, 0.12) 0 1px, rgba(0, 0, 0, 0) 1px 3px), rgba(215, 235, 245, 0.04);
  box-shadow: inset -1px 0 0 rgba(215, 235, 245, 0.3);
}
.jc-shade { position: absolute; inset: 0; background: rgba(5, 9, 13, 1); opacity: var(--shade); pointer-events: none; transition: opacity 0.2s linear; }
.jc-lid-in {
  transform: rotateY(180deg);
  background: linear-gradient(200deg, rgba(215, 235, 245, 0.08), rgba(215, 235, 245, 0.02) 50%, rgba(215, 235, 245, 0.05));
  box-shadow: inset 0 0 0 1px rgba(215, 235, 245, 0.35);
}
.jc-lid-in::before, .jc-lid-in::after { content: ""; position: absolute; top: 5.5%; height: 15%; background: rgba(226, 230, 230, 0.75); }
.jc-lid-in::before { right: 7%; width: 30%; }          /* back of the barcode sticker, mirrored */
.jc-lid-in::after { left: 5.5%; width: 31%; height: 16%; background: rgba(10, 14, 18, 0.85); }

/* stickers */
.jc-barcode {
  position: absolute; left: 7%; top: 5.5%; width: 30%; padding: 2.2% 2.4% 1.8%;
  background: linear-gradient(170deg, #eef0ef, #dfe3e2 70%, #d3d8d7);
  border-radius: 1.5%; transform: rotate(-0.8deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  color: #111; font-size: calc(var(--w) * 0.022); letter-spacing: 0.12em; line-height: 1;
}
.jc-bars { display: block; width: 100%; height: calc(var(--w) * 0.058); }
.jc-barcode-t { display: flex; justify-content: space-between; margin-top: 6%; white-space: nowrap; }
.jc-barcode-t b, .jc-label-t b { font-weight: 500; }
.jc-label {
  position: absolute; right: 5.5%; top: 5.5%; width: 31%; padding: 2.6% 3% 2.4%;
  background: linear-gradient(170deg, #12181d, #07090b); border-radius: calc(var(--w) * 0.012);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(215, 235, 245, 0.16);
  font-size: calc(var(--w) * 0.021); letter-spacing: 0.14em; line-height: 1; color: #dbe6ec;
}
.jc-label-row { display: flex; align-items: center; justify-content: space-between; gap: 6%; }
.jc-label-row img:first-child { width: 70%; height: auto; }
.jc-label-row img:last-child { height: calc(var(--w) * 0.05); width: auto; }
.jc-label-t { display: block; margin-top: 8%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-mark { position: absolute; right: 4.6%; bottom: 5.2%; height: 7.5%; width: auto; opacity: 0.72; }

/* open: lid swings out on its hinge, the disc lifts and turns once */
.jc.is-open { --lid: -104deg; --lift: calc(var(--d) * 1.6); --spin: 200deg; }

/* flat mode for cases far from the centre: no 3D faces, cheaper to draw */
.jc--flat { transform-style: flat; }
.jc--flat .jc-back, .jc--flat .jc-spine, .jc--flat .jc-edge, .jc--flat .jc-lid-in { display: none; }

/* ---------- Inspect ---------- */
.ar-dialog {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(5, 9, 13, 0.80); color: #dfe9ef; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
}
.ar-dialog::backdrop { background: rgba(5, 9, 13, 0.55); backdrop-filter: blur(3px); }
.ar-dialog[open] { display: block; }
.ar-d-wrap {
  min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto; grid-template-areas: "top top" "stage info" "controls info";
  gap: 0 clamp(24px, 4vw, 56px); padding: max(18px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
  max-width: 1280px; margin: 0 auto;
}
.ar-d-top { grid-area: top; display: flex; justify-content: space-between; align-items: center; }
.ar-d-kicker { margin: 0; }
.ar-d-close {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(139, 168, 196, 0.35); background: rgba(5, 9, 13, 0.6); color: #d8f7f2;
}
.ar-d-close svg { width: 16px; height: 16px; fill: currentColor; }
.ar-d-close:hover, .ar-d-close:focus-visible { border-color: var(--a-green); color: var(--a-green); outline: none; }
.ar-d-stage {
  grid-area: stage; position: relative; display: grid; place-items: center; min-height: 0;
  perspective: 1500px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.ar-d-stage.is-grabbing { cursor: grabbing; }
.ar-d-case { --w: min(560px, 44vw, 62vh); display: grid; place-items: center; transform-style: preserve-3d; }
.ar-d-case:focus-visible { outline: none; }
.ar-d-case:focus-visible .jc-lid-out { box-shadow: inset 0 0 0 2px var(--a-green); }
.ar-d-hint { position: absolute; bottom: 4px; margin: 0; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; color: #8ba8c4; }
.ar-d-controls { grid-area: controls; position: relative; z-index: 5; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 12px; }
.ar-d-top, .ar-d-info { position: relative; z-index: 5; }
.ar-chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(139, 168, 196, 0.35); background: rgba(5, 9, 13, 0.5); color: #d8f7f2;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.ar-chip:hover, .ar-chip:focus-visible { border-color: #d8f7f2; outline: none; }
.ar-chip[aria-pressed="true"] { border-color: var(--a-green); color: var(--a-green); }
.ar-chip[disabled] { opacity: 0.3; cursor: default; }
.ar-d-info { grid-area: info; align-self: center; padding: 24px 0; text-align: left; }
.ar-d-info .ar-actions { justify-content: flex-start; }
.ar-d-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 22px 0 0; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ar-d-meta dt { color: rgba(139, 168, 196, 0.85); }
.ar-d-meta dd { margin: 0; color: #dfe9ef; }
.ar-d-tracks { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid rgba(139, 168, 196, 0.18); list-style: none; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; color: #cad8e0; max-height: 210px; overflow: auto; }
.ar-d-tracks li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 8px; padding: 3px 0; }
.ar-d-tracks li span:first-child, .ar-d-tracks li span:last-child { color: rgba(139, 168, 196, 0.85); }
.ar-d-tracks li small { display: block; color: rgba(139, 168, 196, 0.75); font-size: 0.92em; }
.ar-d-step { display: flex; gap: 8px; margin-top: 20px; }

@media (max-width: 860px) {
  .ar-d-wrap { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; grid-template-areas: "top" "stage" "controls" "info"; }
  .ar-d-stage { height: min(56vh, 92vw); }
  .ar-d-case { --w: min(84vw, 48vh, 460px); }
  .ar-d-info { text-align: center; padding-top: 20px; }
  .ar-d-info .ar-actions, .ar-d-step { justify-content: center; }
  .ar-d-meta { justify-content: center; text-align: left; }
  .ar-d-tracks { text-align: left; }
}
@media (max-width: 760px) {
  .ar-brand img { width: min(74vw, 340px); }
  .ar-sub { letter-spacing: 0.2em; margin-right: -0.2em; }
  .ar-stage { --w: min(74vw, 340px); }
  .ar-track { --slot: calc(var(--w) * 0.9); height: calc(var(--w) * 0.88 + 64px); }
  .ar-nav { display: none; }
  .ar-actions .btn { flex: 1 1 40%; justify-content: center; }
  .ar-actions .ar-listen { flex-basis: 100%; }
}
@media (max-width: 380px) { .ar-title { font-size: 7vw; } .ar-hud { font-size: 0.62rem; letter-spacing: 0.12em; } }

/* ---------- Presenting a case (see present() in archive.js) ----------
   The case's own flight is scripted; this is the room around it: the water dims in, a sonar ping
   rings out as the case lands, and the details rise in one line at a time. */
@keyframes ar-dim { from { background-color: rgba(5, 9, 13, 0); } }
@keyframes ar-fade-in { from { opacity: 0; } }
@keyframes ar-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes ar-ping {
  0% { opacity: 0.75; transform: translate(-50%, -50%) scale(0.75); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}
/* two sonar rings on a fixed, screen-clipped layer behind the case (centred on it by present()),
   so they can grow past the case without making the dialog scroll sideways */
.ar-d-ping { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ar-d-wrap { position: relative; z-index: 1; }
.ar-d-ping::before, .ar-d-ping::after {
  content: ""; position: absolute; left: var(--px, 50%); top: var(--py, 40%); width: var(--pw, 560px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(0, 255, 102, 0.5); box-shadow: 0 0 50px rgba(0, 255, 102, 0.14), inset 0 0 50px rgba(0, 255, 102, 0.08);
  opacity: 0; transform: translate(-50%, -50%);
}
.ar-d-ping::after { border-color: rgba(139, 168, 196, 0.4); box-shadow: none; }
.ar-dialog.is-presenting { animation: ar-dim 0.45s ease both; }
.ar-dialog.is-presenting::backdrop { animation: ar-fade-in 0.45s ease both; }
.ar-dialog.is-presenting .ar-d-top { animation: ar-fade-in 0.4s 0.25s both; }
/* forwards, not both: the rings must stay invisible until the case lands */
.ar-dialog.is-presenting .ar-d-ping::before { animation: ar-ping 1.5s 1.12s cubic-bezier(0.15, 0.6, 0.3, 1) forwards; }
.ar-dialog.is-presenting .ar-d-ping::after { animation: ar-ping 1.5s 1.42s cubic-bezier(0.15, 0.6, 0.3, 1) forwards; }
.ar-dialog.is-presenting .ar-d-info > * { animation: ar-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s both; }
.ar-dialog.is-presenting .ar-d-info > :nth-child(2) { animation-delay: 0.58s; }
.ar-dialog.is-presenting .ar-d-info > :nth-child(3) { animation-delay: 0.66s; }
.ar-dialog.is-presenting .ar-d-info > :nth-child(4) { animation-delay: 0.74s; }
.ar-dialog.is-presenting .ar-d-info > :nth-child(5) { animation-delay: 0.82s; }
.ar-dialog.is-presenting .ar-d-info > :nth-child(6) { animation-delay: 0.9s; }
.ar-dialog.is-presenting .ar-d-info > :nth-child(n+7) { animation-delay: 0.98s; }
.ar-dialog.is-presenting .ar-d-controls, .ar-dialog.is-presenting .ar-d-hint { animation: ar-fade-in 0.5s 1s both; }
/* leaving: the room fades back to the shelf while the case flies home */
.ar-dialog { transition: background-color 0.45s ease; }
.ar-dialog.is-leaving { background-color: rgba(5, 9, 13, 0); pointer-events: none; }
.ar-dialog.is-leaving::backdrop { opacity: 0; transition: opacity 0.4s ease; }
.ar-dialog.is-leaving .ar-d-top, .ar-dialog.is-leaving .ar-d-info, .ar-dialog.is-leaving .ar-d-controls, .ar-dialog.is-leaving .ar-d-hint { opacity: 0; transition: opacity 0.2s ease; }

@media (prefers-reduced-motion: reduce) {
  .ar-dialog, .ar-dialog * { animation: none !important; }
  .jc-lid, .jc-disc, .ar-water, .jc-shade { transition: none; }
  .jc.is-open { --spin: 0deg; }
}
