/* 04 · The deck */
#deck { padding: clamp(64px, 7vw, 104px) 0; border-top: 1.5px solid var(--ink); overflow: hidden; }
#deck .deck-head { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 10px 40px; margin-bottom: clamp(32px, 4vw, 56px); }
#deck .deck-head .track-tag { grid-column: 1 / -1; }
#deck .deck-lede { max-width: 34ch; margin: 0 0 .6em; font-size: 17px; line-height: 1.55; color: var(--graphite); justify-self: end; }

#deck .deck-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(32px, 4vw, 64px); align-items: start; }

/* ---- series switch: a physical 4-position slide ---- */
#deck .deck-switch { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
#deck .deck-switch-track { position: relative; flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--shell); border: 1.5px solid var(--ink); border-radius: var(--radius-tape); padding: 4px; box-shadow: inset 0 2px 0 rgba(20,22,27,.14); }
#deck .deck-switch-knob { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 0 3px 0 var(--ink); transition: transform .28s cubic-bezier(.3,1.4,.5,1); }
#deck .deck-switch-track[data-pos="1"] .deck-switch-knob { transform: translateX(100%); }
#deck .deck-switch-track[data-pos="2"] .deck-switch-knob { transform: translateX(200%); }
#deck .deck-switch-track[data-pos="3"] .deck-switch-knob { transform: translateX(300%); }
#deck .deck-sw { position: relative; z-index: 1; min-height: 46px; padding: 4px 6px; background: none; border: 0; cursor: pointer; font: 500 12px/1.15 var(--mono); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
#deck .deck-sw { white-space: nowrap; letter-spacing: 0; }
#deck .deck-sw b { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 4px; background: var(--s); border: 1px solid var(--ink); font-weight: 700; font-size: 11px; }
#deck .deck-sw.series-b b { color: var(--white); }
#deck .deck-sw[aria-checked="true"] { font-weight: 700; }
#deck .deck-sw:focus-visible { outline: 2px solid var(--cobalt); outline-offset: -2px; }

/* ---- the wall ---- */
#deck .deck-shelf { position: relative; padding: 28px 22px 0; background: linear-gradient(var(--white), var(--white)) padding-box; border: 1.5px solid var(--ink); }
#deck .deck-shelf::before { /* the photo of the real wall, as a strip above the shelf, never behind text */
  content: ""; display: block; height: 92px; margin: -28px -22px 24px; border-bottom: 1.5px solid var(--ink);
  background: url("../shared/img/tape-wall.webp") center 40%/cover; filter: saturate(.85);
}
#deck .deck-spines, #deck .deck-blanks { display: flex; align-items: flex-end; gap: 8px; }
#deck .deck-spines { float: left; margin-right: 8px; }
#deck .deck-blanks { overflow: hidden; }
#deck .deck-shelf::after { content: ""; display: block; clear: both; }
#deck .deck-plank { clear: both; height: 16px; margin: 0 -22px; background: var(--shell); border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
#deck .deck-shelf-note { margin: 0 -22px; padding: 10px 22px; color: var(--graphite); }
#deck .deck-spine, #deck .deck-blank {
  --w: 62px; --h: 300px;
  flex: none; width: var(--w); height: var(--h); position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 0 10px; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: var(--radius-tape) var(--radius-tape) 0 0;
  background: var(--white); color: var(--ink); overflow: hidden;
}
#deck .deck-spine { cursor: pointer; font: inherit; transition: transform .32s cubic-bezier(.3,1.3,.5,1), opacity .25s, box-shadow .2s; }
#deck .deck-spine-band { flex: none; width: 100%; height: 54px; background: var(--s); border-bottom: 1.5px solid var(--ink); }
#deck .deck-spine-no { flex: none; writing-mode: vertical-rl; white-space: nowrap; font: 500 12px/1 var(--mono); letter-spacing: .06em; }
#deck .deck-spine-title { flex: none; writing-mode: vertical-rl; font: 900 22px/1 var(--display); font-stretch: 82%; text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap; }
#deck .deck-blank-link { flex: none; margin-top: auto; writing-mode: vertical-rl; white-space: nowrap; font: 600 11px/1 var(--mono); text-transform: uppercase; color: var(--orange-ink); text-underline-offset: 3px; }
#deck .deck-blank-link:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
#deck .deck-spine-s { margin-top: auto; width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font: 700 12px/1 var(--mono); }
#deck .deck-spine:hover { transform: translateY(-8px); }
#deck .deck-spine:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
#deck .deck-spine.is-out { transform: translateY(-28px); box-shadow: 4px 4px 0 var(--ink); z-index: 1; }
#deck .deck-spine.is-out .deck-spine-s { background: var(--ink); color: var(--white); }
#deck .deck-spine.is-back { transform: translateY(14px) scale(.94); opacity: .28; pointer-events: none; filter: grayscale(1); }

