/* ===== 02 · Man vs. Machine track spiral (below the hero; nothing here targets hero elements) ===== */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-var-latin.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

.show, .outro {
  --gutter: clamp(18px, 4vw, 48px);
  --accent: #2f8cff;
  --accent-glow: rgba(47, 140, 255, .55);
  --cyan: #7fd4ff;
  --dim: #9c99a3;            /* readability: was #5b5862 */
  --line: rgba(255, 255, 255, .14);
  --wide: "Archivo", "Inter", system-ui, sans-serif;
}

.hero.show { height: 1100vh; }
.show__layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#frames, #cut { will-change: opacity; }   /* redrawn every frame and faded at the hand-off: kept on their own layers */
.show__bg { z-index: 0; }
.show__cut { z-index: 100; }
.hero__vignette.show__vignette { z-index: 120; }

/* ---- labels ---- */
.section-top { display: flex; align-items: baseline; gap: 18px; }
.section-index { display: flex; gap: .55em; margin: 0; color: var(--muted); font: 800 11px/1 var(--wide); font-stretch: 125%; }
.section-label { margin: 0; color: var(--ink); font: 800 12px/1.2 var(--wide); font-stretch: 125%; letter-spacing: .08em; text-transform: uppercase; }
.section-label--dim { color: var(--dim); }

.spiral__head { position: absolute; z-index: 300; opacity: 0; transition: opacity .6s; top: 88px; left: var(--gutter); right: var(--gutter); pointer-events: none; }
.spiral__head .section-label--dim { margin-left: auto; }

/* ---- ghost title behind Norm ---- */
.spiral__ghost {
  position: absolute; z-index: 3; left: 50%; top: 13vh; transform: translateX(-50%);
  font-family: "Anton", Impact, sans-serif; font-size: min(15.5vw, 30vh); line-height: .86; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(242, 241, 244, .2);
  opacity: 0; pointer-events: none; will-change: opacity, transform;
}

/* ---- orbit: one perspective container; cards and Norm are siblings so z-index decides front/back ---- */
.spiral__orbit { position: absolute; inset: 0; z-index: 1; }

