/* ============================================================
   causality.club - Styles
   Split-screen causality narrative / Urban zen graffiti aesthetic
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #1A1A1A;
    color: #F0EDE8;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* --- Spray-paint concrete texture (pure CSS) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle 1px at 15% 25%, rgba(240,237,232,0.04) 0%, transparent 100%),
        radial-gradient(circle 2px at 45% 60%, rgba(240,237,232,0.03) 0%, transparent 100%),
        radial-gradient(circle 1px at 70% 10%, rgba(240,237,232,0.04) 0%, transparent 100%),
        radial-gradient(circle 2px at 85% 75%, rgba(240,237,232,0.03) 0%, transparent 100%),
        radial-gradient(circle 1px at 30% 90%, rgba(240,237,232,0.05) 0%, transparent 100%),
        radial-gradient(circle 1px at 55% 35%, rgba(240,237,232,0.03) 0%, transparent 100%),
        radial-gradient(circle 2px at 10% 55%, rgba(240,237,232,0.04) 0%, transparent 100%),
        radial-gradient(circle 1px at 90% 45%, rgba(240,237,232,0.03) 0%, transparent 100%);
}

/* --- Floating Menu Glyph (chain-link icon) --- */
#menu-glyph {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    cursor: pointer;
    width: 40px;
    height: 40px;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#menu-glyph:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- Overlay Menu --- */
.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.96);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.overlay-menu.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-menu-inner {
    text-align: center;
    position: relative;
}

.overlay-close {
    position: absolute;
    top: -60px;
    right: 0;
    font-size: 36px;
    color: #8A8A8A;
    cursor: pointer;
    transition: color 0.3s ease;
}

.overlay-close:hover {
    color: #FF4D00;
}

.menu-link {
    display: block;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 36px;
    color: #F0EDE8;
    text-decoration: none;
    margin: 20px 0;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.menu-link:hover {
    color: #FF4D00;
}

/* --- Central Causality Divider Line --- */
#causality-line {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100vh;
    background: #FF4D00;
    z-index: 50;
    pointer-events: none;
    animation: causality-glow 2s ease-in-out infinite;
}

@keyframes causality-glow {
    0%, 100% {
        box-shadow: 0 0 6px rgba(255, 77, 0, 0.3), 0 0 12px rgba(255, 77, 0, 0.15);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 77, 0, 0.5), 0 0 24px rgba(255, 77, 0, 0.25);
    }
}

/* --- Split Section Layout --- */
.split-section {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.panel {
    width: 50%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.panel-content {
    position: relative;
    z-index: 2;
}

/* --- Cause Panel (Left / Dark) --- */
.cause-panel {
    background: #1A1A1A;
    padding: 64px 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Brick pattern overlay for cause panels */
.cause-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 18px,
            rgba(240,237,232,0.5) 18px,
            rgba(240,237,232,0.5) 19px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 48px,
            rgba(240,237,232,0.3) 48px,
            rgba(240,237,232,0.3) 49px
        );
}

/* Spray-paint overspray for cause panels */
.cause-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle 12px at 20% 30%, rgba(255, 77, 0, 0.03) 0%, transparent 100%),
        radial-gradient(circle 8px at 60% 15%, rgba(255, 77, 0, 0.02) 0%, transparent 100%),
        radial-gradient(circle 16px at 80% 70%, rgba(255, 77, 0, 0.04) 0%, transparent 100%),
        radial-gradient(circle 10px at 35% 85%, rgba(255, 77, 0, 0.03) 0%, transparent 100%),
        radial-gradient(circle 14px at 75% 45%, rgba(255, 77, 0, 0.02) 0%, transparent 100%);
}

/* --- Effect Panel (Right / Slightly Lighter) --- */
.effect-panel {
    background: #2B2B2B;
    padding: 64px 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Spray-paint texture for effect panels */
.effect-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.06;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 22px,
            rgba(240,237,232,0.4) 22px,
            rgba(240,237,232,0.4) 23px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 52px,
            rgba(240,237,232,0.2) 52px,
            rgba(240,237,232,0.2) 53px
        );
}

.effect-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle 14px at 25% 20%, rgba(0, 229, 255, 0.03) 0%, transparent 100%),
        radial-gradient(circle 10px at 55% 55%, rgba(0, 229, 255, 0.04) 0%, transparent 100%),
        radial-gradient(circle 18px at 80% 80%, rgba(0, 229, 255, 0.03) 0%, transparent 100%),
        radial-gradient(circle 8px at 40% 40%, rgba(0, 229, 255, 0.02) 0%, transparent 100%),
        radial-gradient(circle 12px at 70% 15%, rgba(0, 229, 255, 0.03) 0%, transparent 100%);
}

/* --- Dominant Panels (alternating emphasis) --- */
.cause-dominant {
    width: 55%;
}

.cause-dominant + .effect-panel {
    width: 45%;
}

.effect-dominant {
    width: 55%;
}

.split-section .cause-panel:has(+ .effect-dominant) {
    width: 45%;
}

/* --- Typography --- */
.display-heading {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.cause-label {
    font-size: 80px;
    text-transform: uppercase;
    color: #FF4D00;
    text-shadow: 0 0 20px rgba(255, 77, 0, 0.3);
}

.effect-label {
    font-size: 72px;
    color: #00E5FF;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.sub-heading {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: #F0EDE8;
    margin-bottom: 24px;
    opacity: 0.85;
}

.body-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: #F0EDE8;
    margin-bottom: 20px;
    max-width: 520px;
}

.annotation {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 18px;
    color: #8A8A8A;
    display: block;
    margin-top: 16px;
}

/* --- Fade-in Animation for Content --- */
.fade-in {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
}

