/* ============================================
   PPADDL.com - Styles
   Dreamy-ethereal aurora dreamscape
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #12081F;
    --bg-alternate: #1A0E2E;
    --aurora-pink: #FF6FD8;
    --aurora-green: #3DFFA2;
    --aurora-violet: #B84CFF;
    --aurora-cyan: #00E5FF;
    --text-primary: #FEFCFF;
    --text-body: #F0E8F8;
    --text-muted: #A78BBA;
    --text-dark: #2A1B3D;
    --grain-tint: #FFE4F2;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-ui: 'Inter', sans-serif;

    --aurora-sweep: linear-gradient(135deg, #FF6FD8 0%, #B84CFF 40%, #3DFFA2 70%, #00E5FF 100%);
    --depth-fade: radial-gradient(ellipse at 30% 70%, rgba(184, 76, 255, 0.15) 0%, transparent 60%);
}

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

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

body {
    background-color: var(--bg-primary);
    color: var(--text-body);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Canvas Layers
   ============================================ */

#aurora-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

#grain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.04;
}

/* ============================================
   Scroll Progress Indicator
   ============================================ */

#scroll-progress {
    position: fixed;
    left: 16px;
    top: 0;
    width: 3px;
    height: 100vh;
    background: rgba(167, 139, 186, 0.1);
    z-index: 900;
    border-radius: 2px;
}

#scroll-progress-fill {
    width: 100%;
    height: 0%;
    background: var(--aurora-sweep);
    border-radius: 2px;
    transition: height 0.1s ease-out;
}

#scroll-progress-label {
    position: absolute;
    bottom: 20px;
    left: 12px;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ============================================
   Scenes - General
   ============================================ */

.scene {
    position: relative;
    width: 100%;
    z-index: 1;
}

/* ============================================
   Scene 1: Emergence
   ============================================ */

#scene-emergence {
    height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    background: var(--bg-primary);
}

#scene-emergence .scene-content {
    position: relative;
    padding-left: 8vw;
    padding-bottom: 20vh;
}

#tagline-container {
    margin-bottom: 16px;
    min-height: 28px;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(64px, 10vw, 120px);
    letter-spacing: -0.03em;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    line-height: 1.1;
}

.wordmark.visible {
    opacity: 0.6;
}

.typewriter-text {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 16px;
    color: var(--aurora-pink);
    text-shadow: 0 0 20px rgba(255, 111, 216, 0.4);
}

.typed-cursor {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 16px;
    color: var(--aurora-pink);
    text-shadow: 0 0 20px rgba(255, 111, 216, 0.4);
    animation: cursorBlink 800ms ease-in-out infinite;
    display: inline;
}

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

/* ============================================
   Breathing Spaces
   ============================================ */

