/* =========================================================
   BBATTL.com - Digital Colosseum
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --obsidian-black: #050508;
    --midnight-steel: #0c0c1a;
    --electric-magenta: #ff00ff;
    --cyan-bolt: #00ffee;
    --acid-lime: #b0ff2e;
    --spectral-violet: #7b2fbe;
    --prismatic-teal: #2febbf;
    --ghost-white: #e8e8f0;
    --slate-haze: #6b6b8a;

    --holo-x: 50%;
    --holo-y: 50%;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--obsidian-black);
    color: var(--ghost-white);
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- Scanline Overlay --- */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
}

/* --- Holographic Sheen Overlay --- */
#holo-sheen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    background: conic-gradient(
        from 0deg at var(--holo-x) var(--holo-y),
        #ff00ff,
        #7b2fbe,
        #00ffee,
        #2febbf,
        #ff00ff
    );
    opacity: 0.04;
    mix-blend-mode: screen;
    transition: opacity 0.3s;
}

body:hover #holo-sheen {
    opacity: 0.08;
}

/* --- Navigation --- */
#nav {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
}

#nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: block;
    transition: transform 0.3s ease;
}

#nav-toggle:hover {
    transform: scale(1.15);
}

#nav-toggle svg {
    display: block;
    filter: drop-shadow(0 0 6px rgba(0, 255, 238, 0.4));
}

/* --- Nav Overlay --- */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 12, 26, 0.96);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-overlay-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.nav-link {
    font-family: 'Monoton', cursive;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--ghost-white);
    text-decoration: none;
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease, text-shadow 0.3s ease;
}

.nav-link:nth-child(even) {
    transform: translateX(60px);
}

#nav-overlay.active .nav-link {
    opacity: 1;
    transform: translateX(0);
}

#nav-overlay.active .nav-link:nth-child(1) { transition-delay: 0.1s; }
#nav-overlay.active .nav-link:nth-child(2) { transition-delay: 0.18s; }
#nav-overlay.active .nav-link:nth-child(3) { transition-delay: 0.26s; }
#nav-overlay.active .nav-link:nth-child(4) { transition-delay: 0.34s; }
#nav-overlay.active .nav-link:nth-child(5) { transition-delay: 0.42s; }

.nav-link:hover {
    color: var(--cyan-bolt);
    text-shadow:
        0 0 10px rgba(0, 255, 238, 0.5),
        0 0 30px rgba(0, 255, 238, 0.3),
        0 0 60px rgba(0, 255, 238, 0.1);
}

/* --- Hero Section (ACT I) --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--obsidian-black);
}

/* Hero grid background */
#hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 238, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 238, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse 4s ease-in-out infinite;
    z-index: 1;
}

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

/* Hero particles */
#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--cyan-bolt);
    box-shadow: 0 0 6px var(--cyan-bolt), 0 0 12px rgba(0, 255, 238, 0.3);
    animation: particleFloat linear infinite;
    opacity: 0;
}

.particle:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-duration: 15s; animation-delay: 2s; background: var(--electric-magenta); box-shadow: 0 0 6px var(--electric-magenta); }
.particle:nth-child(3) { left: 40%; animation-duration: 10s; animation-delay: 4s; }
.particle:nth-child(4) { left: 55%; animation-duration: 18s; animation-delay: 1s; background: var(--electric-magenta); box-shadow: 0 0 6px var(--electric-magenta); }
.particle:nth-child(5) { left: 70%; animation-duration: 14s; animation-delay: 3s; }
.particle:nth-child(6) { left: 85%; animation-duration: 11s; animation-delay: 5s; background: var(--acid-lime); box-shadow: 0 0 6px var(--acid-lime); }
.particle:nth-child(7) { left: 15%; animation-duration: 16s; animation-delay: 7s; }
.particle:nth-child(8) { left: 35%; animation-duration: 13s; animation-delay: 6s; background: var(--electric-magenta); box-shadow: 0 0 6px var(--electric-magenta); }
.particle:nth-child(9) { left: 60%; animation-duration: 17s; animation-delay: 8s; }
.particle:nth-child(10) { left: 75%; animation-duration: 12s; animation-delay: 3.5s; background: var(--acid-lime); box-shadow: 0 0 6px var(--acid-lime); }
.particle:nth-child(11) { left: 50%; animation-duration: 19s; animation-delay: 9s; }
.particle:nth-child(12) { left: 90%; animation-duration: 14s; animation-delay: 1.5s; background: var(--electric-magenta); box-shadow: 0 0 6px var(--electric-magenta); }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-20vh) scale(0.5);
        opacity: 0;
    }
}

/* Holographic polyhedron */
#hologram-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    perspective: 800px;
}

.hologram-scene {
    width: 350px;
    height: 350px;
    position: relative;
    transform-style: preserve-3d;
}

.polyhedron {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: polyRotate 20s linear infinite;
}

