/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #e63b2f;
  --white: #ffffff;
  --grey: #888888;
  --dark-overlay: rgba(0, 0, 0, 0.92);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

html { scroll-behavior: auto; }

/* Mobile preloader: block scroll so swipes cannot scrub video / hijack the load bar */
html.tech9-preloader,
html.tech9-preloader body {
  overflow: hidden;
  height: 100%;
  touch-action: none;
}

body {
  background: #000;
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: default;
}

/* ─── Canvas (fixed, full viewport) ────────────────────────── */
#canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  display: block;
  pointer-events: none; /* don’t intercept touch scroll through pointer-events:none intro layers */
}

/* Scrub/canvas source: NOT display:none — Mobile Safari often never loads/decodes
   hidden video, so boot waits forever on the loading screen. */
.tech9-source-video--hidden {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 4px;
  height: 4px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Whole-block mask feathers the bottom. Stops use WHITE + alpha so Safari/WebKit
   luminance masks treat “solid” as visible; black (#000) masks read as fully
   transparent there and can hide the entire clip (MDN: mask-mode / WebKit quirk). */
.site-header-video {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  z-index: 1;
  overflow: hidden;
  background: #000;
  pointer-events: none;
  isolation: isolate;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 42%,
    rgba(255, 255, 255, 0.92) 58%,
    rgba(255, 255, 255, 0.55) 74%,
    rgba(255, 255, 255, 0.2) 88%,
    rgba(255, 255, 255, 0) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 42%,
    rgba(255, 255, 255, 0.92) 58%,
    rgba(255, 255, 255, 0.55) 74%,
    rgba(255, 255, 255, 0.2) 88%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Lighten-to-dark vignette on the video only (gradient paint — composites with the mask) */
.site-header-video::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(0, 0, 0, 0.25) 65%,
    rgba(0, 0, 0, 0.55) 85%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

.hero-scroll-spacer {
  min-height: 100vh;
  pointer-events: none;
}

.site-header-video__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ─── Loader ────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loader-name {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 8rem);
  letter-spacing: 0.15em;
  color: var(--white);
  opacity: 0.9;
}

.loader-bar {
  width: 200px;
  height: 1px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

html.tech9-preloader .loader-bar-fill {
  transition: none;
}

/* ─── Hero Overlay ─────────────────────────────────────────── */
#hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  padding-left: 8vw;
  opacity: 0; /* desktop: JS fades in; mobile: see @media block */
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.hero-pre {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  letter-spacing: 0.6em;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(7rem, 16vw, 15rem);
  line-height: 0.88;
  letter-spacing: 0.03em;
  color: var(--white);
}

.hero-sub {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.8vw, 1.1rem);
  letter-spacing: 0.5em;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 8vw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  opacity: 0.4;
}

.hero-scroll-hint span {
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  font-weight: 500;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--white), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ─── Scroll Container ─────────────────────────────────────── */
#scroll-container {
  position: relative;
  z-index: 20;
  padding-top: 0;
  min-height: 780vh;    /* +~100vh for fullscreen intro vs thin strip; scrub + merch room */
}

/* ─── Sections ─────────────────────────────────────────────── */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 8vw;
  position: relative;
}

/* All sections: text hugs left, stays within the black left zone */
.section--left .section-inner {
  margin-right: auto;
  max-width: clamp(300px, 44%, 560px);
}

.section-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#merch.section--left .merch-section-inner {
  max-width: min(760px, 96vw);
}

#merch-root {
  width: 100%;
  position: relative;
  z-index: 1;
}

.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0.03em;
  color: var(--white);
  will-change: transform, opacity;
}

.section-body {
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  font-weight: 300;
  max-width: 38ch;
}

/* ─── Dark Overlay Section ─────────────────────────────────── */
.section--dark-overlay {
  background: var(--dark-overlay);
  padding-top: 8vh;
  padding-bottom: 8vh;
  min-height: auto;
}

/* ─── Stats ────────────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 4vw;
  justify-content: flex-start;
  margin: 1.5rem 0;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.stat-label {
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

/* ─── Show List ─────────────────────────────────────────────── */
.show-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.show-item {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-bottom: -1px;
}

.show-date {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  min-width: 110px;
  font-weight: 500;
}

.show-venue {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.75);
  flex: 1;
  font-weight: 400;
}

.show-tickets {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--white);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.5rem 1rem;
  transition: border-color 0.2s, color 0.2s;
}

.show-tickets:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Track List ────────────────────────────────────────────── */
.track-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.5rem;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
}

.track-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: rgba(255,255,255,0.15);
  min-width: 2ch;
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.track-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  letter-spacing: 0.05em;
  color: var(--white);
}

