/* MEGGED — site layout. The VHS/glitch look lives in fx/, not here.
   Palette + type taken from the "The In-Between" cover. */
@font-face { font-family: "Tiny5"; src: url("../fonts/tiny5.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "VT323"; src: url("../fonts/vt323.woff2") format("woff2"); font-display: swap; }
:root {
  --black: #121212;          /* cover background: neutral near-black */
  --white: #f7f8fa;          /* cover white */
  --dim: #b4b6bb;
  --glow: 255, 255, 255;     /* white halo around the rabbits and titles */
  --glow-cool: 200, 215, 255; /* faint cool edge on the outer halo */
  --orange: #e8643a;
  --blue: #3d6bff;
  --display: "Tiny5", "VT323", ui-monospace, monospace;
  --mono: "VT323", ui-monospace, monospace;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --nav-h: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--black); color: var(--white); }
body { font-family: var(--body); -webkit-font-smoothing: antialiased; }

/* Everything scrolls inside #stage so the FX layer can treat it as one picture */
#stage {
  position: fixed;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  background: var(--black);
}

a { color: inherit; }
a:focus-visible { outline: 1px solid var(--white); outline-offset: 4px; }

/* ---------- platform icons ---------- */
.platforms {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--nav-h);
  margin-bottom: calc(var(--nav-h) * -1);
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 4vw, 34px);
}
.platforms a { display: block; width: 20px; height: 20px; opacity: .92; transition: opacity .15s, transform .15s; }
.platforms a.wide { width: 34px; }
.platforms a:hover { opacity: 1; transform: translateY(-1px); }
.platforms svg { display: block; width: 100%; height: 100%; fill: var(--white); filter: drop-shadow(0 0 3px rgba(var(--glow), .8)) drop-shadow(0 0 10px rgba(var(--glow), .35)); }
.platforms a.wide svg { transform: scale(1.7); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero > * { grid-area: 1 / 1; }

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--white);
  width: clamp(250px, 48vw, 820px);   /* ≈ a quarter of the frame */
  filter: drop-shadow(0 0 2px rgba(var(--glow), .55)) drop-shadow(0 0 18px rgba(var(--glow), .4)) drop-shadow(0 0 60px rgba(var(--glow-cool), .25));
  user-select: none;
}
.wordmark svg { display: block; width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.about p, .tech { text-shadow: 0 0 12px rgba(var(--glow), .25); }

.rabbit {
  height: min(78vh, 120vw);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(var(--glow), .55)) drop-shadow(0 0 40px rgba(var(--glow), .25)) drop-shadow(0 0 80px rgba(var(--glow-cool), .15));
  visibility: hidden;
}
.is-off { visibility: hidden !important; }
.is-on  { visibility: visible !important; }

/* play button: sits just right of the wordmark (below it on narrow screens) */
.play-btn {
  z-index: 2;
  width: 44px; height: 44px;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--white);
  transform: translateX(calc(clamp(250px, 48vw, 820px) / 2 + 48px));
  filter: drop-shadow(0 0 3px rgba(var(--glow), .9)) drop-shadow(0 0 16px rgba(var(--glow), .45));
  opacity: .9; transition: opacity .15s;
}
.play-btn:hover { opacity: 1; }
.play-btn svg { width: 26px; height: 31px; fill: currentColor; margin: auto; display: block; }
.play-btn .i-pause, .play-btn.is-playing .i-play { display: none; }
.play-btn.is-playing .i-pause { display: block; }
@media (max-width: 640px) {
  .play-btn { transform: translateY(calc(clamp(250px, 48vw, 820px) * 26 / 163 / 2 + 44px)); }
}

