/* Abertura (preload). Direcao de cena:
   1. Tela roxo-uva quase preta.
   2. Uma luz branca nasce no centro e revela "Henrique Doliver", brilhando.
   3. Junto aparecem ENTER e a escolha SOUND ON / SOUND OFF (ON ja vem marcado).
   4. Ao entrar: a escolha some, uma onda estilo SoundCloud enche de 0 a 100%.
   5. Em 100% a luz pisca (a virada) e o site abre.
   Animacoes de CSS usam so transform e opacity (o desfoque do nome roda uma vez so). */

.intro { display: none; }
.is-preloading .intro { display: grid; }
html.is-preloading { overflow: hidden; }
html.is-preloading body { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  color: #f3eef8;
  background: radial-gradient(ellipse 80% 60% at 50% 45%, #1b0f24 0%, #0f0814 60%, #0a0510 100%);
  touch-action: none;
  overflow: hidden;
  transition: opacity 0.9s cubic-bezier(0.45, 0, 0.55, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}
.intro.is-leaving { opacity: 0; pointer-events: none; }

/* A luz branca que nasce atras do nome. */
.intro__light {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(140vw, 46rem);
  aspect-ratio: 1;
  margin: calc(min(140vw, 46rem) / -2) 0 0 calc(min(140vw, 46rem) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 0.55) 0%, rgb(225 205 255 / 0.22) 22%, rgb(150 110 220 / 0.08) 45%, transparent 68%);
  opacity: 0;
  transform: scale(0.15);
  pointer-events: none;
}
.intro.s1 .intro__light { animation: light-born 2.4s cubic-bezier(0.22, 0.9, 0.3, 1) forwards; }
@keyframes light-born {
  0%   { opacity: 0; transform: scale(0.15); }
  35%  { opacity: 1; transform: scale(0.75); }
  100% { opacity: 0.55; transform: scale(1); }
}
.intro.is-drop .intro__light { animation: light-drop 0.9s cubic-bezier(0.22, 0.9, 0.3, 1) forwards; }
@keyframes light-drop {
  0%   { opacity: 0.55; transform: scale(1); }
  30%  { opacity: 1; transform: scale(1.35); }
  100% { opacity: 0; transform: scale(1.8); }
}

.intro__inner {
  position: relative;
  width: min(100%, 30rem);
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: clamp(2.2rem, 6.5vh, 3.4rem);
  text-align: center;
}

/* O nome, branco e brilhando. Uma copia desfocada atras faz o brilho e so "respira" na opacidade. */
.intro__brand { position: relative; width: min(64vw, 19rem); }
.intro__brand img { display: block; width: 100%; height: auto; }
.intro__glow {
  position: absolute;
  inset: 0;
  filter: blur(14px) brightness(1.6);
  opacity: 0;
}
.intro__logo {
  position: relative;
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.04);
}
.intro.s1 .intro__logo { animation: name-born 1.6s cubic-bezier(0.22, 0.9, 0.3, 1) 0.35s forwards; }
.intro.s1 .intro__glow { animation: glow-born 1.6s cubic-bezier(0.22, 0.9, 0.3, 1) 0.35s forwards, glow-breathe 3.6s ease-in-out 2s infinite; }
@keyframes name-born {
  0%   { opacity: 0; filter: blur(10px); transform: scale(1.04); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes glow-born { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0.75; } }
@keyframes glow-breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 0.45; } }

/* Controles: aparecem junto com o nome. */
.intro__controls {
  display: grid;
  justify-items: center;
  gap: 1.3rem;
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 0.9s cubic-bezier(0.22, 0.9, 0.3, 1) 0.7s, transform 1s cubic-bezier(0.22, 0.9, 0.3, 1) 0.7s;
}
.intro.s1 .intro__controls { opacity: 1; transform: none; }
.intro.is-running .intro__controls { opacity: 0; transform: translateY(-0.5rem); transition-delay: 0s; transition-duration: 0.45s; pointer-events: none; }