.card {
  position: absolute; left: 50%; top: 0;
  width: var(--cw, 340px); height: var(--ch, 220px);
  margin-left: calc(var(--cw, 340px) / -2); margin-top: calc(var(--ch, 220px) / -2);
  padding: 5px; border-radius: 18px;
  background: linear-gradient(150deg, rgba(255,255,255,.22), rgba(255,255,255,.05) 40%, rgba(255,255,255,.12));
  box-shadow: -1px 0 0 rgba(255, 60, 120, .35), 1px 0 0 rgba(60, 200, 255, .45), 0 20px 50px rgba(0,0,0,.55);
  will-change: transform, opacity; backface-visibility: hidden;
  cursor: pointer; pointer-events: none;
}
.card.is-front { pointer-events: auto; }
.card__glass { position: relative; width: 100%; height: 100%; border-radius: 13px; overflow: hidden; background: #0b0c10; }
.card__glass img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__glass::before { /* legibility shade + glass sheen */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(115deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 32%),
    linear-gradient(to top, rgba(5,7,12,.85) 0%, rgba(5,7,12,.15) 55%, rgba(5,7,12,.35) 100%);
}
.card__glass::after { /* thin inner bezel */
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.card__no, .card__len, .card__feat {
  position: absolute; z-index: 2; font: 800 max(11px, calc(var(--cw, 340px) * .034))/1 var(--wide); font-stretch: 112%;
  letter-spacing: .06em; text-transform: uppercase; color: rgba(242,241,244,.9);
}
.card__no { top: 7%; left: 6%; }
.card__len { top: 7%; right: 6%; color: var(--cyan); }
.card__feat { bottom: 7%; right: 6%; color: rgba(242,241,244,.82); text-align: right; max-width: 62%; line-height: 1.2; }
.card__title {
  position: absolute; z-index: 2; left: 6%; right: 6%; bottom: 17%; margin: 0;
  font: 900 calc(var(--cw, 340px) * .078)/.92 var(--wide); font-stretch: 125%; letter-spacing: -.01em; text-transform: uppercase;
  color: #f4f3f6; text-shadow: 0 2px 18px rgba(0,0,0,.6);
}
.card__dim { position: absolute; inset: 0; z-index: 4; background: #0b0a0e; opacity: var(--veil, 0); pointer-events: none; }
.card__glow { position: absolute; z-index: 2; left: 6%; bottom: 13%; width: 28px; height: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

/* ---- detail panel ---- */
.spiral__detail { position: absolute; z-index: 300; top: 120px; right: calc(var(--gutter) + 40px); width: 272px; transition: opacity .5s, transform .5s; }
.spiral__detail.is-idle { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.detail__count { display: flex; align-items: baseline; gap: 8px; margin: 0 0 14px; }
.detail__count [data-d-index] { font: 500 40px/.8 var(--wide); font-stretch: 112%; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.detail__of, .detail__cat, .detail__credit { font: 800 11px/1.3 var(--wide); font-stretch: 125%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.detail__cat { margin: 0 0 6px; color: #5aa8ff; text-shadow: 0 0 12px var(--accent-glow); }
.detail__title { min-height: 1.9em; margin: 0 0 8px; font: 900 20px/.95 var(--wide); font-stretch: 125%; letter-spacing: -.01em; text-transform: uppercase; color: var(--ink); overflow-wrap: anywhere; }
.detail__credit { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.detail__blurb { margin: 0 0 16px; color: #c4c1ca; font: 500 12px/1.4 "Inter", system-ui, sans-serif; }
.detail__blurb[hidden] { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 16px;
  border: 1px solid rgba(47,140,255,.45); border-radius: 999px; text-decoration: none;
  color: var(--cyan); font: 800 11px/1 var(--wide); font-stretch: 125%; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(47,140,255,.06); transition: border-color .3s, background .3s, color .3s;
}
.pill__icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(47,140,255,.18); font-size: 10px; }
.pill:hover, .pill:focus-visible { border-color: var(--accent); background: var(--accent); color: #05070a; outline: none; }

/* ---- rail + hint ---- */
.spiral__rail { position: absolute; z-index: 300; right: var(--gutter); top: 50%; transform: translateY(-50%); }
.spiral__rail ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.spiral__rail button { position: relative; display: block; width: 26px; height: 9px; padding: 0; border: 0; background: none; cursor: pointer; }
.spiral__rail button::before { content: ""; position: absolute; top: 4px; right: 0; width: 12px; height: 1px; background: rgba(255,255,255,.22); transition: width .35s, background .35s; }
.spiral__rail button:hover::before { background: rgba(255,255,255,.6); }
.spiral__rail button[aria-current="true"]::before { width: 26px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.spiral__hint {
  position: absolute; z-index: 300; left: 50%; bottom: 30px; transform: translateX(-50%); margin: 0;
  display: flex; align-items: center; gap: 12px; white-space: nowrap; pointer-events: none;
  font: 800 11px/1 var(--wide); font-stretch: 125%; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  transition: opacity .6s;
}
.spiral__hint-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.spiral__hint.is-hidden { opacity: 0; }

/* ---- film grain (this section only) ---- */
.spiral__grain, .outro::after {
  position: absolute; inset: -20%; z-index: 400; pointer-events: none; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: spiral-grain .8s steps(4, end) infinite;
}
@keyframes spiral-grain { 0% { transform: translate(0,0); } 25% { transform: translate(-47px,31px); } 50% { transform: translate(23px,-71px); } 75% { transform: translate(-89px,-13px); } 100% { transform: translate(0,0); } }

/* ---- accessible list: the real content; hidden visually once JS has built the spiral ---- */
.spiral__list { margin: 0; padding: 18vh var(--gutter) 12vh; list-style: decimal-leading-zero inside; display: grid; gap: 14px; }
.spiral__list li { font: 800 14px/1.3 var(--wide); font-stretch: 125%; text-transform: uppercase; }
.spiral__list-meta { color: var(--muted); font-size: 12px; }
.spiral-js .spiral__list { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- outro (shows the unpin) ---- */
.outro { position: relative; overflow: hidden; padding: 16vh var(--gutter) 14vh; background: linear-gradient(var(--bg), #0e0d10); }
.outro::after { content: ""; }
.outro .section-label--dim { margin-left: auto; }

/* ---- mobile ---- */
@media (max-width: 768px) {
  .hero.show { height: 1000vh; }
  .spiral__head { display: none; }
  .spiral__ghost { top: 17vh; font-size: 13.5vw; }
    .spiral__detail { top: auto; bottom: 20px; left: var(--gutter); right: var(--gutter); width: auto;
    padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(14,13,16,.72);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
  .detail__count { grid-row: span 3; margin: 0; flex-direction: column; gap: 4px; }
  .detail__count [data-d-index] { font-size: 34px; }
  .detail__title { font-size: 16px; min-height: 0; margin: 0 0 6px; }
  .detail__credit { border: 0; padding: 0; margin: 0 0 8px; }
  .detail__blurb { grid-column: 2; }
  .spiral__detail .pill { grid-column: 2; justify-self: start; }
  .spiral__rail, .spiral__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spiral__grain, .outro::after { animation: none; }
  .spiral__detail { transition: none; }
}

.spiral__head.is-on { opacity: 1; }
.spiral__list { position: relative; z-index: 1; background: var(--bg); }

/* ---- album title (top-left of the pinned piece) ---- */
.album-title { top: 84px; right: auto; }
.album-title__name {
  margin: 0; color: var(--ink);
  font: 900 clamp(40px, 4.4vw, 84px)/.88 var(--wide); font-stretch: 125%; letter-spacing: -.02em; text-transform: uppercase;
  text-shadow: 0 2px 30px rgba(0,0,0,.55);
}
.album-title__name span { display: block; }
.album-title__sub { margin: 12px 0 0; color: var(--muted); font: 800 12px/1.2 var(--wide); font-stretch: 125%; letter-spacing: .08em; text-transform: uppercase; }
/* anything that would touch Norm's face hides at once (no fade-out), then fades back in when clear */
.album-title.is-clear-off, .spiral__detail.is-clear-off, .nav__links.is-clear-off { opacity: 0 !important; transition: none !important; pointer-events: none !important; }
.nav__links { transition: opacity .5s; }
/* the ghost name sits below the title block so they never overlap */
.spiral__ghost { top: max(27vh, 250px); }
@media (max-width: 768px) {
  .spiral__head.album-title { display: block; top: 60px; }
  .album-title__name { font-size: 20px; }
  .album-title__sub { margin-top: 7px; font-size: 11px; line-height: 1.3; max-width: 150px; }
  .spiral__ghost { top: 17vh; }
}

/* hand-off to the players: panel, rail, hint and title clear away while Norm stays */
.hero__stage.is-handoff .spiral__head, .hero__stage.is-handoff .spiral__detail,
.hero__stage.is-handoff .spiral__rail, .hero__stage.is-handoff .spiral__hint { opacity: 0 !important; transition: opacity .5s; pointer-events: none; }

/* ---- stage 3: spiral feel ---- */
/* desktop: hovering the front screen clears its glass */
@media (hover: hover) {
  .card.is-front .card__dim { transition: opacity .35s; }
  .card.is-front:hover .card__dim { opacity: 0 !important; }
  .card.is-front .card__glass::before { transition: opacity .35s; }
  .card.is-front:hover .card__glass::before { opacity: .55; }
  .card.is-front:hover { box-shadow: -1px 0 0 rgba(255, 60, 120, .45), 1px 0 0 rgba(60, 200, 255, .6), 0 0 0 1px rgba(47,140,255,.45), 0 20px 50px rgba(0,0,0,.55); }
}
/* back / next arrows: phones only (desktop has the rail and the arrow keys) */
.detail__step { display: none; }
@media (max-width: 768px) {
  .hero.show { height: 820vh; }
  .detail__count { grid-row: span 4; }
  .detail__step { display: flex; gap: 6px; margin-top: 8px; }
  .detail__step button {
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.05); color: var(--ink); font: 400 20px/1 "Inter", system-ui, sans-serif;
  }
  .detail__step button:active { background: var(--accent); color: #05070a; }
  .spiral__detail { grid-template-columns: auto 1fr; }
  .detail__count { grid-column: 1; grid-row: 1 / span 3; }
  .detail__step { grid-column: 1; grid-row: 4; }
}

/* ---- short landscape screens (phones held sideways): compact title + panel so nothing piles up ---- */
@media (orientation: landscape) and (max-height: 520px) {
  .album-title { top: 58px; }
  .album-title__name { font-size: 26px; }
  .album-title__sub { margin-top: 6px; }
  .spiral__detail { top: 58px; width: 210px; right: calc(var(--gutter) + 30px); }
  .detail__count { margin-bottom: 6px; }
  .detail__count [data-d-index] { font-size: 26px; }
  .detail__title { font-size: 15px; min-height: 0; margin-bottom: 4px; }
  .detail__credit { margin-bottom: 8px; padding-bottom: 8px; }
  .spiral__hint { display: none; }
  /* back / next buttons on sideways phones too: top-right of the panel, next to the track number */
  .detail__step { display: flex; gap: 6px; position: absolute; top: -4px; right: 0; margin: 0; }
  .detail__step button {
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.05); color: var(--ink); font: 400 20px/1 "Inter", system-ui, sans-serif;
  }
  .detail__step button:active { background: var(--accent); color: #05070a; }
}
/* narrower sideways phones use the phone panel: move it from the bottom (where it reaches his head) to the top-right corner */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 768px) {
  .spiral__detail { top: 58px; bottom: auto; left: auto; right: var(--gutter); width: 200px; padding: 10px 12px; display: block; }
  .detail__count { flex-direction: row; gap: 8px; margin: 0 0 6px; }
  .detail__step { top: 8px; right: 10px; }
}