.track-meta {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.35);
  font-weight: 300;
}

.track-tag {
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  font-weight: 500;
  border: 1px solid var(--accent);
  padding: 0.3rem 0.7rem;
}

/* ─── CTA Button ───────────────────────────────────────────── */
.cta-btn {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: #000;
  background: var(--white);
  text-decoration: none;
  padding: 1.1rem 2.5rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  align-self: flex-start;
  margin-top: 0.5rem;
}

.cta-btn:hover {
  background: var(--accent);
  color: var(--white);
}

/* ─── Social Links ─────────────────────────────────────────── */
.social-links {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.social-link {
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: color 0.2s;
}

.social-link:hover { color: var(--white); }

/* ─── Marquee ───────────────────────────────────────────────── */
#marquee-wrap {
  overflow: hidden;
  padding: 5rem 0 3rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

#marquee {
  display: flex;
  width: max-content;
  white-space: nowrap;
}

#marquee span {
  font-family: var(--font-display);
  font-size: clamp(8rem, 12vw, 12rem);
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.06);
  text-transform: uppercase;
  line-height: 1;
  padding-right: 2rem;
}

/* ─── Footer ────────────────────────────────────────────────── */
#footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 8vw;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: var(--white);
}

.footer-copy {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.25);
}

/* ─── Mobile ────────────────────────────────────────────────── */
@media (max-width: 768px) {

  #hero-overlay {
    z-index: 11;
  }

  /* Canvas is full-screen on mobile; drawFrame handles the left
     "safe zone" gradient so the video never bleeds behind text.
     Sections stay transparent — no dark backgrounds anywhere. */

  /* Hero: left-aligned, text stays in the safe zone (< 50% width) */
  #hero-overlay {
    padding-left: 5vw;
    align-items: flex-start;
  }

  .hero-title { font-size: clamp(3.5rem, 16vw, 6rem); }

  .hero-scroll-hint {
    left: 5vw;
    transform: none;
  }

  /* Shorter scroll on mobile */
  #scroll-container {
    min-height: 620vh;
  }

  /* Sections: transparent, normal padding */
  .section { padding: 5rem 5vw; min-height: auto; }

  /* Text column stays within the left black zone (< 42% of viewport).
     The video is in the right 58%, so text must not cross the 42% mark. */
  .section--left .section-inner {
    max-width: 41%;
    margin: 0;
  }

  #merch.section--left .merch-section-inner {
    max-width: min(94vw, 680px);
  }

  /* Headings fit inside the narrow column */
  .hero-title { font-size: clamp(3rem, 13vw, 4.5rem); }
  .section-heading { font-size: clamp(2rem, 9vw, 3.2rem); }
  .section-body    { font-size: 0.82rem; max-width: none; }
  .section-label   { font-size: 0.6rem; }

  /* Stats: wrap tightly */
  .stats-row { gap: 5vw; flex-wrap: wrap; }
  .stat-num  { font-size: clamp(2.5rem, 10vw, 4rem); }

  /* Show list: compact stacked rows */
  .show-item {
    flex-direction: column;
    gap: 0.3rem;
    align-items: flex-start;
    padding: 1rem 0;
  }
  .show-venue  { font-size: 0.75rem; }
  .show-date   { min-width: auto; }
  .show-tickets { margin-top: 0.4rem; }

  /* Track list */
  .track-title { font-size: clamp(1rem, 5vw, 1.3rem); }
  .track-item  { gap: 0.75rem; }

  /* CTA: full width */
  .cta-btn { align-self: stretch; text-align: center; }

  .social-links { flex-wrap: wrap; gap: 1.2rem; margin-top: 0.5rem; }

  /* Marquee */
  #marquee-wrap { padding: 2.5rem 0 1.5rem; }
  #marquee span { font-size: clamp(3.5rem, 12vw, 5rem); }

  /* Footer */
  #footer { flex-direction: column; gap: 0.75rem; text-align: center; padding: 1.5rem 5vw; }
}

/* ─── Merch standalone (/merch, /merch/track) ───────────────── */
.merch-shell-body {
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.merch-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 10;
}

.merch-shell-home-link {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0;
}

.merch-shell-home-link:hover {
  color: var(--accent);
}

.merch-shell-home-link--right {
  text-align: right;
}

.merch-shell-main {
  flex: 1;
  width: 100%;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 3rem;
}

.merch-shell-main--shop {
  max-width: 1420px;
  margin-inline: auto;
  /* Extra bottom space on phone so sticky CTA / home indicator never covers last card */
  padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom, 0px) + 1.25rem));
}