.breathing-space {
    position: relative;
    height: 40vh;
    background: var(--bg-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-space-large {
    height: 50vh;
}

.breathing-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generative-glyph {
    width: 200px;
    height: 200px;
    opacity: 0.3;
}

/* Light Leaks */
.light-leak {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.light-leak-pink {
    width: 400px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(255, 111, 216, 0.08) 0%, transparent 70%);
    top: -10%;
    right: 15%;
}

.light-leak-green {
    width: 350px;
    height: 350px;
    background: radial-gradient(ellipse, rgba(61, 255, 162, 0.06) 0%, transparent 70%);
    bottom: -15%;
    left: 20%;
}

/* Orbiting Light Leaks */
.orbiting-leaks {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.light-leak-orbit {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.light-leak-orbit-pink {
    background: radial-gradient(ellipse, rgba(255, 111, 216, 0.1) 0%, transparent 60%);
    animation: orbitPink 40s ease-in-out infinite;
}

.light-leak-orbit-green {
    background: radial-gradient(ellipse, rgba(61, 255, 162, 0.07) 0%, transparent 60%);
    animation: orbitGreen 50s ease-in-out infinite;
}

.light-leak-orbit-violet {
    background: radial-gradient(ellipse, rgba(184, 76, 255, 0.08) 0%, transparent 60%);
    animation: orbitViolet 45s ease-in-out infinite;
}

@keyframes orbitPink {
    0%, 100% { transform: translate(-50%, -50%) translate(0px, 0px); }
    25% { transform: translate(-50%, -50%) translate(80px, -40px); }
    50% { transform: translate(-50%, -50%) translate(-60px, 60px); }
    75% { transform: translate(-50%, -50%) translate(40px, 40px); }
}

@keyframes orbitGreen {
    0%, 100% { transform: translate(-50%, -50%) translate(0px, 0px); }
    25% { transform: translate(-50%, -50%) translate(-70px, 50px); }
    50% { transform: translate(-50%, -50%) translate(90px, -30px); }
    75% { transform: translate(-50%, -50%) translate(-30px, -70px); }
}

@keyframes orbitViolet {
    0%, 100% { transform: translate(-50%, -50%) translate(0px, 0px); }
    25% { transform: translate(-50%, -50%) translate(50px, 60px); }
    50% { transform: translate(-50%, -50%) translate(-80px, -20px); }
    75% { transform: translate(-50%, -50%) translate(60px, -50px); }
}

/* Aurora Color Band Waves (Breathing spaces) */
.breathing-space::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(135deg, rgba(255, 111, 216, 0.04) 0%, transparent 50%),
        linear-gradient(225deg, rgba(61, 255, 162, 0.03) 0%, transparent 50%),
        linear-gradient(315deg, rgba(184, 76, 255, 0.04) 0%, transparent 50%);
    background-size: 200% 200%, 200% 200%, 200% 200%;
    animation: auroraWave1 30s ease-in-out infinite,
               auroraWave2 45s ease-in-out infinite,
               auroraWave3 60s ease-in-out infinite;
}

@keyframes auroraWave1 {
    0%, 100% { background-position: 0% 50%, 100% 50%, 50% 0%; }
    50% { background-position: 100% 50%, 0% 50%, 50% 100%; }
}

@keyframes auroraWave2 {
    0%, 100% { background-position: 50% 0%, 50% 100%, 0% 50%; }
    50% { background-position: 50% 100%, 50% 0%, 100% 50%; }
}

@keyframes auroraWave3 {
    0%, 100% { background-position: 100% 0%, 0% 100%, 50% 50%; }
    50% { background-position: 0% 100%, 100% 0%, 50% 50%; }
}

/* ============================================
   Drift Scenes
   ============================================ */

.drift-scene {
    min-height: 120vh;
    background: var(--bg-alternate);
    padding: 15vh 0;
    overflow: hidden;
}

.drift-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 0 20px;
    max-width: 100vw;
    padding: 0 4vw;
    position: relative;
}

.drift-block {
    position: relative;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.drift-block.visible {
    opacity: 1;
}

/* Scene 3: First Drift */
.drift-primary {
    grid-column: 2 / 9;
    transform: rotate(-1.5deg) translateX(-80px);
}

.drift-primary.visible {
    transform: rotate(-1.5deg) translateX(0);
}

.drift-secondary {
    grid-column: 10 / 16;
    transform: rotate(2deg) translateX(80px);
    align-self: center;
}

.drift-secondary.visible {
    transform: rotate(2deg) translateX(0);
}

/* Scene 5: Second Drift (inverted) */
.drift-secondary-left {
    grid-column: 1 / 7;
    transform: rotate(-2.5deg) translateX(-80px);
}

.drift-secondary-left.visible {
    transform: rotate(-2.5deg) translateX(0);
}

.drift-primary-right {
    grid-column: 9 / 16;
    transform: rotate(2deg) translateX(80px);
}

.drift-primary-right.visible {
    transform: rotate(2deg) translateX(0);
}

.drift-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(32px, 4vw, 64px);
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.15;
}

.drift-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-body);
    margin-bottom: 20px;
}

