/* The Party film as a scrollable tour. The artwork can move independently
   of the copy; reading and operating every scene works without animation. */
.tour {
  --tour-gutter: clamp(1.125rem, 4vw, 4.5rem);
  --tour-rule: var(--border-width) solid var(--color-border);
  --tour-nav-height: calc(var(--size-control-large) + var(--space-2));
  container-type: inline-size;
  overflow-x: clip;
}
.tour-width {
  width: min(100% - 2 * var(--tour-gutter), 77rem);
  margin-inline: auto;
}
.tour-hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: clip;
  background: radial-gradient(ellipse at 88% 75%, var(--color-glow-secondary), transparent 64%),
    linear-gradient(120deg, var(--color-bg) 38%, var(--color-primary-soft));
}
.tour-top, .tour-brand, .tour-account, .tour-user, .tour-actions, .tour-link,
.tour-window figcaption, .tour-nav .tour-width, .tour-close .tour-width {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.tour-top { justify-content: space-between; gap: var(--space-2); padding-block: var(--space-4); }
.tour-brand { gap: var(--space-2); font-size: var(--text-lg); font-weight: var(--weight-bold); letter-spacing: -.055em; }
.tour-brand img { object-fit: contain; }
.tour-account { flex-wrap: wrap; justify-content: flex-end; font-size: var(--text-sm); }
.tour-user { gap: var(--space-2); color: var(--color-fg); }
.tour-hero__stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  position: relative;
  min-height: 0;
}
.tour-hero__copy { position: relative; z-index: 1; padding-block: var(--space-5) calc(var(--space-6) * 1.75); }
.tour-down {
  position: absolute;
  bottom: var(--space-4);
  left: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--size-control);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.tour-down:hover { color: var(--color-primary-deep); }
