/* ─────────────────────────────────────────────────────────────
   archive.css — the shelf
   The DVD shelf is the site's primary interaction mode. It lives
   inline on the home page directly beneath the hero; /work is a
   redirect into it. Extracted from the former standalone archive
   page so there is exactly one shelf to maintain.
   ───────────────────────────────────────────────────────────── */

/* ─── Section framing (home) ─── */
.archive-section,
.archive-note {
  --archive-measure: 640px;
}

/* The section is the full container so the signage and the decorative
   layers have a margin to live in. It deliberately does NOT size itself to
   the shelf — see .archive-stage. */
.archive-section {
  position: relative;
  width: 100%;
  align-self: stretch;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-2xl);
}

/* On its own page (shelf.html) nothing stands above it but the header */
.archive-section--page {
  padding-top: calc(var(--space-5xl) + var(--space-lg));
}

@media (max-width: 768px) {
  .archive-section--page {
    padding-top: var(--space-4xl);
  }
}

/* The archive is the focal point and owns its own box.
   `width: fit-content` here resolves against the whole container, so when a
   case animates open to 304px the stage grows with it and stays centred.
   It previously sat in a grid track next to the signage, which capped it at
   ~368px — the expanded case then overflowed .shelf's `overflow-x: auto`
   and clipped every spine past the third. Nothing shares this box. */
.archive-stage {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

/* The head carried a stamped "Archive" label opposite the instruction.
   The label said what the page already is, so only the instruction is
   left and it sits flush to the player it belongs to. */
.archive-section__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.archive-section__sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--grey);
  margin: 0;
}

/* The player's top margin was sized for a page hero. Under a section
   label it only needs to sit close to the thing it is labelled by. */
.archive-section .player {
  margin-top: 0;
}

/* ─── Provenance ─── */
.archive-note {
  width: 100%;
  align-self: stretch;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-3xl);
}

/* the rule tracks the signage rail rather than the full container, so the
   note reads as the foot of the same plate */
.archive-note__inner {
  max-width: var(--archive-measure);
  margin-inline: auto;
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.archive-note__text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: var(--grey);
  max-width: 560px;
}

/* ─── DVD Player ─── */
.player {
  position: relative;
  margin: var(--space-xl) 0 var(--space-2xl);
}

.player__unit {
  position: relative;
  background: var(--ink);
  border-radius: 6px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.1);
}

/* Grain on player */
.player__unit::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0.15;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

.player__slot {
  flex: 1;
  height: 6px;
  background: rgba(240, 237, 230, 0.06);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(240, 237, 230, 0.04);
}

.player__slot-glow {
  position: absolute;
  inset: -3px;
  background: var(--orange);
  opacity: 0;
  border-radius: 6px;
  filter: blur(6px);
  transition: opacity 0.4s ease;
}

/* Disc indicator that appears inside slot during insertion */
.player__disc-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 4px;
  margin: -2px 0 0 -20px;
  background: var(--orange);
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0);
}

.player__label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(240, 237, 230, 0.25);
  white-space: nowrap;
}

.player__eject {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: rgba(240, 237, 230, 0.2);
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease;
}

.player__eject:hover { color: rgba(240, 237, 230, 0.5); }

/* ─── Shelf ─── */
.shelf-wrap {
  position: relative;
}

.shelf {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  padding: 30px 0 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.shelf::-webkit-scrollbar { display: none; }

.shelf.is-dragging { cursor: grabbing; }

.shelf__track {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 40px 0 0;
  min-width: max-content;
}

/* Wood shelf surface */
.shelf__surface {
  height: 18px;
  background: linear-gradient(180deg, #B8956A 0%, #A07D55 40%, #8B6B44 100%);
  border-radius: 0 0 3px 3px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  margin-top: -2px;
}

/* Wood grain */
.shelf__surface::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* Shelf lip shadow */
.shelf__surface::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.06));
}

/* ─── DVD Case ─── */

/* spine accents — one per disc, no repeats. The extensions (bottle,
   brass, amber) come from the same warm print family as the core
   tokens: test-card colors, coffee, backlit dial glass. */
.shelf {
  --bottle: #2F4A3A;
  --brass:  #A3762A;
  --amber:  #E3B079;
}

.dvd {
  position: relative;
  flex-shrink: 0;
  perspective: 1200px;
  cursor: pointer;
  height: 380px;
}