#deck .deck-blank { --w: 52px; background: repeating-linear-gradient(-45deg, transparent 0 7px, var(--rule) 7px 8px), var(--paper); border-style: dashed; color: var(--graphite); padding-top: 14px; }
#deck .deck-blank .deck-spine-title { font-size: 20px; color: var(--graphite); }
#deck .deck-blank[hidden] { display: none; }

/* ---- the J-card ---- */
#deck .deck-stage { position: relative; perspective: 1800px; }
#deck .deck-card { display: grid; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.5,0,.2,1); }
#deck .deck-card.is-b { transform: rotateY(180deg); }
#deck .deck-card.series-o { --s: var(--series-o); } #deck .deck-card.series-g { --s: var(--series-g); } #deck .deck-card.series-b { --s: var(--series-b); }
#deck .deck-face { grid-area: 1 / 1; min-width: 0; background: var(--white); border: 1.5px solid var(--ink); box-shadow: var(--shadow-hard); border-radius: var(--radius-tape); overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
#deck .deck-face-b { transform: rotateY(180deg); display: flex; flex-direction: column; }
#deck .deck-face-a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#deck .deck-art { position: relative; overflow: hidden; border-right: 1.5px solid var(--ink); background: var(--paper); min-height: 320px; }
#deck .deck-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
#deck .deck-info { display: flex; flex-direction: column; min-width: 0; }
#deck .deck-band { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--s); border-bottom: 1.5px solid var(--ink); font: 500 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); }
#deck .series-b .deck-band { color: var(--white); }
#deck .deck-meta { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
#deck .deck-no { margin: 0; font-size: 34px; }
#deck .deck-title { margin: 6px 0 10px; font: 900 clamp(30px, 3vw, 44px)/.92 var(--display); font-stretch: 82%; text-transform: uppercase; letter-spacing: -.02em; }
#deck .deck-job { margin: 0 0 16px; font-size: 17px; line-height: 1.45; }
#deck .deck-facts { margin: 0 0 18px; display: grid; gap: 8px; }
#deck .deck-facts div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; border-top: 1px solid var(--rule); padding-top: 8px; }
#deck .deck-facts dt { color: var(--graphite); }
#deck .deck-facts dd { margin: 0; font-size: 15px; }
#deck .deck-play-a { margin-top: auto; align-self: flex-start; }

#deck .deck-b-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
#deck .deck-b-title { margin: 0 0 14px; font: 800 22px/1.1 var(--display); }
#deck .deck-tracks { list-style: none; margin: 0 0 18px; padding: 0; }
#deck .deck-tracks li { display: grid; grid-template-columns: 38px 118px 1fr; gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.35; }
#deck .deck-tracks li:last-child { border-bottom: 1px solid var(--rule); }
#deck .deck-tr-code { font: 700 12px/1 var(--mono); }
#deck .deck-tracks b { font-weight: 700; }
#deck .deck-tracks span:last-child { color: var(--graphite); }
#deck .deck-buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#deck .deck-price { margin: 0; font-size: 26px; }
#deck .deck-terms { display: block; margin-top: 4px; font: 500 12px/1.3 var(--mono); color: var(--graphite); }
#deck .deck-b-title:focus { outline: none; }
#deck .deck-b-title:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

#deck.is-empty .deck-card { opacity: .35; filter: grayscale(1); pointer-events: none; }
#deck.is-empty .deck-stage::after { content: "Deck empty · pull a tape off the wall"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-3deg); padding: 10px 14px; background: var(--orange); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 800 14px/1.1 var(--display); text-transform: uppercase; white-space: nowrap; }

