/* =========================================================
   HOME PAGE  —  hero styles, animations, interactivity
   =========================================================
   Loads AFTER the inline <style> block, so these rules win
   all same-specificity conflicts.
*/

/* ── HERO base ───────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  cursor: none;
}

/* Re-purpose ::after as warm atmospheric right-side glow */
.hero::after {
  display: block !important;
  content: '' !important;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 70%;
  background: radial-gradient(ellipse at 75% 45%,
    rgba(255,85,0,0.18) 0%,
    rgba(255,85,0,0.07) 35%,
    rgba(255,85,0,0.02) 60%,
    transparent 80%
  );
  pointer-events: none;
  z-index: 2;
}

/* ── Background: animated orange grid ───────────────────── */

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,85,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,85,0,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridScroll 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* ── Background: scanlines ───────────────────────────────── */

.hero__scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Background: left orange strip ──────────────────────── */

.hero__strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, transparent, #FF5500, transparent);
  pointer-events: none;
  z-index: 3;
}

/* ── Mouse glow blob ─────────────────────────────────────── */

.hero__mouse-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,85,0,0.12) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* ── Text content ────────────────────────────────────────── */

.hero__content {
  position: relative;
  z-index: 5;
  /* Left padding mirrors the container offset on wide screens */
  padding-left: clamp(24px, calc((100vw - 1200px) / 2 + 24px), 120px);
  padding-right: 32px;
  padding-top: 110px;
  padding-bottom: 90px;
  flex-shrink: 0;
  max-width: 580px;
  /* Never centre — stay pinned to the left */
  margin-left: 0;
  margin-right: auto;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  opacity: 0;
}

.hero__eyebrow-rule {
  width: 36px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.hero__title {
  display: block;
  font-family: var(--font-display);
  line-height: 0.88;
  letter-spacing: 0.01em;
  margin-bottom: 32px;
  opacity: 0;
}

.hero__line {
  display: block;
  font-size: clamp(4rem, 9vw, 9rem);
}

.hero__line--white  { color: var(--text); }
.hero__line--stroke { color: transparent; -webkit-text-stroke: 2px rgba(242,237,232,0.35); }
.hero__line--orange { color: var(--accent); }

.hero__sub {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  color: var(--muted);
  line-height: 1.8;
  max-width: 440px;
  margin-bottom: 36px;
  opacity: 0;
}

.hero__btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
}

/* ── Character zone ──────────────────────────────────────── */

.hero__char-zone {
  position: absolute;
  inset: 0;
  width: 100%;
  overflow: visible;
  z-index: 3;
  will-change: transform;
  transition: transform 0.15s ease-out;
  pointer-events: none;
  opacity: 0;
}

/* Gradient fade: blends character into dark BG — spans full hero width */
.hero__char-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    #080808           0%,
    rgba(8,8,8,0.90) 22%,
    rgba(8,8,8,0.60) 36%,
    rgba(8,8,8,0.18) 50%,
    transparent       65%
  );
  z-index: 2;
  pointer-events: none;
}

/* Ground glow at character's feet */
.hero__ground-glow {
  position: absolute;
  bottom: 66px;
  left: 55%;
  transform: translateX(-50%);
  width: 340px;
  height: 55px;
  background: radial-gradient(ellipse at center, rgba(255,85,0,0.6) 0%, transparent 70%);
  filter: blur(12px);
  border-radius: 50%;
  animation: groundPulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

/* Eye glow divs — hidden; warrior image has built-in glowing eyes */
.hero__eye {
  display: none;
}

/* Warrior image — full body from head to feet, below nav, above stats bar */
.hero__char-img {
  position: absolute;
  top: 72px;
  right: 0;
  bottom: 64px;
  left: 0;
  width: 100%;
  height: calc(100% - 136px);
  object-fit: contain;
  object-position: right bottom;
  display: block;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
  transform-origin: bottom center;
}

/* ── Stats bar ───────────────────────────────────────────── */

.hero__stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,85,0,0.22);
  z-index: 10;
  opacity: 0;
  /* old heroUp animation override */
  animation: none !important;
}

.hero__stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 15px 10px;
  border-right: 1px solid rgba(255,255,255,0.05);
  text-align: center;
  transition: background 0.2s ease;
  cursor: default;
  /* override old heroUp */
  animation: none !important;
}

.hero__stat:last-child { border-right: none; }
.hero__stat:hover { background: rgba(255,85,0,0.08); }

.hero__stat-val {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  color: var(--text);
  letter-spacing: 0.03em;
  line-height: 1;
}

.hero__stat-label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__stat--closed .hero__stat-val { color: rgba(255,92,106,0.85); }

/* ── Custom cursor ───────────────────────────────────────── */

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,85,0,0.85);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: width 0.18s ease, height 0.18s ease, opacity 0.2s ease;
}

.cursor-ring.cursor--large {
  width: 56px;
  height: 56px;
}

