/* Discos — cover gallery */

:root {
  --bg: #08090c;
  --ink: #f2f4f8;
  --muted: #9aa1ae;
  --line: rgba(255, 255, 255, 0.10);
  --panel: rgba(18, 20, 26, 0.72);
  --accent: #8a8f98;
  --shade: #1b1d22;
  --bar-h: 64px;
  --gap: clamp(14px, 1.6vw, 26px);
  --pad: clamp(16px, 3vw, 44px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* The display rules below must not defeat the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection { background: var(--accent); color: #05060a; }

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

/* Covers show keyboard focus with the lift and the glow, not with an outline. */
.card__hit:focus,
.card__hit:focus-visible {
  outline: none;
}

/* ------------------------------------------------------------------ ambient */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg);
}

.ambient__layer {
  position: absolute;
  inset: -20%;
  opacity: 0;
  transition: opacity 900ms var(--ease);
  background:
    radial-gradient(60% 55% at 18% 12%, var(--c1, #2a2f3a) 0%, transparent 62%),
    radial-gradient(55% 60% at 84% 78%, var(--c2, #1a1f2b) 0%, transparent 66%),
    radial-gradient(90% 90% at 50% 120%, var(--c3, #101319) 0%, transparent 70%);
  filter: saturate(1.25) blur(30px);
}

.ambient__layer.is-on { opacity: 0.55; }

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* ---------------------------------------------------------------------- bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: var(--bar-h);
  padding: 10px var(--pad);
  background: linear-gradient(to bottom, rgba(8, 9, 12, 0.92), rgba(8, 9, 12, 0.55) 70%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  flex: none;
}

.brand__mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #08090c 0 16%, transparent 17%),
    conic-gradient(from 0deg, var(--accent), #ffffff 35%, var(--accent) 60%, #4b5160 100%);
  animation: spin 9s linear infinite;
  box-shadow: 0 0 18px -4px var(--accent);
}

@keyframes spin { to { transform: rotate(1turn); } }

.brand__text {
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
}

.brand__count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 8px;
}

.bar__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 200ms, box-shadow 200ms, background 200ms;
}

.search:focus-within {
  border-color: color-mix(in oklab, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent);
  background: rgba(255, 255, 255, 0.07);
}

.search svg { color: var(--muted); flex: none; }

.search input {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  width: clamp(110px, 18vw, 200px);
  outline: none;
}

.search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.5; }

.search kbd {
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 5px;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  gap: 2px;
}

.segmented button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: var(--muted);
  font: 500 12px/1 inherit;
  cursor: pointer;
  transition: color 180ms, background 180ms;
}

.segmented button:hover { color: var(--ink); }

.segmented button.is-active {
  color: #05060a;
  background: var(--ink);
}

.segmented button span { display: none; }

@media (min-width: 900px) {
  .segmented button span { display: inline; }
}

.select {
  position: relative;
  display: flex;
  align-items: center;
}

.select select {
  appearance: none;
  height: 36px;
  padding: 0 30px 0 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: 500 12px/1 inherit;
  cursor: pointer;
}

.select::after {
  content: "";
  position: absolute;
  right: 13px;
  width: 6px;
  height: 6px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}

.select select option { background: #12141a; color: var(--ink); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 180ms, border-color 180ms, transform 180ms var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: color-mix(in oklab, var(--accent) 50%, transparent);
  transform: translateY(-1px);
}

.icon-btn.is-on {
  background: var(--ink);
  color: #05060a;
}

/* -------------------------------------------------------------------- stage */

.stage {
  position: relative;
  z-index: 1;
  padding: var(--pad);
  padding-top: clamp(18px, 3vw, 34px);
}

.empty,
.no-results {
  text-align: center;
  color: var(--muted);
  padding: 18vh 0;
}

.empty code {
  font: 500 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255, 255, 255, 0.07);
  padding: 3px 6px;
  border-radius: 5px;
}

/* --------------------------------------------------------------- grid views */

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
}

.stage[data-view="wall"] .grid {
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 45vw), 1fr));
  grid-auto-flow: dense;
  gap: calc(var(--gap) * 0.6);
}

.stage[data-view="wall"] .card.is-big {
  grid-column: span 2;
  grid-row: span 2;
}

