/* ═══════════════════════════════════════════════════════
   HERO SECTION — Dark Banner Stage
   ═══════════════════════════════════════════════════════ */

#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  background:
    radial-gradient(circle at 50% 22%, rgba(83, 255, 110, 0.05), transparent 18%),
    radial-gradient(circle at 14% 12%, rgba(83, 255, 110, 0.03), transparent 16%),
    linear-gradient(180deg, #010201 0%, #020603 50%, #010201 100%);
  overflow: hidden;
  isolation: isolate;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #020503 0%, #050f0b 100%);
}

.hero-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.06);
  filter: saturate(0.85) contrast(1.02) brightness(0.5);
  will-change: transform;
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(83, 255, 110, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(2, 5, 3, 0.1) 0%, rgba(2, 5, 3, 0.58) 55%, rgba(2, 5, 3, 0.9) 100%);
}

.sound-toggle {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(83, 255, 110, 0.12);
  background: rgba(2, 7, 4, 0.72);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
}

.sound-toggle:hover {
  color: var(--accent-light);
  border-color: rgba(83, 255, 110, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(83, 255, 110, 0.08);
}

.sound-toggle.active {
  color: var(--accent);
  border-color: rgba(83, 255, 110, 0.28);
}

.hero-scanlines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 0 96%, rgba(83, 255, 110, 0.035) 96% 100%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px);
  opacity: 0.12;
  mix-blend-mode: screen;
  animation: scanDrift 11s linear infinite;
}

.hero-scanlines::after {
  content: '';
  position: absolute;
  inset: 10% 12%;
  background: radial-gradient(circle at 50% 50%, rgba(83, 255, 110, 0.08), transparent 66%);
  filter: blur(36px);
  opacity: 0.72;
}

.hero-content {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  text-align: center;
  padding: 0 var(--space-lg);
  user-select: none;
  width: min(100%, 1100px);
  opacity: 0.96;
  transform: translate(-50%, -50%) translateY(8px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

.hero-content::before {
  content: '';
  position: absolute;
  inset: -3rem -4rem;
  background: radial-gradient(circle at 50% 42%, rgba(76, 255, 106, 0.08), transparent 58%);
  filter: blur(22px);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}

#hero.hero-live .hero-content {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(0);
}

.hero-name-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.35rem;
}

.hero-realname {
  font-family: var(--font-mono);
  font-size: clamp(0.74rem, 1.2vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  color: #c5ffd1;
  text-transform: uppercase;
  min-height: 1.4em;
  text-shadow: 0 0 12px rgba(83, 255, 110, 0.12);
  transition: letter-spacing 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  animation: glitchNarrow 7s infinite steps(1, end);
}

.hero-realname .scramble-char {
  color: var(--accent);
  font-weight: 600;
}

.hero-realname .unrevealed {
  color: var(--text-dim);
  opacity: 0.26;
}

.hero-realname .revealed-text {
  color: #d9fff0;
}

.hero-realname::selection,
.hero-codename::selection,
.hero-subtitle::selection,
.hero-tagline::selection {
  background: rgba(83, 255, 110, 0.22);
  color: #f2fff4;
}

.hero-codename {
  font-family: var(--font-heading);
  font-size: clamp(4.4rem, 15vw, 11rem);
  font-weight: 700;
  line-height: 0.88;
  color: var(--text-primary);
  min-height: 1em;
  letter-spacing: -0.05em;
  position: relative;
  will-change: transform, text-shadow;
  text-shadow:
    -1px 0 rgba(83, 255, 110, 0.34),
    1px 0 rgba(0, 0, 0, 0.92),
    0 0 22px rgba(83, 255, 110, 0.08);
  animation: glitchWobble 6.5s infinite steps(1, end);
}

.hero-title-active {
  filter: saturate(1.08);
}

.hero-codename::after {
  content: '';
  position: absolute;
  inset: 12% 18% -6% 18%;
  background: radial-gradient(circle, rgba(83, 255, 110, 0.12), transparent 68%);
  filter: blur(18px);
  z-index: -1;
}

.hero-codename::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: rgba(83, 255, 110, 0.22);
  transform: translate(1px, 0);
  clip-path: inset(0 0 52% 0);
  pointer-events: none;
}

.codename-letter {
  display: inline-block;
  position: relative;
  cursor: default;
  transition: transform 0.28s var(--ease-out), color 0.28s var(--ease-out), text-shadow 0.28s var(--ease-out);
}

.hero-title-active .codename-letter {
  text-shadow: 0 0 18px rgba(83, 255, 110, 0.18);
}

.codename-letter:hover,
.codename-letter.letter-hovered {
  color: #8dff99;
  text-shadow:
    0 0 14px rgba(76, 255, 106, 0.38),
    0 0 28px rgba(76, 255, 106, 0.14);
  transform: translateY(-5px) scale(1.05);
}

.codename-letter.letter-neighbor {
  color: rgba(185, 255, 224, 0.82);
  text-shadow: 0 0 12px rgba(82, 242, 177, 0.24);
  transform: translateY(-2px);
}

.glitch-active {
  animation: glitchFlicker 0.08s infinite alternate;
}

@keyframes glitchWobble {
  0%, 92%, 100% { transform: translateX(0); }
  93% { transform: translateX(-1px); }
  94% { transform: translateX(1px); }
  95% { transform: translateX(-2px); }
  96% { transform: translateX(2px); }
}