/* ---- transport ---- */
#deck .deck-transport { margin-top: 26px; display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; align-items: center; padding: 14px; background: var(--shell); border: 1.5px solid var(--ink); border-radius: var(--radius-tape); }
#deck .deck-window { width: 132px; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; background: var(--ink); border-radius: 999px; position: relative; }
#deck .deck-tape-line { position: absolute; left: 36px; right: 36px; top: 50%; height: 12px; margin-top: -6px; background: #5a3a22; }
#deck .deck-reel { position: relative; z-index: 1; width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--paper); background: repeating-conic-gradient(var(--paper) 0 10deg, var(--ink) 10deg 60deg); }
#deck .deck-window.is-playing .deck-reel, #deck .deck-transport:hover .deck-reel { animation: gw-reel 1.6s linear infinite; }
#deck .deck-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
#deck .deck-key { min-height: 56px; display: grid; place-items: center; align-content: center; gap: 3px; background: var(--white); border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 0 4px 0 var(--ink); cursor: pointer; color: var(--ink); font: 700 18px/1 var(--mono); transition: transform .08s, box-shadow .08s; }
#deck .deck-key i { font: 500 11px/1 var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .04em; }
#deck .deck-key:active, #deck .deck-key[aria-pressed="true"] { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#deck .deck-key-play { background: var(--orange); }
#deck .deck-key[aria-pressed="true"] { background: var(--cobalt); color: var(--white); }
#deck .deck-key:disabled { opacity: .45; cursor: not-allowed; }
#deck .deck-key:focus-visible, #deck .deck-play-a:focus-visible, #deck #deck-get:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
#deck .deck-status { grid-column: 1 / -1; margin: 0; min-height: 1.4em; }
@keyframes gw-reel { to { transform: rotate(360deg); } }

/* ---- mobile ---- */
@media (max-width: 900px) {
  #deck .deck-head { grid-template-columns: 1fr; }
  #deck .deck-lede { justify-self: start; }
  #deck .deck-body { grid-template-columns: minmax(0, 1fr); }
  #deck .deck-shelf { padding: 22px 0 0; }
  #deck .deck-shelf::before { margin: -22px 0 0; height: 72px; }
  #deck .deck-spines { float: none; }
  #deck .deck-spines { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 36px 16px 0; margin: 0; gap: 8px; scrollbar-width: thin; }
  #deck .deck-spine { scroll-snap-align: center; --h: 290px; --w: 54px; }
  #deck .deck-spine-band { height: 40px; }
  #deck .deck-spine-title { font-size: 19px; }
  #deck .deck-blanks { display: none; }
  #deck .deck-plank, #deck .deck-shelf-note { margin: 0; }
  #deck .deck-spine.is-back { display: none; }
}
@media (max-width: 600px) {
  #deck .deck-switch { flex-direction: column; align-items: stretch; gap: 8px; }
  #deck .deck-sw { font-size: 11px; padding: 4px 2px; white-space: normal; }
  #deck .deck-sw b { display: grid; margin: 0 auto 3px; }
  #deck .deck-face-a { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  #deck .deck-art { min-height: 0; }
  #deck .deck-art { border-right: 0; border-bottom: 1.5px solid var(--ink); aspect-ratio: 16 / 10; }
  #deck .deck-tracks li { grid-template-columns: 30px 1fr; }
  #deck .deck-tracks span:last-child { grid-column: 2; }
  #deck .deck-transport { grid-template-columns: 1fr; justify-items: stretch; }
  #deck .deck-window { justify-self: center; }
  #deck .deck-key { min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  #deck .deck-spine, #deck .deck-switch-knob { transition: none; }
  #deck .deck-window.is-playing .deck-reel, #deck .deck-transport:hover .deck-reel { animation: none; }
  #deck .deck-card, #deck .deck-card.is-b { transform: none; transition: none; }
  #deck .deck-face-b { transform: none; }
  #deck .deck-face { transition: opacity .2s; }
  #deck .deck-card:not(.is-b) .deck-face-b, #deck .deck-card.is-b .deck-face-a { opacity: 0; visibility: hidden; }
}
