:root{
  --void:#0A0512;
  --deep:#1A0B2E;
  --violet:#6E3FC4;
  --violet-bright:#9B5CF0;
  --lilac:#B393E0;
  --lavender:#E4D4F7;
  --mist:#F4EEFC;
  --flash:#F0E6FF;
  --font-display:'Unbounded', sans-serif;
  --font-serif:'Instrument Serif', serif;
  --font-mono:'Space Mono', monospace;
}

*{ margin:0; padding:0; box-sizing:border-box; }

html,body{
  width:100%; height:100%;
  background:var(--void);
  color:var(--mist);
  overflow:hidden;
  font-family:var(--font-display);
  cursor:none;
}

@media (max-width: 720px){
  html,body{ cursor:auto; }
  #cursor-glow{ display:none; }
}

::selection{ background:var(--violet); color:var(--mist); }

/* ============ CURSOR + PARTICLES ============ */
#cursor-glow{
  position:fixed; top:0; left:0; width:26px; height:26px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(155,92,240,0.9) 0%, rgba(155,92,240,0.15) 60%, transparent 75%);
  pointer-events:none;
  transform:translate(-50%,-50%);
  z-index:9999;
  transition:width .25s ease, height .25s ease, background .25s ease;
  mix-blend-mode:screen;
}
#cursor-glow.active{ width:54px; height:54px; }

#particles{
  position:fixed; inset:0; width:100%; height:100%;
  pointer-events:none; z-index:5;
  mix-blend-mode:screen;
}

/* ============ INTRO ============ */
#intro{
  position:fixed; inset:0; z-index:100;
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(110,63,196,0.35), transparent 60%),
    linear-gradient(180deg, var(--void) 0%, var(--deep) 100%);
  transition:opacity 1.4s ease, filter 1.4s ease;
}
#intro.leaving{ opacity:0; filter:blur(20px); pointer-events:none; }

.intro-noise{
  position:absolute; inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  opacity:0.6;
}

.intro-content{
  position:relative; text-align:center;
  display:flex; flex-direction:column; align-items:center; gap:18px;
  padding:0 24px;
}

.eyebrow{
  font-family:var(--font-mono); font-size:11px; letter-spacing:.25em;
  text-transform:uppercase; color:var(--lilac); opacity:.8;
}

.intro-title{
  font-size:clamp(3rem, 12vw, 7rem); font-weight:900;
  letter-spacing:-.02em; line-height:.95;
  background:linear-gradient(180deg, var(--mist) 20%, var(--lilac) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  filter:drop-shadow(0 0 40px rgba(155,92,240,.35));
}

.intro-artist{
  font-family:var(--font-serif); font-style:italic; font-size:clamp(1.1rem,3vw,1.6rem);
  color:var(--lavender); opacity:.85; margin-top:-10px;
}

.enter-btn{
  position:relative; margin-top:22px;
  background:transparent; border:1px solid rgba(228,212,247,.35);
  color:var(--mist); font-family:var(--font-mono); font-size:12px;
  letter-spacing:.2em; text-transform:uppercase;
  padding:18px 40px; border-radius:999px; cursor:pointer;
  overflow:hidden; transition:border-color .3s ease, transform .2s ease;
}
.enter-btn:hover{ border-color:var(--violet-bright); transform:scale(1.03); }
.enter-btn:active{ transform:scale(0.97); }
.enter-btn-ring{
  position:absolute; inset:0; border-radius:999px;
  background:radial-gradient(circle, rgba(155,92,240,.5), transparent 70%);
  opacity:0; transition:opacity .3s ease;
}
.enter-btn:hover .enter-btn-ring{ opacity:1; }
.enter-btn-label{ position:relative; z-index:1; }

.intro-hint{
  font-family:var(--font-mono); font-size:10px; letter-spacing:.1em;
  color:var(--lilac); opacity:.5; margin-top:6px;
}

/* ============ EXPERIENCE ============ */
#experience{
  position:fixed; inset:0; z-index:10; overflow:hidden;
}
#experience[hidden]{ display:none; }

#bg-video{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; z-index:1;
  transition:filter 1.8s ease, opacity 1.8s ease, transform 8s ease;
  filter:saturate(0.6) brightness(0.75);
}