.tour-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-primary-deep);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
}
.tour-label::before { content: ""; width: 1.65rem; height: 2px; flex: none; background: currentColor; }
.tour-label span { color: var(--color-muted); }
.tour-hero h1, .tour-copy h2, .tour-close h2 {
  font-weight: var(--weight-bold);
  letter-spacing: -.055em;
  line-height: 1.09;
  text-wrap: balance;
}
.tour-hero h1 { margin-block: var(--space-4); font-size: clamp(3.3rem, 6.25cqw, 6.2rem); }
.tour-hero em { display: block; color: var(--color-primary-deep); font-style: normal; }
.tour-intro, .tour-copy > p:not(.tour-label) { color: var(--color-muted); line-height: 1.7; }
.tour-intro { max-width: 34em; font-size: clamp(1.06rem, 1.65cqw, 1.35rem); text-wrap: balance; }
.tour-actions { flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
.tour-hero__art { position: relative; align-self: stretch; isolation: isolate; }
.tour-disc {
  position: absolute;
  width: 104%;
  aspect-ratio: 1;
  left: 7%;
  top: 50%;
  translate: 0 -46%;
  border: var(--border-width) solid var(--color-border);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 9%, var(--color-glow-secondary) 9.1% 9.4%, transparent 9.5% 10%),
    conic-gradient(from 130deg, var(--color-glow-secondary), var(--color-surface-raised), var(--color-primary-soft), var(--color-surface-raised), var(--color-glow-secondary));
  box-shadow: 0 0 0 1.4rem var(--color-glow-secondary), 0 0 0 1.45rem var(--color-border);
}
.tour-hero__sakura { position: absolute; right: -5%; bottom: 0; width: 114%; height: 103%; object-fit: contain; object-position: bottom; }
.tour-record {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: absolute;
  bottom: 6%;
  left: -3%;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
  border: var(--tour-rule);
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-menu);
}
.tour-record > .icon { box-sizing: content-box; padding: var(--space-3); border-radius: 50%; background: var(--color-video); color: var(--color-overlay-pink); }
.tour-record small, .tour-record strong { display: block; }
.tour-record small { color: var(--color-muted); font-size: var(--text-xs); }
.tour-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  height: var(--tour-nav-height);
  border-block: var(--tour-rule);
  background: var(--color-bg);
}
.tour-nav .tour-width { height: 100%; gap: clamp(.9rem, 3cqw, 3rem); overflow-x: auto; }
.tour-nav a { display: inline-flex; align-self: stretch; align-items: center; flex: none; color: var(--color-muted); font-weight: var(--weight-semibold); font-size: var(--text-sm); text-decoration: none; }
.tour-nav a:is(:hover, :focus-visible), .tour-link:hover { color: var(--color-primary-deep); text-decoration: underline; }
.tour-nav a:focus-visible { outline-offset: -3px; }
.tour [id] { scroll-margin-top: var(--tour-nav-height); }
.tour-scene {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2rem, 5.2cqw, 5.4rem);
  padding-block: clamp(3.75rem, 7cqw, 7rem);
}
.tour-copy { display: grid; justify-items: start; gap: var(--space-3); }
.tour-copy h2, .tour-close h2 { font-size: clamp(2.1rem, 3.75cqw, 3.85rem); }
.tour-copy > p:not(.tour-label) { max-width: 42em; font-size: clamp(1rem, 1.35cqw, 1.17rem); }
.tour-link { gap: var(--space-2); font-weight: var(--weight-semibold); }
.tour-mat, .tour-screen, .tour-broadcast { position: relative; overflow: clip; border-radius: var(--radius); }
.tour-mat {
  display: grid;
  place-items: center;
  min-height: clamp(16.5rem, 28cqw, 24rem);
  padding: clamp(1.4rem, 3.6cqw, 3.2rem);
  border: var(--tour-rule);
  background-color: var(--color-surface);
}
.tour-mat--credit {
  background-image: radial-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(125deg, var(--color-glow-secondary), var(--color-primary-soft));
  background-size: 13px 13px, 100% 100%;
}
.tour-window, .tour-credit {
  width: 100%;
  max-width: 32rem;
  margin: 0;
  overflow: hidden;
  border: var(--tour-rule);
  border-radius: var(--radius);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-menu);
}
.tour-window figcaption { min-height: var(--size-control); gap: var(--space-2); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.tour-window figcaption .icon { color: var(--color-primary-deep); }
.tour-window img, .tour-credit img, .tour-screen video, .tour-trailer img, .tour-broadcast > img { display: block; width: 100%; height: auto; }
.tour-edge { color: var(--color-on-video); background: var(--color-video); }
.tour-edge .tour-label { color: var(--color-overlay-pink); }
.tour-edge .tour-copy > p:not(.tour-label) { color: var(--color-overlay-muted); }
.tour-screen, .tour-broadcast { aspect-ratio: 16 / 9; background: var(--color-video); }
.tour-trailer { display: block; position: relative; width: 100%; padding: 0; border: 0; background: var(--color-video); cursor: pointer; }
.tour-trailer > span { display: inline-flex; align-items: center; gap: var(--space-2); position: absolute; bottom: 7%; left: 5%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill); background: var(--color-on-video); color: var(--color-video); font-weight: var(--weight-semibold); }
.tour-trailer:focus-visible { outline-offset: -4px; }
.tour-broadcast { container-type: inline-size; isolation: isolate; }
.tour-broadcast > img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.tour-broadcast-scene { padding-block: clamp(3rem, 6cqw, 6rem); border-top: var(--tour-rule); background: var(--color-surface); }
.tour-broadcast-head { grid-template-columns: 1fr auto; align-items: end; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.tour-broadcast-head .tour-label, .tour-broadcast-head h2 { grid-column: 1/-1; }
.tour-broadcast-head button { justify-self: end; }
.tour-broadcast-scene .tour-broadcast { max-height: 66svh; box-shadow: var(--shadow-menu); margin-inline: auto; }
/* The broadcast component uses rems for a full-size OBS source. Scale its
   plates as a unit, preserving its actual typography, layout and locale. */
.tour-broadcast .overlay-playlist {
  position: absolute;
  inset: 5% auto auto 4%;
  width: 30rem;
  transform-origin: top left;
  scale: .5;
}
@container (min-width: 45rem) {
  .tour-broadcast .overlay-playlist { scale: .65; }
}
@container (max-width: 30rem) {
  .tour-broadcast .overlay-playlist { scale: .4; }
}
@container (max-width: 21rem) {
  .tour-broadcast .overlay-playlist { scale: .33; }
}
.tour-edge { background: radial-gradient(at 70% 120%, var(--color-overlay-plate), var(--color-video)); }
.tour-network { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.tour-network span { display: grid; justify-items: center; gap: var(--space-2); font-weight: var(--weight-semibold); }
.tour-network .icon { box-sizing: content-box; padding: var(--space-3); border: var(--border-width) solid var(--color-overlay-track); border-radius: 50%; color: var(--color-overlay-blue); }
.tour-network span:nth-of-type(2) .icon { color: var(--color-overlay-pink); border-color: currentColor; }
.tour-network i { height: 1px; flex: 1; margin-bottom: 1.6rem; background: linear-gradient(90deg, var(--color-overlay-blue), var(--color-overlay-pink)); }
.tour-close { padding-block: clamp(3rem, 6cqw, 6rem); background: var(--color-primary-soft); }
.tour-close .tour-width { flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); }

@media (prefers-reduced-motion: no-preference) {
  html:has(.tour) { scroll-behavior: smooth; }
  /* Keep the performance still while the actual OBS plates and setlist arrive. */
  .tour-broadcast .overlay-now { --slide-x: -75%; --slide-y: 0%; --start: 5%; --end: 40%; --delay: 0s; }
  .tour-broadcast .overlay-history { --slide-x: -42%; --slide-y: 12%; --start: 22%; --end: 55%; --delay: .12s; }
  .tour-broadcast .overlay-history__row { --slide-x: -12%; --slide-y: 36%; --start: 38%; --end: 65%; --delay: .23s; }
  .tour-broadcast .overlay-history__row + .overlay-history__row { --start: 49%; --end: 76%; --delay: .31s; }
  @supports (animation-timeline: view()) {
    .tour-broadcast { view-timeline-name: --broadcast; view-timeline-inset: var(--tour-nav-height) 0px; }
    .tour-broadcast :is(.overlay-now, .overlay-history, .overlay-history__row) {
      animation: tour-playlist-in var(--ease-out) both;
      animation-timeline: --broadcast;
      animation-range: entry var(--start) entry var(--end);
    }
    .tour-hero { view-timeline-name: --hero; }
    .tour-disc, .tour-hero__sakura, .tour-record {
      animation: tour-drift linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
    }
    .tour-disc { --tour-drift: 44%; }
    .tour-hero__sakura { --tour-drift: 20%; }
    .tour-record { --tour-drift: -80%; }

    /* Anchor text to its untransformed column. The label leads the headline,
       then the description. Opposite columns enter from opposite sides. */
    .tour-scene { --tour-text-x: -2rem; --tour-art-x: 3.25rem; }
    .tour-recognition, .tour-broadcast-scene { --tour-text-x: 0rem; }
    .tour-copy { view-timeline-name: --copy; }
    .tour-copy > * {
      animation: tour-copy-in linear both;
      animation-timeline: --copy;
      animation-range: entry 0% cover 32%;
    }
    .tour-copy > h2 { animation-range: entry 3% cover 36%; }
    .tour-copy > :nth-child(n+3) { animation-range: entry 9% cover 39%; }
    .tour-scene > :not(.tour-copy) {
      animation: tour-stage-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 43%;
    }
    .tour-mat { view-timeline-name: --panel; }
    .tour-credit {
      animation: tour-lift linear both;
      animation-timeline: --panel;
      animation-range: entry 0% exit 100%;
    }
  }
  @supports not (animation-timeline: view()) {
    .tour-broadcast :is(.overlay-now, .overlay-history, .overlay-history__row) {
      transition: opacity .4s var(--delay), transform .52s var(--ease-out) var(--delay);
    }
    .tour-broadcast.tour-waiting :is(.overlay-now, .overlay-history, .overlay-history__row) {
      opacity: 0; transform: translate(var(--slide-x), var(--slide-y));
    }
    .tour-scene > * { transition: opacity .55s, transform .7s var(--ease-out); }
    .tour-scene > .tour-waiting { opacity: .12; transform: translateY(var(--space-6)); }
    .tour-scene > .tour-waiting:not(.tour-copy) { transform: translateY(calc(var(--space-6) * 1.5)) scale(.95); }
  }
}
@keyframes tour-playlist-in {
  from { opacity: 0; transform: translate(var(--slide-x), var(--slide-y)); }
  to { opacity: 1; transform: none; }
}
@keyframes tour-drift { to { transform: translateY(var(--tour-drift)); } }
@keyframes tour-copy-in {
  from { opacity: .08; transform: translate(var(--tour-text-x), var(--space-5)); }
  to { opacity: 1; transform: none; }
}
@keyframes tour-stage-in {
  from { opacity: .12; transform: translate(var(--tour-art-x), calc(var(--space-6) * 1.5)) scale(.93); }
  to { opacity: 1; transform: none; }
}
@keyframes tour-lift { from { translate: 0 7%; } to { translate: 0 -6%; } }

@container (max-width: 47rem) {
  .tour-hero__stage { grid-template-columns: 1fr; grid-template-rows: auto minmax(min-content, 1fr) auto; }
  .tour-hero__copy { padding: var(--space-4) 0 var(--space-2); }
  .tour-hero h1 { margin-block: var(--space-3); }
  .tour-hero__art { justify-self: end; width: min(100%, 32rem); min-height: clamp(15rem, 62cqw, 21rem); }
  .tour-down { position: static; justify-self: start; padding-block: var(--space-2); }
  .tour-hero__sakura { right: -7%; width: 100%; }
  .tour-disc { width: 83%; left: 20%; }
  .tour-record { left: 2%; }
  .tour-scene { grid-template-columns: 1fr; gap: var(--space-4); padding-block: var(--space-6); }
  .tour-scene { --tour-text-x: -.5rem; --tour-art-x: .875rem; }
  .tour-broadcast-head { grid-template-columns: 1fr; }
  .tour-broadcast-head button { justify-self: start; }
  .tour-mat { min-height: 0; }
  .tour-copy h2, .tour-close h2 { font-size: clamp(1.95rem, 7cqw, 3rem); }
  .tour-network { width: min(100%, 30rem); margin: auto; }
}
@media (max-width: 640px) {
  .tour-hero { min-height: calc(100vh - var(--size-header)); min-height: calc(100dvh - var(--size-header)); padding-bottom: calc(var(--size-header) + env(safe-area-inset-bottom)); }
  .tour-top { display: none; } /* Account, sign-in and wordmark are in the phone's top strip. */
  .tour-hero__copy { padding-top: var(--space-5); }
  .tour-nav { top: var(--size-header); }
  .tour-broadcast { view-timeline-inset: calc(var(--size-header) + var(--tour-nav-height)) calc(var(--size-header) + env(safe-area-inset-bottom)); }
  .tour [id] { scroll-margin-top: calc(var(--size-header) + var(--tour-nav-height)); }
  .tour-close { padding-bottom: calc(var(--space-6) + var(--size-header) + env(safe-area-inset-bottom)); }
}