@keyframes polyRotate {
    0% { transform: rotateY(0deg) rotateX(15deg) rotateZ(0deg); }
    100% { transform: rotateY(360deg) rotateX(15deg) rotateZ(360deg); }
}

.face {
    position: absolute;
    width: 160px;
    height: 160px;
    top: 50%;
    left: 50%;
    margin-top: -80px;
    margin-left: -80px;
    border: 1px solid;
    background: linear-gradient(135deg,
        rgba(123, 47, 190, 0.12),
        rgba(0, 255, 238, 0.08),
        rgba(255, 0, 255, 0.06)
    );
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.face-1 {
    border-color: rgba(0, 255, 238, 0.35);
    transform: rotateY(0deg) translateZ(90px);
}
.face-2 {
    border-color: rgba(255, 0, 255, 0.35);
    transform: rotateY(90deg) translateZ(90px);
}
.face-3 {
    border-color: rgba(0, 255, 238, 0.25);
    transform: rotateY(180deg) translateZ(90px);
}
.face-4 {
    border-color: rgba(255, 0, 255, 0.25);
    transform: rotateY(270deg) translateZ(90px);
}
.face-5 {
    border-color: rgba(47, 235, 191, 0.3);
    transform: rotateX(90deg) translateZ(90px);
}
.face-6 {
    border-color: rgba(123, 47, 190, 0.3);
    transform: rotateX(-90deg) translateZ(90px);
}
.face-7 {
    border-color: rgba(176, 255, 46, 0.15);
    transform: rotateY(45deg) rotateX(45deg) translateZ(100px);
}
.face-8 {
    border-color: rgba(176, 255, 46, 0.15);
    transform: rotateY(-45deg) rotateX(-45deg) translateZ(100px);
}

/* Hero content */
#hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
}

.hero-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(3rem, 8vw, 9rem);
    color: var(--ghost-white);
    text-shadow:
        0 0 20px rgba(255, 0, 255, 0.6),
        0 0 40px rgba(255, 0, 255, 0.3),
        0 0 80px rgba(255, 0, 255, 0.15),
        0 0 120px rgba(123, 47, 190, 0.1);
    line-height: 1;
    letter-spacing: 0.05em;
    user-select: none;
}

.hero-subtitle-wrap {
    margin-top: 1.5rem;
}

.hero-tagline {
    font-family: 'Monoton', cursive;
    font-size: clamp(0.9rem, 2vw, 1.6rem);
    color: var(--cyan-bolt);
    text-shadow:
        0 0 10px rgba(0, 255, 238, 0.5),
        0 0 30px rgba(0, 255, 238, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Circuit Connectors --- */
.circuit-connector {
    position: relative;
    width: 100%;
    height: 80px;
    overflow: hidden;
    background: var(--obsidian-black);
}

.circuit-connector svg {
    width: 100%;
    height: 100%;
}

.circuit-path {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    animation: circuitTrace 8s linear infinite;
    opacity: 0.4;
}

.circuit-node {
    opacity: 0.6;
    filter: drop-shadow(0 0 4px currentColor);
}

@keyframes circuitTrace {
    0% { stroke-dashoffset: 2400; }
    100% { stroke-dashoffset: 0; }
}

/* --- Section Styling (ACT II) --- */
#act2,
#act2-block2,
#act2-block3 {
    position: relative;
    padding: 6rem 5vw;
    background: var(--obsidian-black);
    border-top: 1px solid rgba(0, 255, 238, 0.1);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(2rem, 5vw, 5rem);
    color: var(--ghost-white);
    text-shadow:
        0 0 15px rgba(255, 0, 255, 0.5),
        0 0 35px rgba(255, 0, 255, 0.25),
        0 0 70px rgba(255, 0, 255, 0.1);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-family: 'Monoton', cursive;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    color: var(--cyan-bolt);
    text-shadow: 0 0 10px rgba(0, 255, 238, 0.3);
}

/* Content rows */
.content-row {
    display: flex;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.content-row--reverse {
    flex-direction: row-reverse;
}

.content-block {
    flex: 1;
    min-width: 0;
}

.content-block--left {
    transform: translateY(30px);
}

.content-block--right {
    transform: translateY(-30px);
}

/* Holographic panels (frosted glass) */
.holo-panel {
    position: relative;
    background: rgba(12, 12, 26, 0.7);
    border: 1px solid rgba(0, 255, 238, 0.15);
    padding: 2.5rem;
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    overflow: hidden;
}

.holo-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(
        from 0deg at var(--holo-x) var(--holo-y),
        rgba(255, 0, 255, 0.06),
        rgba(123, 47, 190, 0.04),
        rgba(0, 255, 238, 0.06),
        rgba(47, 235, 191, 0.04),
        rgba(255, 0, 255, 0.06)
    );
    animation: holoShimmer 12s linear infinite;
    pointer-events: none;
}

@keyframes holoShimmer {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.holo-panel-edge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--cyan-bolt),
        var(--electric-magenta),
        var(--prismatic-teal),
        transparent
    );
    opacity: 0.6;
}