.stage[data-view="wall"] .card__meta {
  opacity: 0;
  transform: translateY(6px);
}

.stage[data-view="wall"] .card:hover .card__meta,
.stage[data-view="wall"] .card:focus-within .card__meta {
  opacity: 1;
  transform: none;
}

.card {
  --lift: 0px;
  position: relative;
  perspective: 1100px;
  animation: rise 620ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
}

.card.is-hidden { display: none; }

.card__hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.card__frame {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--shade);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 14px 30px -18px rgba(0, 0, 0, 0.9);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift)) scale(var(--scale, 1));
  transform-style: preserve-3d;
  transition: transform 420ms var(--ease), box-shadow 420ms var(--ease);
}

.card:hover .card__frame,
.card:focus-within .card__frame {
  --lift: -6px;
  --scale: 1.02;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 26px 46px -20px rgba(0, 0, 0, 0.95),
    0 0 60px -14px var(--accent);
}

.card__blur,
.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__blur {
  transform: scale(1.12);
  filter: blur(14px);
}

.card__img {
  opacity: 0;
  transition: opacity 600ms var(--ease), transform 700ms var(--ease);
}

.card__img.is-ready { opacity: 1; }

.card:hover .card__img { transform: scale(1.045); }

.card__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0.16) 46%,
    rgba(255, 255, 255, 0.04) 54%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform 900ms var(--ease);
}

.card:hover .card__sheen { transform: translateX(120%); }

.card__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 3px 0;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}

.card__title {
  font-weight: 560;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__sub {
  margin-left: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  flex: none;
}

/* ------------------------------------------------------------------ cover flow */

.stage[data-view="flow"] {
  padding-inline: 0;
  overflow: hidden;
}

.stage[data-view="flow"] .grid {
  display: block;
  position: relative;
  height: min(62vh, 560px);
  perspective: 1500px;
  perspective-origin: 50% 45%;
  touch-action: pan-y;
  cursor: grab;
}

.stage[data-view="flow"] .grid:active { cursor: grabbing; }

.stage[data-view="flow"] .card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(40vh, 340px);
  margin: 0;
  perspective: none;
  animation: none;
  transform: translate(-50%, -50%)
    translateX(calc(var(--o, 0) * 26%))
    translateZ(calc(var(--a, 0) * -170px))
    rotateY(calc(var(--o, 0) * -22deg));
  opacity: calc(1 - var(--a, 0) * 0.16);
  z-index: calc(100 - var(--a, 0) * 10);
  transition: transform 520ms var(--ease), opacity 520ms var(--ease);
  will-change: transform;
}

.stage[data-view="flow"] .card[data-far="1"] {
  opacity: 0;
  pointer-events: none;
}

.stage[data-view="flow"] .card__frame {
  transform: none;
  transition: box-shadow 520ms var(--ease);
}

.stage[data-view="flow"] .card__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, calc(var(--a, 0) * 0.16));
  transition: background 520ms var(--ease);
}

.stage[data-view="flow"] .card.is-active .card__frame {
  box-shadow:
    0 30px 60px -22px rgba(0, 0, 0, 0.95),
    0 0 90px -16px var(--accent);
}

.stage[data-view="flow"] .card__meta {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 14px);
  justify-content: center;
  opacity: 0;
  transition: opacity 380ms var(--ease);
}

.stage[data-view="flow"] .card.is-active .card__meta { opacity: 1; }

.stage[data-view="flow"] .card__sub { margin-left: 0; }

.flow-hint {
  display: none;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: clamp(16px, 3vw, 30px);
}

.stage[data-view="flow"] .flow-hint { display: block; }

/* ------------------------------------------------------------------- viewer */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  opacity: 0;
  transition: opacity 320ms var(--ease);
}

.viewer.is-open { opacity: 1; }

.viewer__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 70% at 50% 45%, color-mix(in oklab, var(--shade) 75%, transparent) 0%, transparent 75%),
    rgba(4, 5, 8, 0.9);
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
  border: 0;
}

.viewer__figure {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: min(100%, 92vh);
  transform: scale(0.94);
  opacity: 0;
  transition: transform 420ms var(--ease), opacity 320ms var(--ease);
}

.viewer.is-open .viewer__figure {
  transform: none;
  opacity: 1;
}