/* --- SVG Path-Draw Animation --- */
.draw-path {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    transition: stroke-dashoffset 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.draw-path.drawn {
    stroke-dashoffset: 0;
}

/* Mandala ring staggered delays */
.mandala-ring.ring-1 { transition-delay: 0ms; }
.mandala-ring.ring-2 { transition-delay: 100ms; }
.mandala-ring.ring-3 { transition-delay: 200ms; }
.mandala-ring.ring-4 { transition-delay: 300ms; }
.mandala-ring.ring-5 { transition-delay: 400ms; }
.mandala-ring.ring-6 { transition-delay: 500ms; }

/* --- Causality Arrows --- */
.causality-arrow {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 24px 0;
    overflow: visible;
}

/* --- Mandala SVGs --- */
.mandala {
    width: 260px;
    height: 260px;
    margin: 32px auto;
    display: block;
}

.mandala-complex {
    width: 280px;
    height: 280px;
}

.mandala-final {
    width: 300px;
    height: 300px;
}

/* --- City Skyline SVGs --- */
.city-skyline {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 24px 0;
    opacity: 0.08;
}

.city-skyline .skyline-path.drawn {
    opacity: 1;
}

.skyline-dense {
    opacity: 0.12;
}

.skyline-mega {
    opacity: 0.15;
}

/* --- Drip Lines --- */
.drip-line {
    position: absolute;
    width: 1px;
    background: rgba(255, 77, 0, 0.15);
    top: 0;
    height: 0;
    transition: height 1.2s ease-out;
}

.drip-line.active {
    height: var(--drip-height, 120px);
}

.drip-1 { left: 15%; --drip-height: 140px; }
.drip-2 { left: 75%; --drip-height: 100px; }
.drip-3 { left: 40%; --drip-height: 180px; }
.drip-4 { left: 85%; --drip-height: 90px; }
.drip-5 { left: 55%; --drip-height: 160px; }

/* --- Chain-Link Dividers --- */
.chain-divider {
    width: 100%;
    padding: 16px 0;
    background: linear-gradient(to right, #1A1A1A, #2B2B2B);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.chain-svg {
    width: 100%;
    height: 20px;
    display: block;
}

/* --- Convergence Section --- */
.convergence-section {
    width: 100%;
    min-height: 100vh;
    background: #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.convergence-content {
    width: 100%;
    max-width: 1200px;
    padding: 64px 48px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.convergence-heading {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 56px;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #FFE600;
    text-shadow: 0 0 30px rgba(255, 230, 0, 0.25);
    margin-bottom: 40px;
}

.convergence-tag {
    color: #FFE600;
    margin-bottom: 24px;
    font-size: 20px;
}

.convergence-svg {
    width: 100%;
    height: auto;
    max-height: 300px;
    margin: 40px 0;
    overflow: visible;
}

.convergence-text {
    max-width: 700px;
    margin: 0 auto;
    font-size: 18px;
    color: #F0EDE8;
}

/* --- Terminal Section (Inverted Colors) --- */
.terminal-section .terminal-cause {
    background: #2B2B2B;
}

.terminal-section .terminal-effect {
    background: #1A1A1A;
}

/* Invert the pseudo-elements for terminal cause */
.terminal-cause::before {
    opacity: 0.06;
}

.terminal-effect::before {
    opacity: 0.05;
}

/* --- Site Name at bottom --- */
.site-name {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 24px;
    color: #8A8A8A;
    margin-top: 48px;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: 768-1024px */
@media (max-width: 1024px) and (min-width: 768px) {
    .split-section {
        flex-direction: row;
    }

    .cause-panel {
        width: 55%;
    }

    .effect-panel {
        width: 45%;
    }

    .cause-dominant {
        width: 58%;
    }

    .cause-dominant + .effect-panel {
        width: 42%;
    }

    .effect-dominant {
        width: 50%;
    }

    .split-section .cause-panel:has(+ .effect-dominant) {
        width: 50%;
    }

    .cause-label {
        font-size: 60px;
    }

    .effect-label {
        font-size: 54px;
    }

    .convergence-heading {
        font-size: 44px;
    }

    .panel {
        padding: 48px 32px;
    }

    .cause-panel,
    .effect-panel {
        padding: 48px 32px;
    }
}

/* Mobile: <768px */
@media (max-width: 767px) {
    .split-section {
        flex-direction: column;
    }

    .panel,
    .cause-panel,
    .effect-panel,
    .cause-dominant,
    .effect-dominant,
    .cause-dominant + .effect-panel,
    .split-section .cause-panel:has(+ .effect-dominant) {
        width: 100%;
        min-height: auto;
        padding: 32px 24px;
    }

    /* Hide vertical causality line on mobile */
    #causality-line {
        display: none;
    }

    /* Horizontal rule between panels on mobile */
    .cause-panel {
        border-bottom: 2px solid #FF4D00;
    }

    .cause-label {
        font-size: 48px;
    }

    .effect-label {
        font-size: 42px;
    }

    .sub-heading {
        font-size: 22px;
    }

    .convergence-heading {
        font-size: 36px;
    }

    .convergence-content {
        padding: 32px 24px;
    }

    .convergence-svg {
        max-height: 200px;
    }

    .mandala {
        width: 200px;
        height: 200px;
    }

    .mandala-complex {
        width: 220px;
        height: 220px;
    }

    .mandala-final {
        width: 240px;
        height: 240px;
    }

    .body-text {
        max-width: 100%;
    }

    .menu-link {
        font-size: 28px;
        margin: 16px 0;
    }

    /* Simplify drip lines on mobile */
    .drip-line {
        display: none;
    }
}

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
    background: rgba(255, 77, 0, 0.4);
    color: #F0EDE8;
}