.dvd__case {
  position: relative;
  width: 34px;
  height: 380px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.dvd:hover .dvd__case {
  transform: translateY(-16px);
}

.dvd.is-active {
  z-index: 200;
}

.dvd.is-active .dvd__case {
  transform: none;
}

/* Spine — the visible face when standing */
.dvd__spine {
  position: absolute;
  width: 34px;
  height: 380px;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
  backface-visibility: hidden;
  box-shadow: 1px 0 3px rgba(0,0,0,0.15), -1px 0 3px rgba(0,0,0,0.15);
}

.dvd__spine-number {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: rgba(240, 237, 230, 0.4);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.dvd__spine-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dvd__spine-accent {
  width: 14px;
  height: 3px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* Front cover — hidden initially, revealed on click */
.dvd__front {
  position: absolute;
  top: 0;
  left: 34px;
  width: 270px;
  height: 380px;
  background: var(--cream);
  backface-visibility: hidden;
  transform-origin: left center;
  transform: rotateY(0deg);
  box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Grain on cover */
.dvd__front::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.1;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

.dvd__cover-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  mix-blend-mode: multiply;
  filter: contrast(1.08) saturate(0.8);
}

.dvd__cover-image--analog {
  filter: contrast(1.12) saturate(0.55) brightness(0.97);
}

/* brand cover (Theatrical) — render crisp, no silkscreen treatment */
.dvd__cover-image--brand {
  mix-blend-mode: normal;
  filter: none;
  object-fit: contain;
  background: var(--cream);
}

.dvd__cover-info {
  padding: 16px 18px;
}

.dvd__cover-number {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--grey);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dvd__cover-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 8px;
}

.dvd__cover-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: var(--grey);
  text-transform: uppercase;
  line-height: 1.6;
}

.dvd__cover-year {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--grey);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(26,26,26,0.08);
}

/* Disc — inside the case */
.dvd__disc {
  position: absolute;
  top: 50%;
  left: 34px;
  width: 120px;
  height: 120px;
  margin-top: -60px;
  margin-left: 75px;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.dvd__disc-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  filter: contrast(1.1) saturate(0.7);
}

/* A cover that is the product's app icon: shown true and full, not
   silkscreened like a photograph */
.dvd__cover-image--icon {
  mix-blend-mode: normal;
  filter: none;
  object-fit: cover;
}

/* A disc printed with the product's own mark — its app icon, or a label
   drawn for it — is shown true, not silkscreened like a photograph */
.dvd__disc-image--print {
  mix-blend-mode: normal;
  filter: none;
}

/* ...and a small mark is brought up to fill the disc, so the spindle hole
   punches through it the way a conductor punches a ticket */
.dvd__disc-image--fill {
  transform: scale(1.3);
}

/* Disc ring */
.dvd__disc::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px rgba(26,26,26,0.1);
}

/* Disc grooves */
.dvd__disc::before {
  content: '';
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    inset 0 0 0 8px rgba(255,255,255,0.03),
    inset 0 0 0 20px rgba(255,255,255,0.02),
    inset 0 0 0 35px rgba(255,255,255,0.01);
  z-index: 1;
}

/* ─── Play button on cover ─── */
.dvd__play {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 210;
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: background 0.2s ease;
}

.dvd__play svg {
  width: 14px;
  height: 14px;
  fill: var(--bg);
  margin-left: 2px;
}

.dvd__play:hover {
  background: var(--orange);
}

/* ─── Overlay for expanded state ─── */
.dvd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(240, 237, 230, 0);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: none;
}

.dvd-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Tablet ─── */
@media (max-width: 1024px) and (min-width: 769px) {
  .dvd { height: 300px; }
  .dvd__case { height: 300px; }
  .dvd__spine { height: 300px; }
  .dvd__front { height: 300px; }
  .dvd__cover-image { height: 170px; }
  .dvd__disc { width: 90px; height: 90px; margin-top: -45px; margin-left: 55px; }
}

/* ─── Mobile — scaled shelf, not stacked ─── */
@media (max-width: 768px) {
  .player__unit { padding: 10px 16px; gap: 10px; }
  .player__label { font-size: 0.45rem; }
  .player__eject { width: 16px; height: 16px; }

  .dvd { height: 240px; }
  .dvd__case { width: 26px; height: 240px; }
  .dvd__spine { width: 26px; height: 240px; padding: 10px 0 8px; }
  .dvd__spine-number { font-size: 0.45rem; }
  .dvd__spine-title { font-size: 0.55rem; }
  .dvd__spine-accent { width: 10px; height: 2px; }

  .dvd__front { left: 26px; width: 200px; height: 240px; }
  .dvd__cover-image { height: 130px; }
  .dvd__cover-info { padding: 10px 12px; }
  .dvd__cover-title { font-size: 1rem; }
  .dvd__cover-number { font-size: 0.5rem; margin-bottom: 4px; }
  .dvd__cover-meta { font-size: 0.5rem; }
  .dvd__cover-year { font-size: 0.5rem; margin-top: 8px; padding-top: 6px; }

  .dvd__disc { width: 80px; height: 80px; margin-top: -40px; margin-left: 45px; }
  .dvd__play { width: 32px; height: 32px; bottom: 10px; right: 10px; }
  .dvd__play svg { width: 11px; height: 11px; }

  .shelf__track { gap: 2px; padding: 0 24px 0 0; }
  .shelf__surface { height: 14px; }

  .dvd:hover .dvd__case { transform: translateY(-10px); }
}