.viewer__stage {
  position: relative;
  width: 100%;
  line-height: 0;
  perspective: 1400px;
  transform-origin: 50% 50%;
}

.viewer__img,
.viewer__ghost {
  width: 100%;
  max-height: min(74vh, 900px);
  object-fit: contain;
  border-radius: clamp(8px, 1vw, 16px);
  background: var(--shade);
}

.viewer__img {
  position: relative;
  z-index: 1;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 1),
    0 0 120px -30px var(--accent);
  transition: box-shadow 600ms var(--ease);
}

/* The outgoing cover, held above the new one while it slides away. */
.viewer__ghost {
  position: absolute;
  inset: 0;
  z-index: 2;
  height: 100%;
  pointer-events: none;
}

/* Accent bloom, pulsed on every change. */
.viewer__glow {
  position: absolute;
  inset: 6%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, var(--accent) 0%, transparent 72%);
  filter: blur(46px);
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 500ms var(--ease);
}

/* ------------------------------------------------------- cover transitions */

@keyframes cover-in-right {
  from { opacity: 0; transform: translateX(8%) scale(1.06); filter: blur(12px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes cover-in-left {
  from { opacity: 0; transform: translateX(-8%) scale(1.06); filter: blur(12px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes cover-in-fade {
  from { opacity: 0; transform: scale(1.08); filter: blur(14px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes cover-out-left {
  from { opacity: 1; transform: none; filter: blur(0); }
  to { opacity: 0; transform: translateX(-9%) scale(0.93) rotateY(7deg); filter: blur(12px); }
}

@keyframes cover-out-right {
  from { opacity: 1; transform: none; filter: blur(0); }
  to { opacity: 0; transform: translateX(9%) scale(0.93) rotateY(-7deg); filter: blur(12px); }
}

@keyframes cover-out-fade {
  from { opacity: 1; transform: none; filter: blur(0); }
  to { opacity: 0; transform: scale(0.94); filter: blur(14px); }
}

.viewer__img.is-in-right { animation: cover-in-right 620ms var(--ease) both; }
.viewer__img.is-in-left { animation: cover-in-left 620ms var(--ease) both; }
.viewer__img.is-in-fade { animation: cover-in-fade 620ms var(--ease) both; }

.viewer__ghost.is-out-left { animation: cover-out-left 560ms var(--ease) both; }
.viewer__ghost.is-out-right { animation: cover-out-right 560ms var(--ease) both; }
.viewer__ghost.is-out-fade { animation: cover-out-fade 560ms var(--ease) both; }

@keyframes glow-pulse {
  0% { opacity: 0.3; }
  35% { opacity: 0.85; }
  100% { opacity: 0.3; }
}

.viewer__glow.is-pulsing { animation: glow-pulse 900ms var(--ease); }

/* Slow drift while the slideshow runs. */
@keyframes cover-drift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.05) translate3d(-1%, -1.4%, 0); }
}

.viewer__stage.is-drifting {
  animation: cover-drift var(--slide, 4200ms) linear both;
}

@keyframes caption-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.viewer__caption.is-in { animation: caption-in 560ms var(--ease) both; }

.viewer__caption { text-align: center; }

.viewer__title {
  margin: 0;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.viewer__sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(12, 14, 20, 0.6);
  backdrop-filter: blur(10px);
  color: var(--ink);
  cursor: pointer;
  transition: background 200ms, transform 260ms var(--ease);
}

.viewer__nav:hover { background: rgba(30, 34, 44, 0.9); }
.viewer__nav svg { width: 22px; height: 22px; }
.viewer__nav--prev { left: clamp(8px, 2vw, 32px); }
.viewer__nav--next { right: clamp(8px, 2vw, 32px); }
.viewer__nav--prev:hover { transform: translateY(-50%) translateX(-3px); }
.viewer__nav--next:hover { transform: translateY(-50%) translateX(3px); }

.viewer__tools {
  position: absolute;
  bottom: clamp(14px, 3vw, 30px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.viewer__counter {
  font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

.viewer__progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.viewer__progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* -------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translate(-50%, 20px);
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms, transform 260ms var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 720px) {
  .bar {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .bar__tools { width: 100%; margin-left: 0; }
  .search input { width: 100%; }
  .search { flex: 1; }
  .search kbd { display: none; }
  .viewer__nav { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card__sheen { display: none; }
}