.intro__enter {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.4rem 1rem 2.6rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.55);
  background: rgb(255 255 255 / 0.04);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 1.6rem rgb(255 255 255 / 0.12), inset 0 0 1rem rgb(255 255 255 / 0.05);
  transition: background 0.35s, border-color 0.35s, transform 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}
.intro__enter svg { width: 0.75rem; height: 0.75rem; }
.intro__enter:hover { background: rgb(255 255 255 / 0.1); border-color: #fff; }
.intro__enter:active { transform: scale(0.97); }

.intro__sound { display: flex; align-items: center; gap: 0.2rem; }
.intro__sep { width: 1px; height: 0.9rem; background: rgb(255 255 255 / 0.22); margin: 0 0.4rem; }
.intro__opt {
  appearance: none;
  border: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.5rem;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgb(243 238 248 / 0.4);
  cursor: pointer;
  transition: color 0.35s;
  -webkit-tap-highlight-color: transparent;
}
.intro__opt svg { width: 0.95rem; height: 0.95rem; }
.intro__opt[aria-checked="true"] { color: #fff; }
.intro__opt[aria-checked="true"] svg { color: #e2d0ff; filter: drop-shadow(0 0 0.35rem rgb(200 170 255 / 0.9)); }

/* Carga: onda estilo SoundCloud, pequena, enche da esquerda para a direita. */
.intro__loader {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(72vw, 17rem);
  margin-left: calc(min(72vw, 17rem) / -2);
  display: grid;
  gap: 0.55rem;
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) 0.25s, transform 0.6s cubic-bezier(0.22, 0.9, 0.3, 1) 0.25s;
  pointer-events: none;
}
.intro.is-running .intro__loader { opacity: 1; transform: none; }
.intro__wave { width: 100%; height: 3.2rem; min-width: 0; }
.intro__wave canvas { width: 100%; max-width: 100%; height: 100%; display: block; }
.intro__pct {
  justify-self: end;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: rgb(243 238 248 / 0.7);
}
.intro__pct i { font-style: normal; }
.intro__under { position: relative; width: 100%; display: grid; justify-items: center; }

.intro__caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.intro__enter:focus-visible,
.intro__opt:focus-visible,
.sound-toggle:focus-visible { outline: 2px solid rgb(255 255 255 / 0.7); outline-offset: 4px; border-radius: 999px; }

/* Botao de som que fica no site, depois da abertura. */
.sound-toggle {
  position: fixed;
  right: max(0.9rem, env(safe-area-inset-right));
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  z-index: 60;
  appearance: none;
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1.5px solid rgb(236 230 222 / 0.35);
  background: rgb(34 26 44 / 0.72);
  color: #fff;
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.sound-toggle svg { width: 1.3rem; height: 1.3rem; }
.sound-toggle:hover { opacity: 1; transform: scale(1.06); }
.is-intro-done .sound-toggle { display: grid; }
.sound-toggle[aria-pressed="true"] { border-color: rgb(190 150 255 / 0.95); box-shadow: 0 0 0.9rem rgb(170 120 255 / 0.5); }
.sound-toggle[aria-pressed="false"] { color: rgb(236 230 222 / 0.65); }
.sound-ico--off { display: none; }
[aria-pressed="false"] .sound-ico--on { display: none; }
[aria-pressed="false"] .sound-ico--off { display: block; }

@media (prefers-reduced-motion: reduce) {
  .intro.s1 .intro__light { animation: none; opacity: 0.5; transform: none; }
  .intro.s1 .intro__logo { animation: none; opacity: 1; filter: none; transform: none; }
  .intro.s1 .intro__glow { animation: none; opacity: 0.7; }
  .intro.is-drop .intro__light { animation: none; }
  .intro, .intro__controls, .intro__loader, .intro__opt, .intro__enter, .sound-toggle { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
