/* ============================================
   DECK — the creative-deck look, for /creative and its project pages only.
   Opt in with <body class="deck" data-deck-left="…" data-deck-year="…">
   and js/deck.js (adds the frame, header strip, dash strip and garnish).
   Mirrors the Davey Legend show decks: black grain paper, thin inset frame,
   wide-tracked header, IBM Plex Mono body, Datatype titles, heavy film grain,
   muted graded imagery, barcode/dash strips and sparse garnish marks.
   ============================================ */

body.deck {
  --deck-ink: rgba(255, 255, 255, 0.86);
  --deck-dim: rgba(255, 255, 255, 0.52);
  --deck-line: rgba(255, 255, 255, 0.24);
  --deck-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --deck-title: 'Datatype', 'IBM Plex Mono', ui-monospace, monospace;
  --deck-wide: var(--font-display, 'Clash Display'), sans-serif;
  background-color: #050505;
  /* grain lives in the paper, behind everything: photos stay untouched */
  background-image: url('/assets/deck/paper-grain.png'), url('/assets/deck/blotch.webp');
  background-size: 192px 192px, 768px 768px;
  background-blend-mode: normal, soft-light;
}

/* Sections that paint their own black would hide the paper: let it through */
body.deck main > section,
body.deck .pp-credits,
body.deck .pp-media,
body.deck footer {
  background-color: transparent;
}

/* ── Subtle dark grain vignette: edges only, the centre of the screen stays clean ── */
body.deck::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background:
    url('/assets/deck/grain.png') 0 0 / 192px 192px,
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
  background-blend-mode: multiply, normal;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, transparent 62%, #000 100%);
  mask-image: radial-gradient(ellipse at 50% 50%, transparent 62%, #000 100%);
  opacity: 0.4;
  animation: deck-grain 0.9s steps(6) infinite;
}

@keyframes deck-grain {
  0%   { background-position: 0 0, 0 0; }
  17%  { background-position: -37px 21px, 0 0; }
  33%  { background-position: 24px -48px, 0 0; }
  50%  { background-position: -51px -9px, 0 0; }
  67%  { background-position: 33px 40px, 0 0; }
  83%  { background-position: -14px 55px, 0 0; }
  100% { background-position: 0 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.deck::after { animation: none; }
}

/* ── Thin inset page frame ── */
.deck-frame {
  position: fixed;
  inset: 10px;
  z-index: 9996;
  pointer-events: none;
  border: 1px solid var(--deck-line);
}

@media (max-width: 600px) {
  .deck-frame { inset: 5px; }
}

/* ── Header strip: ARTIST  SHOW   [mark]   DAVEY LEGEND  2026 ── */
.deck-strip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-top: clamp(26px, 4vw, 44px);
  padding-bottom: clamp(18px, 3vw, 28px);
  font-family: var(--deck-wide);
  font-weight: 300;
  font-size: clamp(0.62rem, 0.9vw, 0.78rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--deck-dim);
}

.deck-strip-left { justify-self: start; }
.deck-strip-mark { justify-self: center; height: 30px; width: auto; opacity: 0.7; }
.deck-strip-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 64px);
}
.deck-strip-year { position: relative; }
.deck-strip-year::after {
  /* the little smeared rule under the year */
  content: '';
  position: absolute;
  right: -4px;
  top: calc(100% + 6px);
  width: 72px;
  height: 12px;
  background: url('/assets/deck/dust-strip.webp') right center / contain no-repeat;
  opacity: 0.8;
}

@media (max-width: 720px) {
  .deck-strip {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
  }
  .deck-strip-left { min-width: 0; line-height: 1.7; }
  .deck-strip .deck-strip-mark { display: none; }
  .deck-strip-right { flex: none; }
  .deck-strip-right .deck-strip-name { display: none; }
}

/* ── Typography ── */
body.deck main p,
body.deck main li,
body.deck main td,
body.deck main figcaption,
body.deck .pp-subtitle,
body.deck .proj-subtitle,
body.deck .proj-credit,
body.deck .pp-credit,
body.deck .pp-related,
body.deck .cara-tour {
  font-family: var(--deck-mono);
  font-weight: 400;
  letter-spacing: 0;
}