#scene-tint{
  position:absolute; inset:0; z-index:2;
  background:var(--deep); mix-blend-mode:multiply; opacity:.55;
  transition:background 2s ease;
}

#vignette{
  position:absolute; inset:0; z-index:3; pointer-events:none;
  background:radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.75) 100%);
}

#grain{
  position:absolute; inset:0; z-index:4; pointer-events:none; opacity:.05;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation:grain-shift 1s steps(4) infinite;
}
@keyframes grain-shift{
  0%{ transform:translate(0,0); } 25%{ transform:translate(-2%,1%); }
  50%{ transform:translate(1%,-2%); } 75%{ transform:translate(-1%,-1%); }
  100%{ transform:translate(0,0); }
}

/* flash frame for high-intensity moments */
#experience.flash::after{
  content:''; position:fixed; inset:0; z-index:6;
  background:var(--flash); opacity:0;
  animation:flash-frame .18s ease-out;
}
@keyframes flash-frame{ 0%{opacity:.85;} 100%{opacity:0;} }

/* ============ LYRIC STAGE ============ */
#lyric-stage{
  position:absolute; inset:0; z-index:7;
  display:flex; align-items:center;
  padding:0 8vw;
  pointer-events:none;
}

.lyric-line{
  max-width:780px;
  font-family:var(--font-display); font-weight:700;
  font-size:clamp(1.8rem, 5vw, 3.6rem); line-height:1.15;
  color:var(--mist);
  text-shadow:0 0 30px rgba(155,92,240,.4);
}
.lyric-line .translation{
  display:block; margin-top:14px;
  font-family:var(--font-serif); font-style:italic; font-weight:400;
  font-size:.5em; color:var(--lilac); opacity:.85;
}
.lyric-line[data-pos="left"]{ margin-right:auto; text-align:left; }
.lyric-line[data-pos="right"]{ margin-left:auto; text-align:right; }
.lyric-line[data-pos="center"]{ margin:0 auto; text-align:center; }

.word{ display:inline-block; }
.letter{ display:inline-block; }

/* --- animation variants, applied via class on .lyric-line --- */
.anim-cinematic-fade{ animation:kf-fade 1.1s ease both; }
@keyframes kf-fade{ from{ opacity:0; transform:translateY(14px) scale(.98);} to{ opacity:1; transform:none; } }

.anim-slide-up{ animation:kf-slide-up .9s cubic-bezier(.16,1,.3,1) both; }
@keyframes kf-slide-up{ from{ opacity:0; transform:translateY(60px);} to{ opacity:1; transform:none; } }

.anim-fade-blur{ animation:kf-fade-blur 1.3s ease both; }
@keyframes kf-fade-blur{ from{ opacity:0; filter:blur(14px);} to{ opacity:1; filter:blur(0); } }

.anim-stretch{ animation:kf-stretch 1s cubic-bezier(.2,.9,.3,1.3) both; transform-origin:left center; }
@keyframes kf-stretch{ from{ opacity:0; transform:scaleX(.4);} to{ opacity:1; transform:scaleX(1); } }

.anim-float .word{ animation:kf-float 3.2s ease-in-out infinite; }
.anim-float .word:nth-child(odd){ animation-delay:.3s; }
@keyframes kf-float{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-10px);} }

.anim-dissolve{ animation:kf-dissolve 1.6s ease both; }
@keyframes kf-dissolve{ 0%{ opacity:0; filter:blur(0);} 60%{opacity:1;} 100%{ opacity:1; } }

.anim-glitch{ animation:kf-glitch-in .5s steps(2) both; position:relative; }
.anim-glitch::before, .anim-glitch::after{
  content:attr(data-text); position:absolute; left:0; top:0; width:100%;
  opacity:.7; clip-path:inset(0 0 0 0);
}
.anim-glitch::before{ color:var(--violet-bright); transform:translate(-3px,0); mix-blend-mode:screen; animation:kf-glitch-a 1.4s infinite; }
.anim-glitch::after{ color:var(--lilac); transform:translate(3px,0); mix-blend-mode:screen; animation:kf-glitch-b 1.7s infinite; }
@keyframes kf-glitch-in{ from{ opacity:0;} to{ opacity:1; } }
@keyframes kf-glitch-a{ 0%,100%{ clip-path:inset(0 0 90% 0);} 50%{ clip-path:inset(40% 0 40% 0);} }
@keyframes kf-glitch-b{ 0%,100%{ clip-path:inset(80% 0 0 0);} 50%{ clip-path:inset(20% 0 60% 0);} }