.block-title {
    font-family: 'Monoton', cursive;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--electric-magenta);
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.4);
    margin-bottom: 1rem;
}

.block-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: var(--ghost-white);
    line-height: 1.8;
}

/* Hexagonal frames */
.hex-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hex-inner {
    width: 220px;
    height: 220px;
    position: relative;
}

.hex-graphic {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(0, 255, 238, 0.3));
    animation: hexSpin 30s linear infinite;
}

@keyframes hexSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Stagger animation --- */
.stagger-item {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Alternating stagger direction */
.stagger-group .stagger-item:nth-child(even) {
    transform: translateX(40px);
}

.stagger-group .stagger-item:nth-child(even).visible {
    transform: translateX(0);
}

.stagger-group .stagger-item:nth-child(odd) {
    transform: translateX(-40px);
}

.stagger-group .stagger-item:nth-child(odd).visible {
    transform: translateX(0);
}

/* --- ACT III: Resolution --- */
#act3 {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg,
        var(--obsidian-black) 0%,
        var(--midnight-steel) 100%
    );
    border-top: 1px solid rgba(255, 0, 255, 0.15);
    padding: 6rem 5vw;
    overflow: hidden;
}

#act3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(
        from 180deg at 50% 50%,
        rgba(255, 0, 255, 0.04),
        rgba(123, 47, 190, 0.02),
        rgba(0, 255, 238, 0.04),
        rgba(47, 235, 191, 0.02),
        rgba(255, 0, 255, 0.04)
    );
    animation: holoShimmer 12s linear infinite;
    pointer-events: none;
}

.act3-inner {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.act3-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(2.5rem, 6vw, 7rem);
    color: var(--ghost-white);
    text-shadow:
        0 0 20px rgba(255, 0, 255, 0.5),
        0 0 50px rgba(255, 0, 255, 0.25),
        0 0 100px rgba(255, 0, 255, 0.1);
    margin-bottom: 2rem;
}

.act3-statement {
    font-family: 'Monoton', cursive;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    color: var(--cyan-bolt);
    text-shadow: 0 0 10px rgba(0, 255, 238, 0.3);
    line-height: 2.2;
    margin-bottom: 3rem;
}

.act3-glyph {
    margin-bottom: 2rem;
}

.act3-glyph svg {
    filter: drop-shadow(0 0 8px rgba(255, 0, 255, 0.4));
    animation: glyphPulse 3s ease-in-out infinite;
}

@keyframes glyphPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.act3-domain {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: var(--slate-haze);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* --- Neon border pulse for section dividers --- */
#act2 > .section-header::after,
#act2-block3 > .section-header::after {
    content: '';
    display: block;
    width: 120px;
    height: 1px;
    margin: 2rem auto 0;
    background: var(--electric-magenta);
    box-shadow: 0 0 8px var(--electric-magenta);
    animation: borderPulse 3s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% {
        box-shadow: 0 0 8px var(--electric-magenta);
        opacity: 0.6;
    }
    50% {
        box-shadow: 0 0 16px var(--electric-magenta), 0 0 30px rgba(255, 0, 255, 0.3);
        opacity: 1;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-row,
    .content-row--reverse {
        flex-direction: column;
        gap: 2rem;
    }

    .content-block--left,
    .content-block--right {
        transform: translateY(0);
    }

    .hologram-scene {
        width: 220px;
        height: 220px;
    }

    .face {
        width: 100px;
        height: 100px;
        margin-top: -50px;
        margin-left: -50px;
    }

    .face-1 { transform: rotateY(0deg) translateZ(55px); }
    .face-2 { transform: rotateY(90deg) translateZ(55px); }
    .face-3 { transform: rotateY(180deg) translateZ(55px); }
    .face-4 { transform: rotateY(270deg) translateZ(55px); }
    .face-5 { transform: rotateX(90deg) translateZ(55px); }
    .face-6 { transform: rotateX(-90deg) translateZ(55px); }
    .face-7 { transform: rotateY(45deg) rotateX(45deg) translateZ(65px); }
    .face-8 { transform: rotateY(-45deg) rotateX(-45deg) translateZ(65px); }

    .hex-inner {
        width: 160px;
        height: 160px;
    }

    #act2,
    #act2-block2,
    #act2-block3 {
        padding: 4rem 5vw;
    }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .polyhedron,
    .hex-graphic,
    .particle,
    .circuit-path,
    .act3-glyph svg {
        animation: none;
    }

    .stagger-item {
        transition: none;
        opacity: 1;
        transform: none;
    }

    #hero-grid {
        animation: none;
    }

    .holo-panel::before,
    #act3::before {
        animation: none;
    }

    #holo-sheen {
        display: none;
    }
}
