/* ============================================
   BBATTL.com — Styles
   Surreal Debate Arena
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-void: #0a0a0f;
    --bruised-indigo: #12101f;
    --electric-magenta: #ff2d7b;
    --cyan-voltage: #00f0ff;
    --acid-lime: #b8ff00;
    --soft-phantom: #c8c4d4;
    --dusk-lavender: #4a4260;
    --white-flare: #f0ecff;

    --font-headline: 'Libre Baskerville', 'Georgia', serif;
    --font-body: 'Libre Baskerville', 'Georgia', serif;
    --font-mono: 'DM Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--deep-void);
}

body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--soft-phantom);
    background-color: var(--deep-void);
    overflow-x: hidden;
    position: relative;
}

::selection {
    background: rgba(255, 45, 123, 0.3);
    color: var(--white-flare);
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* --- Ambient Glow Layer --- */
#ambient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    will-change: transform;
    transition: transform 2s ease-out;
}

.glow-magenta {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 45, 123, 0.08), transparent 70%);
    top: 10%;
    left: 20%;
}

.glow-cyan {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.06), transparent 70%);
    top: 40%;
    right: 15%;
}

.glow-lime {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(184, 255, 0, 0.04), transparent 70%);
    bottom: 15%;
    left: 40%;
}

/* --- SVG Argument Thread --- */
#argument-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.6;
}

#thread-path {
    filter: drop-shadow(0 0 8px rgba(255, 45, 123, 0.3));
}

/* --- Dot Grid Background --- */
#dot-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(circle, var(--dusk-lavender) 0.5px, transparent 0.5px);
    background-size: 40px 40px;
    opacity: 0.08;
}

/* --- BB Monogram Navigation --- */
#monogram-nav {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
}

#bb-monogram {
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 12px rgba(255, 45, 123, 0.5));
}

#bb-monogram:hover {
    transform: scale(1.1);
}

#bb-monogram:hover #bb-path {
    stroke: var(--cyan-voltage);
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.5));
}

#bb-path {
    transition: stroke 0.6s ease, filter 0.6s ease;
}

/* --- Radial Menu --- */
#radial-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#radial-menu.hidden {
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
}

#radial-menu.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.menu-item {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--dusk-lavender);
    background: rgba(10, 10, 15, 0.9);
    color: var(--soft-phantom);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.menu-item:hover {
    border-color: var(--cyan-voltage);
    color: var(--white-flare);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.menu-item:nth-child(1) { top: 10px; left: 70px; }
.menu-item:nth-child(2) { top: 40px; left: 120px; }
.menu-item:nth-child(3) { top: 90px; left: 140px; }
.menu-item:nth-child(4) { top: 140px; left: 120px; }
.menu-item:nth-child(5) { top: 160px; left: 70px; }
.menu-item:nth-child(6) { top: 140px; left: 20px; }

/* --- Utility Classes --- */
.mono-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--dusk-lavender);
}

.full-viewport {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

/* --- HERO SECTION --- */
#hero {
    flex-direction: column;
    padding: 0 5vw;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    gap: 4vw;
    position: relative;
}

.combatant {
    flex: 0 0 auto;
}

.silhouette {
    width: clamp(80px, 12vw, 180px);
    height: auto;
    opacity: 0;
    transition: opacity 1.5s ease 0.5s;
}

.silhouette-left {
    filter: drop-shadow(0 0 20px rgba(255, 45, 123, 0.3));
    animation: float-left 8s ease-in-out infinite;
}

.silhouette-right {
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.3));
    animation: float-right 8s ease-in-out infinite;
    transform: scaleX(-1);
}

body.loaded .silhouette {
    opacity: 1;
}

.hero-text {
    text-align: center;
    flex: 1;
}

.hero-title {
    font-family: var(--font-headline);
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 700;
    color: var(--white-flare);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    overflow: hidden;
}