.drift-body:last-child {
    margin-bottom: 0;
}

/* Text on light backgrounds */
.text-on-light {
    color: #2A1B3D;
}

/* Pullquote */
.pullquote-container {
    margin: 32px 0;
    padding: 24px 0;
    border-left: 2px solid rgba(255, 111, 216, 0.3);
    padding-left: 24px;
    min-height: 48px;
}

.pullquote-container .typewriter-text {
    font-size: 18px;
}

.pullquote-container .typed-cursor {
    font-size: 18px;
}

/* Aurora Visualization Canvases */
.aurora-viz {
    width: 100%;
    height: 400px;
    border-radius: 4px;
}

/* Edge Glow on drift blocks */
.drift-block {
    box-shadow:
        0 0 40px rgba(255, 111, 216, 0.08),
        0 0 80px rgba(61, 255, 162, 0.05),
        0 0 120px rgba(184, 76, 255, 0.03);
    padding: 40px;
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.drift-block.visible {
    box-shadow:
        0 0 60px rgba(255, 111, 216, 0.16),
        0 0 120px rgba(61, 255, 162, 0.1),
        0 0 180px rgba(184, 76, 255, 0.06);
}

/* Depth Fade Backgrounds */
.depth-fade {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.depth-fade-1 {
    background: var(--depth-fade);
    top: 20%;
    left: 10%;
}

.depth-fade-2 {
    background: radial-gradient(ellipse at 70% 30%, rgba(184, 76, 255, 0.15) 0%, transparent 60%);
    top: 30%;
    right: 10%;
}

/* ============================================
   Scene 6: Convergence
   ============================================ */

#scene-convergence {
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    background: var(--bg-primary);
    position: relative;
}

.scene-content-end {
    padding-right: 8vw;
    padding-top: 20vh;
    text-align: right;
}

.wordmark-end {
    margin-bottom: 16px;
}

#closing-tagline-container {
    min-height: 28px;
}

#closing-tagline-container .typewriter-text {
    font-size: 16px;
}

#closing-tagline-container .typed-cursor {
    font-size: 16px;
}

/* ============================================
   Generative Glyphs Container
   ============================================ */

#glyph-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

#glyph-container svg {
    position: absolute;
    opacity: 0.3;
}

/* ============================================
   Light Leak Transitions between sections
   ============================================ */

.drift-scene::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 229, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.drift-scene::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: 15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 111, 216, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .breathing-space::before {
        animation: none;
    }
    .light-leak-orbit-pink,
    .light-leak-orbit-green,
    .light-leak-orbit-violet {
        animation: none;
    }
    .typed-cursor {
        animation: none;
        opacity: 1;
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
    .drift-grid {
        display: flex;
        flex-direction: column;
        gap: 40px;
        padding: 0 6vw;
    }

    .drift-primary,
    .drift-secondary,
    .drift-primary-right,
    .drift-secondary-left {
        grid-column: auto;
        transform: rotate(0deg) translateX(-40px);
    }

    .drift-primary.visible,
    .drift-secondary.visible,
    .drift-primary-right.visible,
    .drift-secondary-left.visible {
        transform: rotate(0deg) translateX(0);
    }

    .wordmark {
        font-size: clamp(48px, 12vw, 96px);
    }

    #scene-emergence .scene-content {
        padding-left: 6vw;
        padding-bottom: 15vh;
    }

    .scene-content-end {
        padding-right: 6vw;
        padding-top: 15vh;
    }

    .aurora-viz {
        height: 280px;
    }

    .drift-block {
        padding: 24px;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }

    .drift-heading {
        font-size: clamp(24px, 7vw, 40px);
    }

    .drift-body {
        font-size: 16px;
    }

    .typewriter-text {
        font-size: 14px;
    }

    .typed-cursor {
        font-size: 14px;
    }

    #scroll-progress {
        left: 8px;
    }
}