.cursor-dot {
  position: fixed;
  width: 5px;
  height: 5px;
  background: #FF5500;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ── Toast notification ──────────────────────────────────── */

.hero-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.07em;
  padding: 13px 22px;
  border-radius: 8px;
  z-index: 9998;
  transform: translateX(130%);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
  white-space: nowrap;
}

.hero-toast.is-visible { transform: translateX(0); }

/* ── Rage mode ───────────────────────────────────────────── */

.hero.rage .hero__char-img {
  animation: imgGlowRage 0.25s ease-in-out infinite !important;
}

.hero.rage .hero__eye {
  animation: eyeRage 0.18s ease-in-out infinite !important;
}

.hero.rage .hero__ground-glow {
  width: 900px !important;
  filter: blur(20px) !important;
  opacity: 1 !important;
  animation: none !important;
}

.hero.rage::before {
  animation: screenFlash 0.28s ease-in-out infinite !important;
  background: rgba(255,85,0,0.06) !important;
}

/* ── Spark particles (created by JS) ────────────────────── */

.hero__spark {
  position: absolute;
  border-radius: 50%;
  background: #FF5500;
  pointer-events: none;
  z-index: 7;
}

/* ── KEYFRAMES ───────────────────────────────────────────── */

@keyframes gridScroll {
  0%   { background-position: 0 0; }
  100% { background-position: 0 60px; }
}

@keyframes groundPulse {
  0%, 100% { transform: translateX(-50%) scale(1);    opacity: 0.7; }
  50%       { transform: translateX(-50%) scale(1.35); opacity: 1;   }
}

@keyframes eyePulse {
  0%, 100% { transform: scale(1);   opacity: 0.75; }
  50%       { transform: scale(1.7); opacity: 1;    }
}

@keyframes eyeRage {
  0%, 100% { transform: scale(2.2); opacity: 1;   filter: blur(1px); }
  50%       { transform: scale(3);   opacity: 0.4; filter: blur(4px); }
}

@keyframes imgGlow {
  0%, 100% {
    filter: drop-shadow(0 0 40px rgba(255,85,0,0.4))
            drop-shadow(0 0 80px rgba(255,85,0,0.18));
  }
  50% {
    filter: drop-shadow(0 0 65px rgba(255,85,0,0.65))
            drop-shadow(0 0 130px rgba(255,85,0,0.3));
  }
}

@keyframes imgGlowRage {
  0%, 100% { filter: drop-shadow(0 0 120px rgba(255,85,0,0.95)) drop-shadow(0 0 60px rgba(255,255,0,0.3)); }
  50%       { filter: drop-shadow(0 0  70px rgba(255,85,0,0.6));  }
}

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

@keyframes charBreathe {
  0%, 100% { transform: translateY(0)    scaleY(1); }
  50%       { transform: translateY(-6px) scaleY(1.012); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(90px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0)    scale(1);    }
}

@keyframes sparkFloat {
  0%   { opacity: 0;   transform: translateY(0)       scale(1);   }
  15%  { opacity: 1;   transform: translateY(-18px)   scale(1.3); }
  85%  { opacity: 0.6; transform: translateY(-90px)   scale(0.8); }
  100% { opacity: 0;   transform: translateY(-110px)  scale(0.4); }
}

/* ── MOBILE (≤768px) ─────────────────────────────────────── */

@media (max-width: 768px) {
  .hero {
    cursor: auto;
    flex-direction: column;
    align-items: flex-start;
  }

  .cursor-ring,
  .cursor-dot { display: none; }

  /* hide decorative HUD overlays that clutter mobile */
  .combo-meter,
  .power-wrap,
  .hero-hud-tag,
  .hero-hud-hint,
  .bracket,
  .scan-line,
  .hero-toast { display: none !important; }

  .hero__content {
    max-width: 100%;
    padding-top: 105px;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 310px; /* clears the warrior figure below */
    position: relative;
    z-index: 5;
  }

  .hero__line { font-size: clamp(2.8rem, 13vw, 9rem); }

  /* Keep eyebrow on one line */
  .hero__eyebrow .label { font-size: 0.65rem; white-space: nowrap; }

  /* Warrior anchored to bottom — full figure floats above stats bar */
  .hero__char-zone {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 64px; /* just above stats bar */
    top: auto;
    height: 290px;
    overflow: visible; /* let drop-shadow glow breathe */
    z-index: 1;
    pointer-events: none;
    transition: none;
  }

  /* No mask needed — warrior on clean dark background */
  .hero__char-mask {
    display: none !important;
  }

  /* Full warrior, natural proportions — no cropping */
  .hero__char-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
  }

  .hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero__stat:nth-child(3) { border-right: none; }
  .hero__stat:nth-child(6) { border-right: none; }
  .hero__stat:nth-child(4),
  .hero__stat:nth-child(5),
  .hero__stat:nth-child(6) { border-top: 1px solid rgba(255,85,0,0.12); }
}

