/* ============================================
   gur.al - Hand-drawn meets digital fever dream
   Dopamine Neon on Abyss
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Backgrounds */
    --bg-void-black: #0D0D0F;
    --bg-midnight-violet: #1A0A2E;
    --bg-abyss-teal: #0A1A1A;

    /* Neon Accents */
    --neon-magenta: #FF2D7B;
    --neon-cyan: #00F0FF;
    --neon-lime: #BFFF00;
    --neon-orange: #FF6B00;

    /* Text */
    --text-primary: #E8E0F0;
    --text-secondary: #9B8FB0;
    --sketch-lines: #F5F0FF;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-handwritten: 'Caveat', cursive;
    --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-void-black);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Neon Glow Treatments --- */
.neon-text {
    text-shadow:
        0 0 7px currentColor,
        0 0 20px currentColor,
        0 0 42px currentColor;
}

.neon-cyan {
    color: var(--neon-cyan);
}

.neon-lime {
    color: var(--neon-lime);
}

.neon-orange {
    color: var(--neon-orange);
}

.neon-outline {
    filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 20px currentColor);
}

/* --- Scroll Progress Indicator --- */
.scroll-progress {
    position: fixed;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 50;
    display: flex;
    align-items: stretch;
    pointer-events: none;
}

.progress-line {
    width: 20px;
    height: 100%;
}

.progress-fill {
    stroke-dashoffset: 800;
    filter: drop-shadow(0 0 4px #FF2D7B) drop-shadow(0 0 12px #FF2D7B);
}

.progress-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.progress-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-handwritten);
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.6;
    white-space: nowrap;
}

.progress-marker-icon {
    width: 14px;
    height: 14px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* --- Floating Elements Layer --- */
.floating-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    pointer-events: none;
}

.floating-sketch {
    color: var(--sketch-lines);
}

.floating-dot {
    border-radius: 50%;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.floating-word {
    font-family: var(--font-handwritten);
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.4;
}

/* Drift Animations */
@keyframes drift-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.4; }
    33% { transform: translate(40px, -60px) rotate(12deg); opacity: 0.6; }
    66% { transform: translate(-20px, 30px) rotate(-8deg); opacity: 0.3; }
}

@keyframes drift-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.3; }
    25% { transform: translate(-50px, -30px) rotate(-15deg); opacity: 0.5; }
    50% { transform: translate(30px, -70px) rotate(8deg); opacity: 0.35; }
    75% { transform: translate(-10px, 20px) rotate(-4deg); opacity: 0.55; }
}

@keyframes drift-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.5; }
    40% { transform: translate(60px, 40px) rotate(20deg); opacity: 0.35; }
    70% { transform: translate(-40px, -20px) rotate(-12deg); opacity: 0.6; }
}

@keyframes drift-4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.35; }
    30% { transform: translate(-30px, 50px) rotate(10deg); opacity: 0.5; }
    60% { transform: translate(50px, -40px) rotate(-18deg); opacity: 0.3; }
    85% { transform: translate(20px, 20px) rotate(5deg); opacity: 0.55; }
}

@keyframes drift-5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.45; }
    35% { transform: translate(35px, -50px) rotate(-14deg); opacity: 0.3; }
    65% { transform: translate(-45px, 35px) rotate(16deg); opacity: 0.6; }
}

@keyframes drift-6 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.3; }
    20% { transform: translate(-25px, -45px) rotate(8deg); opacity: 0.5; }
    55% { transform: translate(40px, 25px) rotate(-10deg); opacity: 0.4; }
    80% { transform: translate(-15px, -10px) rotate(14deg); opacity: 0.55; }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.15); }
}

/* --- Act Layout --- */
.act {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
    z-index: 2;
    overflow: hidden;
}

.act-content {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    gap: 60px;
}

/* Serpentine 60/40 alternating layout */
.act-left {
    flex-direction: row;
}

.act-right {
    flex-direction: row-reverse;
}

.act-visual {
    flex: 0 0 58%;
    max-width: 58%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.act-text {
    flex: 0 0 38%;
    max-width: 38%;
}

/* Slight rotation for hand-drawn feel */
.act-text {
    transform: rotate(-1deg);
}

.act-right .act-text {
    transform: rotate(1.5deg);
}

.act-left .act-visual {
    transform: rotate(0.8deg);
}

.act-right .act-visual {
    transform: rotate(-0.5deg);
}

/* --- Typography --- */
.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-style: italic;
    font-size: 120px;
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: var(--neon-magenta);
    margin-bottom: 24px;
}

.act-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-style: italic;
    font-size: 72px;
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: var(--neon-magenta);
    margin-bottom: 20px;
}

.hero-sub {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--neon-cyan);
}

.caveat-text {
    font-family: var(--font-handwritten);
    font-weight: 700;
    font-size: 32px;
    line-height: 1.3;
}