.reveal-clip {
    display: block;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.loaded .reveal-clip {
    clip-path: inset(0 0% 0 0);
}

body.loaded .reveal-clip:nth-child(2) {
    transition-delay: 0.3s;
}

.hero-subtitle {
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

body.loaded .hero-subtitle {
    opacity: 1;
}

.scroll-cue {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse-cue 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 1s ease 2s;
}

body.loaded .scroll-cue {
    opacity: 0.5;
}

/* --- NARRATIVE SECTIONS --- */
.narrative-section {
    position: relative;
    z-index: 10;
    padding: 15vh 5vw;
    min-height: 80vh;
    display: flex;
    align-items: flex-start;
    gap: 4vw;
}

.content-corridor {
    width: 55%;
    max-width: 680px;
    position: relative;
}

.section-label {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--dusk-lavender);
}

.narrative-section h2 {
    font-family: var(--font-headline);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    color: var(--white-flare);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.narrative-section p {
    margin-bottom: 1.25rem;
    color: var(--soft-phantom);
}

/* --- FLOATING WIREFRAMES --- */
.floating-wireframe {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.wireframe-shape {
    width: clamp(120px, 15vw, 220px);
    height: auto;
    animation: rotate-slow 30s linear infinite;
}

.wireframe-2 .wireframe-shape {
    animation-direction: reverse;
    animation-duration: 25s;
}

/* --- COUNTERPOINT SECTIONS (F-pattern horizontal bars) --- */
.counterpoint-section {
    position: relative;
    z-index: 10;
    padding: 10vh 5vw;
    display: flex;
    justify-content: flex-end;
    min-height: 50vh;
    align-items: center;
}

.counterpoint-content {
    width: 55%;
    max-width: 600px;
    padding: 3rem 3.5rem;
    border-left: 2px solid var(--cyan-voltage);
    background: linear-gradient(135deg, rgba(18, 16, 31, 0.6), rgba(10, 10, 15, 0.3));
    backdrop-filter: blur(8px);
    position: relative;
}

.counterpoint-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 2px;
    height: 100%;
    background: var(--cyan-voltage);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.counterpoint-section h3 {
    font-family: var(--font-headline);
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    color: var(--cyan-voltage);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.counterpoint-section p {
    color: var(--soft-phantom);
    opacity: 0.85;
}

.counterpoint-section .section-label {
    border-bottom-color: var(--cyan-voltage);
}

/* --- PULL QUOTE SECTION --- */
.pull-quote-section {
    flex-direction: column;
    padding: 0 8vw;
}

.dramatic-quote {
    text-align: center;
    max-width: 900px;
}

.quote-text {
    font-family: var(--font-headline);
    font-style: italic;
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: var(--white-flare);
    line-height: 1.25;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--electric-magenta), var(--cyan-voltage));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- RESOLUTION SECTION --- */
.resolution-section {
    flex-direction: column;
    text-align: center;
    padding: 15vh 5vw;
}

.resolution-content {
    max-width: 700px;
}

.resolution-section h2 {
    font-family: var(--font-headline);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--white-flare);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.resolution-section p {
    margin-bottom: 1.5rem;
}

.convergence-point {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.convergence-svg {
    width: 120px;
    height: 120px;
    animation: pulse-convergence 4s ease-in-out infinite;
    filter: drop-shadow(0 0 25px rgba(184, 255, 0, 0.3));
}

.final-cue {
    margin-top: 2rem;
    color: var(--acid-lime);
    letter-spacing: 0.2em;
}

/* --- ANIMATIONS --- */

/* Animate-in: content fading up */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animate-in-right: counterpoint sections */
.animate-in-right {
    opacity: 0;
    transform: translateX(40px) rotate(-1deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in-right.visible {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
}

/* Float animations for silhouettes */
@keyframes float-left {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-15px) translateX(-5px); }
}

@keyframes float-right {
    0%, 100% { transform: scaleX(-1) translateY(0) translateX(0); }
    50% { transform: scaleX(-1) translateY(-12px) translateX(5px); }
}

/* Slow rotation for wireframes */
@keyframes rotate-slow {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Scroll cue pulsing */
@keyframes pulse-cue {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.6; transform: translateX(-50%) translateY(-5px); }
}

/* Convergence point pulsing */
@keyframes pulse-convergence {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* BB monogram path draw */
@keyframes draw-path {
    from { stroke-dashoffset: 300; }
    to { stroke-dashoffset: 0; }
}

#bb-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: draw-path 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.5s;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        gap: 2rem;
    }

    .combatant-left,
    .combatant-right {
        display: none;
    }

    .content-corridor {
        width: 90%;
    }

    .counterpoint-content {
        width: 90%;
    }

    .floating-wireframe {
        display: none;
    }

    .narrative-section {
        padding: 10vh 5vw;
    }

    .menu-item:nth-child(1) { top: 5px; left: 60px; }
    .menu-item:nth-child(2) { top: 30px; left: 100px; }
    .menu-item:nth-child(3) { top: 70px; left: 115px; }
    .menu-item:nth-child(4) { top: 110px; left: 100px; }
    .menu-item:nth-child(5) { top: 135px; left: 60px; }
    .menu-item:nth-child(6) { top: 110px; left: 20px; }
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #particle-canvas {
        display: none;
    }

    .reveal-clip {
        clip-path: none;
    }
}
