/* Paper planes and parallax. Artwork has no grain overlay. */
:root[data-vellum] {
  --paper: #eeece5;
  --v-tint: 244 242 233;
}
[data-vellum] body,
[data-vellum] .canvas,
[data-vellum] #project,
[data-vellum] #info,
[data-vellum] .player-stage:fullscreen,
[data-vellum] #project::backdrop,
[data-vellum] .player-panel-morph {
  background-color: var(--paper);
  background-image: none;
}
[data-vellum] .canvas {
  isolation: isolate;
}
.vellum-ground {
  position: absolute;
  inset: -48px;
  z-index: -1;
  pointer-events: none;
  will-change: auto;
  background-image:
    radial-gradient(
      ellipse at 50% 45%,
      rgb(255 249 224 / 0.11),
      transparent 67%
    ),
    radial-gradient(ellipse at 0% 48%, rgb(103 89 61 / 0.055), transparent 32%),
    radial-gradient(
      ellipse at 100% 58%,
      rgb(255 248 220 / 0.12),
      transparent 29%
    ),
    radial-gradient(ellipse at 16% 28%, rgb(91 84 62 / 0.17), transparent 44%),
    radial-gradient(
      ellipse at 66% 18%,
      rgb(255 249 224 / 0.42),
      transparent 45%
    ),
    radial-gradient(ellipse at 84% 76%, rgb(105 96 73 / 0.19), transparent 46%),
    radial-gradient(
      ellipse at 30% 85%,
      rgb(247 238 208 / 0.34),
      transparent 43%
    ),
    url("assets/vellum-ground-tones.svg?v=e5587823a3b1"), url("assets/vellum-background.svg?v=da7e5d24e1c2");
  background-size:
    auto,
    auto,
    auto,
    auto,
    auto,
    auto,
    auto,
    1100px 900px,
    384px 384px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat;
}
/* Transmitted silhouettes behind the covers. */
[data-vellum] .card {
  isolation: isolate;
}
[data-vellum] .card::before {
  --shadow-ink: color-mix(in srgb, rgb(var(--ambient-shadow-rgb, 180 170 144)) 20%, #39342b);
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    0 18px 44px 4px color-mix(in srgb, var(--shadow-ink) 15%, transparent),
    0 6px 14px color-mix(in srgb, var(--shadow-ink) 9%, transparent);
}
[data-vellum] .card .art {
  overflow: hidden;
  isolation: isolate;
  border-radius: 0;
  --art-rest-transform: scaleX(calc(1 + var(--v-depth, 0) * 0.09))
    skewY(calc(var(--v-side, 0) * var(--v-depth, 0) * 0.7deg));
  transform: var(--art-rest-transform);
  transform-origin: center;
  box-shadow: none;
}
[data-vellum] .card .art-image,
[data-vellum] .card .preview-host {
  overflow: hidden;
  clip-path: inset(0);
  border-radius: 0;
}
/* Approved printed lettering; utilities remain crisp. */
[data-vellum] .card .card-artist,
[data-vellum] .card .card-title,
[data-vellum] .wordmark,
[data-vellum] .project-brand,
[data-vellum] .opening-sheet,
[data-vellum] #project h1,
[data-vellum] #opening-sequence .opening-sheet > div {
  color: #414034;
  text-shadow:
    0.35px 0.65px 0.7px rgb(38 34 22 / 0.28),
    0 1.4px 2.8px rgb(44 37 21 / 0.19),
    0 3px 6px rgb(48 40 24 / 0.08);
}
[data-vellum] .wordmark,
[data-vellum] .project-brand,
[data-vellum] #project h1,
[data-vellum] #opening-sequence .opening-sheet > div {
  filter: url("#vellum-ink");
}
@media (min-width: 681px) {
  /* Keep the ink static inside the layer that moves through the mask. */
  [data-vellum] .card .caption-ink { filter: url("#vellum-ink"); }
}
[data-vellum] nav,
[data-vellum] .work-filters {
  filter: none;
  text-shadow: none;
}
[data-vellum] nav button,
[data-vellum] nav a,
[data-vellum] .work-filters button {
  text-shadow: none;
}
[data-vellum] .work-filters button[aria-pressed="true"] {
  color: #33392f;
}
[data-vellum] .work-filters {
  top: auto;
  bottom: clamp(28px, 4vh, 44px);
  gap: 16px;
}
html.opening #opening-sequence.static-opening {
  display: grid !important;
}
#opening-sequence.static-opening .opening-sheet {
  transform: none;
  opacity: 1;
}
@media (max-width: 680px) {
  [data-vellum] .card::before {
    opacity: .58;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vellum-ground {
    transform: none !important;
    will-change: auto;
  }
  [data-vellum] #cards {
    translate: none !important;
    will-change: auto;
  }
}
@media (max-width: 680px) {
  html[data-vellum],
  body {
    background: #eeece5 !important;
  }
  [data-vellum] .canvas {
    height: 100dvh;
    min-height: 0;
    background: #eeece5 !important;
  }
  .vellum-ground {
    display: none;
  }
  [data-vellum] header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 5;
    background: linear-gradient(#eeece5 75%, transparent);
    padding-bottom: 28px;
    pointer-events: none;
  }
  header a,
  header button {
    pointer-events: auto;
  }
  [data-vellum] #gallery {
    inset: 0;
    height: 100%;
    min-height: 0;
    transform: none;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    outline: none !important;
  }
  #gallery::-webkit-scrollbar {
    display: none;
  }
  [data-vellum] #cards {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 90px;
    padding: 160px 0 140px;
    pointer-events: auto;
    translate: none !important;
    will-change: auto;
  }
  [data-vellum] .card {
    position: relative;
    inset: auto;
    flex: none;
    transform: none;
    will-change: auto;
    --caption-opacity: 1 !important;
    --caption-shift: 0px !important;
  }
  [data-vellum] .card[hidden] {
    display: none;
  }
  [data-vellum] .card .art {
    will-change: auto;
    transform: none;
  }
  [data-vellum] .work-filters {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: center;
    padding: 32px 8px calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, #eeece5 42%);
    z-index: 6;
  }
  [data-vellum] .edition {
    display: none;
  }
}

