/* ============================================================
   KAPNOX — original logo-reveal animation (hero)
   Unchanged animation; scoped to the .hero section so the rest
   of the page can scroll beneath it.
   ============================================================ */

/* --- Hero shell (was the original <body>) --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle, #fffbeb 0%, #FFD700 100%);
}

/* --- Logo Container & SVG --- */
.logo-container {
  width: 90%;
  max-width: 600px;
  position: relative;
  z-index: 10;
  transition: opacity 0.4s ease-out;
}
.logo-container.hidden { opacity: 0; pointer-events: none; }

.hero svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* --- 0. Magical Shimmer Particles (scoped to hero) --- */
.particle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  z-index: 1;
  will-change: transform, opacity;
}
@keyframes burst {
  0% { transform: translate(0,0) scale(0.5); opacity: 1; }
  40% { transform: translate(var(--x-move), var(--y-move)) scale(1.5); opacity: 0.9; filter: brightness(1.6); }
  70% { transform: translate(calc(var(--x-move) * 1.2), calc(var(--y-move) * 1.2)) scale(0.7); opacity: 0.6; }
  100% { transform: translate(0,0) scale(0.3); opacity: 0; }
}

/* --- Initial Animation States (Hidden) --- */
#logo-triangles,
#logo-circles > *,
#logo-text > *,
#theline {
  opacity: 0;
  filter: blur(5px);
}
.ray-part path {
  opacity: 0;
  filter: blur(5px);
  --ray-scale: 0;
}

/* --- 1. Triangles --- */
.logo-container.animate #logo-triangles {
  animation: blur-in 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.0s 1 forwards;
}

/* --- 2. Circles --- */
#logo-circles > * { transform: scale(0); transform-origin: 50.4px 37.0px; }
.logo-container.animate #midcircle1 { animation: pop-in 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 1.5s 1 forwards; }
.logo-container.animate #midcircle2 { animation: pop-in 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 1.6s 1 forwards; }
.logo-container.animate #midcircle3 { animation: pop-in 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 1.7s 1 forwards; }
.logo-container.animate #midcircle4 { animation: pop-in 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 1.8s 1 forwards; }

/* --- 3. The Red Rays --- */
.ray-part path {
  fill: #dc0000;
  transform: scale(var(--ray-scale));
  transform-origin: center center;
  transform-box: fill-box;
}

/* --- 4. The "KAPNOX" Text (Staggered) --- */
.logo-container.animate #logoname1 { animation: blur-in 0.5s ease-out 3.0s 1 forwards; }
.logo-container.animate #logoname2 { animation: blur-in 0.5s ease-out 3.1s 1 forwards; }
.logo-container.animate #logoname3 { animation: blur-in 0.5s ease-out 3.2s 1 forwards; }
.logo-container.animate #logoname4, .logo-container.animate #logoname4a { animation: blur-in 0.5s ease-out 3.3s 1 forwards; }
.logo-container.animate #logoname5 { animation: blur-in 0.5s ease-out 3.4s 1 forwards; }
.logo-container.animate #logoname6, .logo-container.animate #logoname6a { animation: blur-in 0.5s ease-out 3.5s 1 forwards; }

/* --- 5. The Line --- */
#theline { stroke-dasharray: 87; stroke-dashoffset: 87; }
.logo-container.animate #theline {
  animation: draw-line 0.5s ease-out 3.6s 1 forwards,
             blur-in 0.5s ease-out 3.6s 1 forwards;
}

/* --- 6. Final Highlight --- */
.logo-container.animate #KapnoxLogo { animation: final-highlight 0.8s ease-in-out 4.2s 1; }

/* --- Keyframes --- */
@keyframes blur-in { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: blur(0px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0); filter: blur(5px); } to { opacity: 1; transform: scale(1); filter: blur(0px); } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes final-highlight {
  0% { filter: none; }
  50% { filter: brightness(1.5) drop-shadow(0 0 15px #FFD700); }
  100% { filter: none; }
}

/* --- Ray hover labels --- */
.ray-label {
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  fill: url(#text-gradient);
  stroke: rgba(0,0,0,0.4);
  stroke-width: 0.2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

/* --- Bottom-left controls (scoped to hero) --- */
.bottom-left-controls {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.4s ease-out;
}
.bottom-left-controls.hidden { opacity: 0; pointer-events: none; }

.replay-button {
  background-color: #06005e;
  color: #FFD700;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease-out;
}
.replay-button:hover { background-color: #1a1a6e; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }

.control-button {
  background-color: #06005e;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease-out;
  width: 50px; height: 50px;
  box-sizing: border-box;
  display: grid; place-items: center;
}
.control-button:hover { background-color: #1a1a6e; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.control-button img {
  width: 24px; height: 24px;
  filter: invert(84%) sepia(90%) saturate(857%) hue-rotate(320deg) brightness(104%) contrast(102%);
}

/* "unmute" hint pointing at the mute button.
   Anchored to the mute button and extending RIGHT into open space, with a
   viewport-clamped width, so it can never run off the edge of the screen. */
.mute-wrap { position: relative; display: inline-flex; }
.sound-hint {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: max-content;
  max-width: min(260px, calc(100vw - 132px));
  display: flex;
  align-items: center;
  gap: 8px;
  background: #06005e;
  color: #FFD700;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 12px 30px rgba(6, 0, 94, .35);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  pointer-events: none;
  transition: opacity .4s ease, transform .4s cubic-bezier(.68, -0.55, .27, 1.55);
}
.sound-hint b { color: #fff; }
.sound-hint .sound-hint-emoji { font-size: 1.05rem; flex: none; }
.sound-hint::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;                  /* points down at the ~50px mute button */
  border: 7px solid transparent;
  border-top-color: #06005e;
}
.sound-hint.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  animation: hint-bob 1.6s ease-in-out .4s infinite;
}
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@media (max-width: 560px) {
  .sound-hint { font-size: .82rem; padding: 9px 13px; }
}

/* Hero tagline + scroll cue */
.hero-tagline {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 15;
  text-align: center;
  color: #06005e;
  font-weight: 700;
  letter-spacing: .01em;
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  opacity: 0;
  animation: fade-up-tag .8s ease-out 3.9s forwards;
}
.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 15;
  color: #06005e;
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .7;
  animation: nudge 2s ease-in-out infinite;
}
@keyframes fade-up-tag { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: .95; transform: translate(-50%, 0); } }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }

@media (prefers-reduced-motion: reduce) {
  #logo-triangles, #logo-circles > *, #logo-text > *, #theline { opacity: 1; filter: none; }
  .ray-part path { opacity: 1; filter: none; --ray-scale: 1; }
  #logo-circles > * { transform: scale(1); }
  .hero-tagline { opacity: .95; animation: none; }
  .particle-container { display: none; }
  .sound-hint.show { animation: none; transform: none; }
}

@media (max-width: 560px) {
  .hero-tagline { bottom: 80px; }
  .replay-button { padding: 10px 18px; font-size: .9rem; }
}