/* ── REDUCED MOTION ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hero__grid,
  .hero__ground-glow,
  .hero__eye,
  .hero__char-img,
  .hero__spark { animation: none !important; }

  .hero__char-zone { transition: none !important; }

  /* Keep only entrance fades */
  .hero__eyebrow   { animation: fadeUp 0.5s ease 0.2s  both !important; }
  .hero__title     { animation: fadeUp 0.6s ease 0.35s both !important; }
  .hero__sub       { animation: fadeUp 0.6s ease 0.5s  both !important; }
  .hero__btns      { animation: fadeUp 0.6s ease 0.65s both !important; }
  .hero__stats     { animation: fadeUp 0.6s ease 0.9s  both !important; }
  .hero__char-zone { animation: fadeUp 0.9s ease 0.3s  both !important; opacity: 1 !important; }
}

/* ═══════════════════════════════════════════════════════════
   HERO PREMIUM FEATURES
═══════════════════════════════════════════════════════════ */

/* ── Feature 1: Glitch text on RESHAPE ──────────────────── */
.glitch { position: relative; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
  animation: glitchIdle 8s steps(1) infinite;
}
.glitch::before { color: #FF5500; left: 2px; animation-delay: 0s; }
.glitch::after  { color: cyan;    left: -2px; animation-delay: 0.08s; }

@keyframes glitchIdle {
  0%,  89% { clip-path: inset(0 0 100% 0); transform: none;            opacity: 0; }
  90%       { clip-path: inset(30% 0 50% 0); transform: translateX(3px); opacity: 0.85; }
  91%       { clip-path: inset(10% 0 80% 0); transform: translateX(-3px); opacity: 0.85; }
  92%       { clip-path: inset(60% 0 20% 0); transform: translateX(2px);  opacity: 0.7; }
  93%       { clip-path: inset(0 0 100% 0); transform: none;            opacity: 0; }
  95%       { clip-path: inset(45% 0 40% 0); transform: translateX(-2px); opacity: 0.7; }
  96%       { clip-path: inset(0 0 100% 0); transform: none;            opacity: 0; }
}

/* ── Feature 2: Typewriter ───────────────────────────────── */
.typewriter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.tw-label  { color: var(--accent); font-weight: 700; }
.tw-text   { color: rgba(255,255,255,0.82); min-width: 160px; }
.tw-cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: twBlink 1s step-end infinite;
}
@keyframes twBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Feature 3: Power Bar ────────────────────────────────── */
.power-wrap {
  position: absolute;
  bottom: 80px;
  left: 32px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}
.power-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
}
.power-val { color: var(--accent); font-weight: 700; }
.power-track {
  width: 120px; height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.power-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #FF5500, #FF2200);
  border-radius: 2px;
  transition: width 0.15s ease, background 0.4s ease;
}

/* ── Feature 4: Combo Meter ──────────────────────────────── */
.combo-meter {
  position: absolute;
  top: 100px;
  left: 32px;
  z-index: 10;
  pointer-events: none;
  text-align: left;
}
.combo-num {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: transform 0.1s ease, color 0.3s ease;
}
.combo-num.combo-bump { transform: scale(1.35); }
.combo-label {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.32);
  text-transform: uppercase;
}

/* ── Feature 5: Corner Brackets ─────────────────────────── */
.bracket {
  position: absolute;
  width: 20px; height: 20px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.38;
}
.bracket-tl { top: 76px;  left: 14px;  border-top: 2px solid var(--accent); border-left:  2px solid var(--accent); }
.bracket-tr { top: 76px;  right: 14px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.bracket-bl { bottom: 8px; left: 14px;  border-bottom: 2px solid var(--accent); border-left:  2px solid var(--accent); }
.bracket-br { bottom: 8px; right: 14px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

/* HUD tag + hint */
.hero-hud-tag {
  position: absolute;
  top: 80px;
  left: 50%; transform: translateX(-50%);
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.26);
  text-transform: uppercase;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}
.hero-hud-hint {
  position: absolute;
  bottom: 84px; right: 32px;
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: rgba(255,85,0,0.52);
  text-transform: uppercase;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}

/* ── Feature 6: Scan line (CSS-only) ────────────────────── */
.scan-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,85,0,0.32) 50%, transparent 100%);
  z-index: 8;
  pointer-events: none;
  animation: scanMove 6s linear infinite;
}
@keyframes scanMove {
  0%   { top: 0%;   opacity: 0; }
  4%   { opacity: 1; }
  96%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ── Rage: screen-edge glow (z-index 2 = behind warrior, above bg canvas) ── */
.hero.rage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 80% at 68% 55%, rgba(255,60,0,0.22) 0%, rgba(255,85,0,0.08) 45%, transparent 70%);
  animation: rageEdgePulse 1.8s ease-in-out infinite;
}
@keyframes rageEdgePulse {
  0%,100% { opacity: 0.7; }
  50%     { opacity: 1; }
}

/* ── Reduced motion: disable all new hero animations ─────── */
@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after { animation: none !important; opacity: 0 !important; }
  .tw-cursor { animation: none !important; }
  .scan-line { animation: none !important; opacity: 0 !important; }
  .hero.rage::before { animation: none !important; opacity: 0.6 !important; }
}