.annotation {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* --- SVG Illustrations --- */
.sketch-illustration {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.sketch-path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Path drawing animation - initial state (hidden) */
.sketch-path {
    opacity: 0;
}

/* When visible, paths animate in */
.act.visible .sketch-path {
    opacity: 1;
    animation: draw-path 1.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Staggered path drawing */
.act.visible .sketch-path:nth-child(1) { animation-delay: 0ms; }
.act.visible .sketch-path:nth-child(2) { animation-delay: 100ms; }
.act.visible .sketch-path:nth-child(3) { animation-delay: 200ms; }
.act.visible .sketch-path:nth-child(4) { animation-delay: 300ms; }
.act.visible .sketch-path:nth-child(5) { animation-delay: 400ms; }
.act.visible .sketch-path:nth-child(6) { animation-delay: 500ms; }
.act.visible .sketch-path:nth-child(7) { animation-delay: 600ms; }
.act.visible .sketch-path:nth-child(8) { animation-delay: 700ms; }
.act.visible .sketch-path:nth-child(9) { animation-delay: 800ms; }
.act.visible .sketch-path:nth-child(10) { animation-delay: 900ms; }
.act.visible .sketch-path:nth-child(11) { animation-delay: 1000ms; }
.act.visible .sketch-path:nth-child(12) { animation-delay: 1100ms; }
.act.visible .sketch-path:nth-child(13) { animation-delay: 1200ms; }
.act.visible .sketch-path:nth-child(14) { animation-delay: 1300ms; }
.act.visible .sketch-path:nth-child(15) { animation-delay: 1400ms; }
.act.visible .sketch-path:nth-child(16) { animation-delay: 1500ms; }
.act.visible .sketch-path:nth-child(17) { animation-delay: 1600ms; }
.act.visible .sketch-path:nth-child(18) { animation-delay: 1700ms; }
.act.visible .sketch-path:nth-child(19) { animation-delay: 1800ms; }
.act.visible .sketch-path:nth-child(20) { animation-delay: 1900ms; }

@keyframes draw-path {
    0% {
        stroke-dashoffset: var(--path-length, 1000);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

/* Neon glow for SVG illustrations */
.act.visible .sketch-illustration {
    filter: drop-shadow(0 0 3px rgba(255, 45, 123, 0.3));
}

/* --- Text Reveal Animation --- */
.act-text .act-title,
.act-text .hero-title,
.act-text .hero-sub,
.act-text .caveat-text,
.act-text .body-text {
    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);
}

.act.text-visible .act-text .act-title,
.act.text-visible .act-text .hero-title {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
    transition-delay: 0ms;
}

.act.text-visible .act-text .hero-sub,
.act.text-visible .act-text .caveat-text:first-of-type {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 150ms;
}

.act.text-visible .act-text .body-text:first-of-type {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 300ms;
}

.act.text-visible .act-text .body-text:nth-of-type(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 450ms;
}

.act.text-visible .act-text .annotation {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 600ms;
}

.act.text-visible .act-text .caveat-text.annotation {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 500ms;
}

/* --- Counter Numbers --- */
.counter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.counter-row {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.counter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.counter-number {
    font-family: var(--font-display);
    font-weight: 900;
    font-style: italic;
    font-size: 120px;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--neon-lime);
    display: inline-block;
}

.counter-small {
    font-size: 80px;
}

.counter-label {
    font-family: var(--font-handwritten);
    font-weight: 400;
    font-size: 22px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.counter-digit {
    display: inline-block;
    transition: transform 0.1s ease-out;
}

.counter-digit.bounce {
    transform: translateY(-4px);
}

/* Wavy underline */
.wavy-underline {
    width: 100%;
    max-width: 300px;
    height: 15px;
    margin-top: 4px;
}

.wavy-path {
    opacity: 0;
}

.act.counter-active .wavy-path {
    opacity: 1;
    animation: draw-path 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
    animation-delay: 2.5s;
}

/* --- 3D Floating Object --- */
.floating-3d-object {
    position: relative;
    animation: float-3d 8s ease-in-out infinite;
}

@keyframes float-3d {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(-1deg); }
    75% { transform: translateY(-20px) rotate(1.5deg); }
}

/* --- Act Transitions --- */
.act-transition {
    height: 50vh;
    position: relative;
    z-index: 2;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .act {
        padding: 60px 40px;
    }

    .act-content {
        flex-direction: column !important;
        gap: 40px;
    }

    .act-visual,
    .act-text {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .hero-title {
        font-size: 72px;
    }

    .act-title {
        font-size: 48px;
    }

    .counter-number {
        font-size: 80px;
    }

    .counter-small {
        font-size: 56px;
    }

    .scroll-progress {
        left: 12px;
    }

    .counter-row {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .act {
        padding: 40px 24px;
    }

    .hero-title {
        font-size: 52px;
    }

    .act-title {
        font-size: 36px;
    }

    .counter-number {
        font-size: 56px;
    }

    .counter-small {
        font-size: 42px;
    }

    .body-text {
        font-size: 17px;
    }

    .caveat-text {
        font-size: 24px;
    }

    .scroll-progress {
        display: none;
    }
}