.anim-explode .letter{ animation:kf-explode .8s cubic-bezier(.2,.9,.3,1) both; }
@keyframes kf-explode{
  from{ opacity:0; transform:translate(var(--dx,0), var(--dy,0)) scale(.3) rotate(var(--dr,0deg)); }
  to{ opacity:1; transform:translate(0,0) scale(1) rotate(0deg); }
}

.anim-word-by-word .word{ opacity:0; animation:kf-fade .55s ease forwards; }
.anim-letter-by-letter .letter{ opacity:0; animation:kf-fade .35s ease forwards; }

.anim-typewriter{ white-space:normal; }
.anim-typewriter .letter{
  opacity:0; animation:kf-tw-in .05s steps(1) forwards;
}
@keyframes kf-tw-in{ to{ opacity:1; } }

.lyric-line.leaving{ animation:kf-leave .6s ease forwards; }
@keyframes kf-leave{ to{ opacity:0; transform:translateY(-20px); filter:blur(6px);} }

/* ============ CONTROLS ============ */
.controls{
  position:absolute; left:50%; bottom:28px; transform:translateX(-50%);
  z-index:20;
  display:flex; align-items:center; gap:16px;
  background:rgba(20,10,35,.55);
  border:1px solid rgba(228,212,247,.12);
  backdrop-filter:blur(16px);
  padding:10px 18px; border-radius:999px;
  opacity:0; pointer-events:none;
  transition:opacity .5s ease, transform .5s ease;
  cursor:auto;
}
.controls.visible{ opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(0); }

.ctrl-btn{
  background:none; border:none; color:var(--mist); cursor:pointer;
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
  border-radius:50%; transition:background .2s ease, color .2s ease;
  flex:none;
}
.ctrl-btn:hover{ background:rgba(155,92,240,.25); color:var(--lavender); }
.ctrl-btn svg{ width:18px; height:18px; fill:currentColor; }

.lang-btn{ width:auto; padding:0 10px; font-family:var(--font-mono); font-size:11px; letter-spacing:.05em; }

.timeline-wrap{ display:flex; flex-direction:column; gap:3px; width:min(38vw, 340px); }
#timeline{
  -webkit-appearance:none; appearance:none; width:100%; height:3px;
  background:rgba(228,212,247,.25); border-radius:2px; outline:none; cursor:pointer;
}
#timeline::-webkit-slider-thumb{
  -webkit-appearance:none; width:11px; height:11px; border-radius:50%;
  background:var(--lavender); box-shadow:0 0 10px var(--violet-bright); cursor:pointer;
}
.time-labels{ display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:10px; color:var(--lilac); opacity:.75; }

.volume-wrap{ display:flex; align-items:center; gap:8px; }
.icon-vol{ width:16px; height:16px; fill:var(--lilac); flex:none; }
#volume{
  -webkit-appearance:none; appearance:none; width:70px; height:3px;
  background:rgba(228,212,247,.25); border-radius:2px; outline:none; cursor:pointer;
}
#volume::-webkit-slider-thumb{
  -webkit-appearance:none; width:10px; height:10px; border-radius:50%;
  background:var(--lavender); cursor:pointer;
}

@media (max-width:640px){
  .controls{ gap:10px; padding:8px 12px; width:92vw; }
  .timeline-wrap{ width:100%; }
  .volume-wrap{ display:none; }
}

/* ============ OUTRO ============ */
#outro{
  position:fixed; inset:0; z-index:100;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at 50% 60%, rgba(110,63,196,.25), transparent 60%), var(--void);
  animation:kf-fade 2s ease both;
}
#outro[hidden]{ display:none; }
.outro-content{ text-align:center; display:flex; flex-direction:column; align-items:center; gap:10px; }
.outro-title{ font-size:clamp(2.2rem,8vw,4rem); font-weight:900; letter-spacing:-.01em; color:var(--mist); }
.outro-artist{ font-family:var(--font-mono); letter-spacing:.2em; font-size:12px; color:var(--lilac); }
.outro-tag{ font-family:var(--font-serif); font-style:italic; color:var(--lavender); opacity:.7; margin-bottom:14px; }