/* Original navigation typography; horizontal arrangement only. */
[data-vellum] header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}
[data-vellum] header nav {
  flex-direction: row;
  align-items: baseline;
  gap: 24px;
  padding-top: 0;
}
@media (max-width: 680px) {
  [data-vellum] header {
    flex-wrap: wrap;
    gap: 16px;
  }
  [data-vellum] header nav {
    gap: 16px;
  }
}

/* Small utility text stays readable; the approved title ink is unchanged. */
[data-vellum] #project .detail-note,
[data-vellum] #project-number,
[data-vellum] .player-time,
[data-vellum] .player-status {
  filter: none;
  color: #49483d;
  text-shadow: 0 0.3px 0.45px rgb(38 34 22 / 0.12);
}
[data-vellum] #project .detail-note {
  font-size: 12px;
  line-height: 1.85;
}
[data-vellum] #project-number,
[data-vellum] .player-time {
  font-size: 12px;
}
[data-vellum] #project .credit-role {
  color: #626052;
}

/* Stage 1: same static paper, with compositing only while motion is active. */
[data-vellum] #cards,
[data-vellum] .card,
[data-vellum] .card .art {
  will-change: auto;
}
#gallery.gallery-moving .gallery-card-visible {
  will-change: transform;
}
@media (max-width: 680px) {
  [data-vellum] .card .art {
    content-visibility: auto;
    contain-intrinsic-size: auto var(--card-height);
  }
}
.skip-opening {
  position: absolute;
  right: 6.5vw;
  bottom: 32px;
  min-width: 44px;
  min-height: 44px;
  font-size: 12px;
  letter-spacing: 0.08em;
  pointer-events: auto;
}

/* Stage 2: readable utility text and generous targets; title ink is preserved. */
[data-vellum] nav button,
[data-vellum] nav a,
[data-vellum] .work-filters button {
  font-size: 12px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #49483d;
}
[data-vellum] .work-filters button[aria-pressed="false"] {
  color: #626052;
}
[data-vellum] .edition {
  font-size: 12px;
  color: #626052;
  filter: none;
  text-shadow: none;
}
[data-vellum] #project .detail-note,
[data-vellum] #project-number,
[data-vellum] .player-time,
[data-vellum] .player-status,
.eyebrow,
.skip-opening {
  font-size: 12px;
}
#info p,
.eyebrow {
  color: #49483d;
}
#project .close,
#info .close {
  min-width: 44px;
  min-height: 44px;
}
.player-controls button {
  width: 44px;
  min-width: 44px;
  height: 44px;
}
.player-seek {
  height: 44px;
  min-width: 44px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #49483d;
  outline-offset: 4px;
}
@media (max-width: 680px) {
  [data-vellum] header {
    gap: 12px;
  }
  [data-vellum] header nav {
    gap: 8px;
    margin-left: auto;
  }
  [data-vellum] .work-filters {
    gap: 6px;
  }
  [data-vellum] .work-filters button {
    letter-spacing: 0.025em;
  }
  .player-controls {
    gap: 6px;
  }
  .player-time {
    letter-spacing: 0;
  }
}
@media (max-width: 380px) {
  .player-controls {
    display: grid;
    grid-template-columns: 44px minmax(44px, 1fr) 44px 44px;
    gap: 0 6px;
  }
  .player-controls [data-action="play"] {
    grid-column: 1;
    grid-row: 1;
  }
  .player-controls .player-seek {
    grid-column: 2;
    grid-row: 1;
  }
  .player-controls [data-action="sound"] {
    grid-column: 3;
    grid-row: 1;
  }
  .player-controls [data-action="fullscreen"] {
    grid-column: 4;
    grid-row: 1;
  }
  .player-controls .player-time {
    grid-column: 1/-1;
    grid-row: 2;
    justify-self: center;
    padding: 6px 0;
  }
}

/* Film surface uses the same paper plane and parallax offset as the gallery. */
#project {
  isolation: isolate;
}
#project::backdrop {
  background: var(--paper);
}