@keyframes glitchNarrow {
  0%, 94%, 100% { letter-spacing: 0.42em; }
  95% { letter-spacing: 0.46em; }
  96% { letter-spacing: 0.38em; }
}

@keyframes glitchFlicker {
  0% {
    text-shadow: 2px 0 rgba(82, 242, 177, 0.48), -2px 0 rgba(127, 248, 225, 0.24);
    transform: translateX(0);
  }
  33% {
    text-shadow: -2px 0 rgba(127, 248, 225, 0.48), 2px 0 rgba(82, 242, 177, 0.18);
    transform: translateX(-2px);
  }
  66% {
    text-shadow: 1px 1px rgba(82, 242, 177, 0.36), -1px -1px rgba(127, 248, 225, 0.22);
    transform: translateX(1px);
  }
  100% {
    text-shadow: 0 -1px rgba(82, 242, 177, 0.42), 0 1px rgba(127, 248, 225, 0.18);
    transform: translateX(2px);
  }
}

.letter-flash {
  animation: flashPulse 0.15s ease-out;
}

@keyframes flashPulse {
  0% { text-shadow: 0 0 28px rgba(82, 242, 177, 0.72), 0 0 56px rgba(82, 242, 177, 0.26); }
  100% { text-shadow: none; }
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.84rem, 1.5vw, 1.05rem);
  color: #b8ffd0;
  letter-spacing: 0.08em;
  min-height: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 12px rgba(83, 255, 110, 0.12);
  animation: subtitleFlicker 5.8s infinite steps(1, end);
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s var(--ease-out) 0.08s, transform 0.9s var(--ease-out) 0.08s;
}

#hero.hero-live .hero-meta {
  opacity: 1;
  transform: translateY(0);
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(83, 255, 110, 0.14);
  background: rgba(4, 10, 6, 0.72);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #bbffd1;
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.hero-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(83, 255, 110, 0.28);
  color: #8dff99;
  box-shadow: 0 0 12px rgba(83, 255, 110, 0.08);
}

.typed-text { color: var(--accent-light); }

.cursor {
  color: var(--accent);
  font-weight: 300;
  animation: cursorBlink 0.8s steps(1) infinite;
  margin-left: 1px;
}

.hero-subtitle .cursor {
  color: #8dff99;
}

@keyframes subtitleFlicker {
  0%, 90%, 100% { opacity: 1; transform: translateY(0); }
  91% { opacity: 0.85; transform: translateY(0.5px); }
  92% { opacity: 1; }
}

@keyframes scanDrift {
  0% { transform: translateY(0); }
  100% { transform: translateY(8px); }
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 1.1vw, 0.98rem);
  color: var(--text-dim);
  max-width: 540px;
  margin: 1.2rem auto 0;
  line-height: 1.8;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s ease 0.45s, transform 0.9s ease 0.45s, color 0.9s ease 0.45s;
}

.hero-tagline.visible {
  opacity: 0.88;
  color: #8fa395;
  transform: translateY(0);
}

.scroll-indicator {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  opacity: 0.38;
  transition: opacity 0.28s ease, transform 0.28s ease;
  animation: scrollFloat 2.6s ease-in-out infinite;
}

.scroll-indicator:hover {
  opacity: 0.75;
  transform: translateX(-50%) translateY(-2px);
}

.scroll-indicator span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #6d816f;
}

.scroll-chevron {
  width: 20px;
  height: 20px;
  border-right: 1.5px solid #6dff7f;
  border-bottom: 1.5px solid #6dff7f;
  transform: rotate(45deg);
  filter: drop-shadow(0 0 8px rgba(76, 255, 106, 0.12));
}

@keyframes scrollFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(9px); }
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at 50% 45%, rgba(76, 255, 106, 0.06), transparent 28%),
    linear-gradient(180deg, #020503 0%, #030806 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-percent {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #79ff83;
  letter-spacing: 0.1em;
  text-shadow: 0 0 16px rgba(76, 255, 106, 0.16);
}

.loader-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.loader-bar-track {
  width: min(320px, 64vw);
  height: 2px;
  background: rgba(186, 255, 224, 0.08);
  border-radius: 1px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0f5f2f, #53ff6e, #c8ffd1);
  border-radius: 1px;
  transition: width 0.1s linear;
  box-shadow: 0 0 14px rgba(76, 255, 106, 0.14);
}

/* ── Mobile: no-video fallback — animated dark gradient ── */
#hero.hero-no-video {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(83, 255, 110, 0.06), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 102, 255, 0.04), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(127, 248, 225, 0.03), transparent 40%),
    linear-gradient(160deg, #020503 0%, #030908 30%, #010201 60%, #020604 100%);
  background-size: 200% 200%;
  animation: heroGradientShift 12s ease-in-out infinite;
}

@keyframes heroGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (max-width: 768px) {
  #hero { min-height: 580px; }
  .hero-codename { font-size: clamp(3.4rem, 20vw, 6.6rem); }
  .hero-meta { margin-top: 0.85rem; gap: 0.45rem; }
  .hero-chip { font-size: 0.56rem; padding: 0.36rem 0.68rem; }
  .hero-tagline { padding: 0 1rem; }
  .scroll-indicator { bottom: 1.9rem; }
  .sound-toggle { top: 1rem; right: 1rem; }
}

@media (max-width: 480px) {
  .hero-realname { letter-spacing: 0.3em; }
  .hero-codename { letter-spacing: -0.04em; }
}