body.deck .pp-subtitle,
body.deck .proj-subtitle,
body.deck .cara-tour {
  text-transform: uppercase;
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  letter-spacing: 0.06em;
  color: var(--deck-dim);
}

/* Titles: condensed Datatype with a soft bloom, like the deck title cards */
body.deck .pp-title,
body.deck .proj-hero h1,
body.deck .cara-hero h1 {
  font-family: var(--deck-title);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  color: #e9ecee;
  text-shadow: 0 0 22px rgba(220, 235, 240, 0.28), 0 0 2px rgba(255, 255, 255, 0.4);
}

/* Kicker = the wide-tracked "DAVEY LEGEND" */
body.deck .pp-kicker,
body.deck .proj-kicker,
body.deck .cara-kicker {
  font-family: var(--deck-wide);
  font-weight: 300;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.62);
}

/* Section headings in mono caps ("OVERVIEW") */
body.deck .pp-section-title,
body.deck main h2:not(.sr-only),
body.deck main h3 {
  font-family: var(--deck-mono);
  font-weight: 600;
  font-size: clamp(0.78rem, 1vw, 0.9rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--deck-ink);
}

/* Role chips: hairline mono tags */
body.deck .pp-role,
body.deck .proj-role,
body.deck .cara-role {
  font-family: var(--deck-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-color: var(--deck-line);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.25);
}

body.deck .pp-table th {
  font-family: var(--deck-mono);
  letter-spacing: 0.1em;
}

body.deck .pp-footer-nav a,
body.deck .proj-footer-nav a,
body.deck .cara-footer-nav a {
  font-family: var(--deck-wide);
  font-weight: 300;
  letter-spacing: 0.3em;
}

/* Grid cards on /creative */
body.deck .gallery-item-label {
  font-family: var(--deck-title);
  font-weight: 400;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  letter-spacing: 0.02em;
}
body.deck .gallery-item-meta { font-family: var(--deck-mono); }
body.deck .gallery-item-index { font-family: var(--deck-mono); border-radius: 0; }

/* ── Imagery: left exactly as shot ── */
body.deck .gallery-item img { filter: none; }
body.deck .gallery-item::before { display: none; } /* no grain on the /creative cards either */

/* Every framed image gets the deck's offset hairline box */
body.deck .gallery-item,
body.deck .pp-frame,
body.deck .proj-card,
body.deck .cara-card {
  border-color: rgba(255, 255, 255, 0.12);
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: 6px;
}

/* ── Garnish ── */
.deck-garnish { display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }

.deck-cluster {
  display: grid;
  grid-template-columns: repeat(2, 46px);
  grid-auto-rows: 30px;
  gap: 6px 10px;
  align-items: center;
  justify-items: center;
  margin-top: 18px;
  opacity: 0.8;
}
body.deck .deck-cluster img {
  position: static;
  inset: auto;
  max-width: 46px;
  max-height: 30px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: none;
}

.deck-rule {
  width: min(60%, 460px);
  height: auto;
  margin: 0 auto;
  opacity: 0.4;
}

.deck-vspark {
  position: absolute;
  width: 26px;
  height: auto;
  opacity: 0.7;
}

/* Foot: erosion rule with the micro symbols on the right */
.deck-foot { position: relative; padding-bottom: clamp(28px, 4vw, 48px); }
body.deck .deck-foot-symbols {
  position: absolute;
  right: var(--container-padding, 24px);
  bottom: clamp(28px, 4vw, 48px);
  width: 132px;
  height: auto;
  opacity: 0.55;
}

/* Section headings get a small grain star, like the deck's labelled panels */
body.deck .pp-section-title::before,
body.deck main h2:not(.sr-only)::before {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.6em;
  vertical-align: -0.1em;
  background: url('/assets/deck/mini-star.webp') center / contain no-repeat;
  opacity: 0.8;
}

/* Margin marks: absolutely placed in the side gutters by js/deck.js */
body.deck main { position: relative; }
.deck-margins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.deck-margin-mark {
  position: absolute;
  height: auto;
}
@media (max-width: 1000px) {
  .deck-margins { display: none; }
}