/* ---------- while the track plays (js/music.js) ---------- */
/* --txt: title opacity per part of the track; --sm: kick smear 0..1 */
html.music-on .wordmark {
  opacity: var(--txt, 1);
  filter: drop-shadow(0 0 2px rgba(var(--glow), .55)) drop-shadow(0 0 18px rgba(var(--glow), .4))
          drop-shadow(calc(var(--sm, 0) * 26px) calc(var(--sm, 0) * -10px) calc(var(--sm, 0) * 4px) rgba(232, 100, 58, .85))
          drop-shadow(calc(var(--sm, 0) * -26px) calc(var(--sm, 0) * 10px) calc(var(--sm, 0) * 4px) rgba(61, 107, 255, .85));
}

/* trip-in: the title tears apart like a VHS losing its signal (js/music.js tripIn) */
.trip-glitch { position: relative; width: clamp(250px, 48vw, 820px); pointer-events: none; will-change: transform, filter, opacity; }
.trip-band { position: absolute; inset: 0; mix-blend-mode: screen; will-change: transform; }
.trip-band:first-child { position: relative; }
.trip-band svg { display: block; width: 100%; height: auto; }
.trip-o { color: rgb(232, 100, 58); }
.trip-w { color: #fff; }
.trip-b { color: rgb(61, 107, 255); }
html.trip .wordmark { visibility: hidden !important; }
html.trip .rabbit { visibility: hidden !important; }
html.scene-weird .rabbit { opacity: .3; filter: blur(2px) drop-shadow(0 0 20px rgba(var(--glow), .4)); }

/* ?sync tuning panel */
.sync-panel {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2147483001;
  display: flex; gap: 10px; align-items: center; padding: 6px 10px;
  background: rgba(0,0,0,.75); border: 1px solid #444; border-radius: 6px;
  font-family: var(--mono); font-size: 20px; color: var(--white);
}
.sync-panel button { font: inherit; color: inherit; background: #222; border: 1px solid #555; border-radius: 4px; width: 34px; cursor: pointer; }

.scroll-cue {
  align-self: end;
  margin-bottom: 22px;
  font-size: 18px;
  text-decoration: none;
  opacity: .55;
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue { 50% { transform: translateY(6px); opacity: .9; } }

/* ---------- EPK text ---------- */
.about {
  display: grid;
  gap: 1em;
  max-width: 980px;
  margin: 0 auto;
  padding: 6vh 20px 4vh;
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.6;
  font-weight: 400;
  font-stretch: 110%;
  font-variation-settings: "wdth" 110;
  color: var(--white);
  text-wrap: pretty;
}
.about p { margin: 0; }

/* ---------- media ---------- */
.media {
  display: grid;
  gap: 28px;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 10vh 20px;
}
.videos { display: grid; gap: 10px; grid-template-columns: 1fr; }
.video-link { justify-self: end; font-family: var(--mono); font-size: 20px; color: var(--dim); text-decoration: none; }
.video-link:hover { color: var(--white); }
.video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #191919; border: 1px solid #2a2a2a; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.placeholder {
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 20px; letter-spacing: .08em; color: var(--dim);
  border-style: dashed; border-color: #3a3a3a;
}
.spotify-top { padding-bottom: 0; }
#listen { padding-top: 28px; padding-bottom: 0; }
.spotify iframe { display: block; border: 0; border-radius: 12px; }

/* ---------- technical details ---------- */
.tech {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 40px;
  padding: 14vh 20px calc(48px + env(safe-area-inset-bottom, 0px));
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: .04em;
  color: var(--dim);
}
.tech a { text-decoration: none; }
.tech a:hover { color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  /* play button: sits just right of the wordmark (below it on narrow screens) */
.play-btn {
  z-index: 2;
  width: 44px; height: 44px;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--white);
  transform: translateX(calc(clamp(250px, 48vw, 820px) / 2 + 48px));
  filter: drop-shadow(0 0 3px rgba(var(--glow), .9)) drop-shadow(0 0 16px rgba(var(--glow), .45));
  opacity: .9; transition: opacity .15s;
}
.play-btn:hover { opacity: 1; }
.play-btn svg { width: 26px; height: 31px; fill: currentColor; margin: auto; display: block; }
.play-btn .i-pause, .play-btn.is-playing .i-play { display: none; }
.play-btn.is-playing .i-pause { display: block; }
@media (max-width: 640px) {
  .play-btn { transform: translateY(calc(clamp(250px, 48vw, 820px) * 26 / 163 / 2 + 44px)); }
}

/* quiet part of the track: no flashes, the title melts into old-TV snow */
html.music-quiet .rabbit { visibility: hidden !important; }
html.music-quiet .wordmark {
  visibility: visible !important;
  opacity: .5;
  filter: blur(2.5px) drop-shadow(16px 0 5px rgba(255,255,255,.35)) drop-shadow(-16px 0 5px rgba(255,255,255,.35)) drop-shadow(0 0 30px rgba(var(--glow), .3));
  animation: snow-drift .23s steps(2) infinite;
  transition: opacity .6s, filter .6s;
}
html.music-quiet .fx-noise { opacity: .42 !important; transition: opacity .6s; }
@keyframes snow-drift { 0% { transform: translateX(-3px); } 50% { transform: translateX(4px) skewX(-2deg); } }

.scroll-cue { animation: none; }
  #stage { scroll-behavior: auto; }
}

/* ---------- music story: mirror ghosts, strobe, finale zoom ---------- */
.rabbit-ghost { opacity: .45; pointer-events: none; filter: blur(1px) drop-shadow(0 0 30px rgba(var(--glow-cool), .35)); }
.rabbit-ghost.ghost-l { transform: translateX(-58%) scaleX(-1); }
.rabbit-ghost.ghost-r { transform: translateX(58%) scaleX(-1); }
.strobe {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: #fff; mix-blend-mode: screen;
  animation: strobe-out 120ms linear forwards;
}
@keyframes strobe-out { from { opacity: var(--so, .55); } to { opacity: 0; } }
html.scene-finale .hero > .wordmark,
html.scene-finale .hero > .rabbit { scale: var(--zoom, 1); }
@media (prefers-reduced-motion: reduce) { .strobe { display: none; } }
.preview-note { margin: .6rem auto 0; max-width: 40rem; font-size: .8rem; opacity: .7; text-align: center; }
.preview-note a { color: inherit; }
/* phones: the music visuals play as a video over the hero */
.music-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; background: #121212; opacity: 0; transition: opacity .25s; pointer-events: none; }
html.video-on .music-video { opacity: 1; }
html.video-on #stage { filter: none !important; }
html.video-on #fx-overlay { display: none; }
html.video-on .hero .wordmark, html.video-on .hero .rabbit { visibility: hidden !important; }
/* rabbits leaving the screen (js/intro.js, while the music plays) */
.rx-fade   { animation: rx-fade 110ms linear forwards; }
.rx-slice  { animation: rx-slice 90ms steps(3) forwards; }
.rx-squash { animation: rx-squash 100ms cubic-bezier(.6, 0, 1, .4) forwards; }
.rx-tear   { animation: rx-tear 90ms steps(4) forwards; }
@keyframes rx-fade { to { opacity: 0; } }
@keyframes rx-slice {
  0%   { clip-path: inset(0 0 0 0); translate: 0 0; }
  50%  { clip-path: inset(30% 0 45% 0); translate: 6% 0; }
  100% { clip-path: inset(49% 0 49% 0); translate: -9% 0; }
}
@keyframes rx-squash {
  0%   { scale: 1 1; filter: brightness(1); }
  100% { scale: 1.5 .01; filter: brightness(4); opacity: .6; }
}
@keyframes rx-tear {
  0%   { translate: 0 0; filter: drop-shadow(6px 0 0 rgba(var(--fx-orange), .9)) drop-shadow(-6px 0 0 rgba(var(--fx-blue), .9)); }
  100% { translate: 14% 0; opacity: 0; filter: drop-shadow(40px 0 0 rgba(var(--fx-orange), .9)) drop-shadow(-40px 0 0 rgba(var(--fx-blue), .9)) blur(2px); }
}
