/* ============================================
   How to Bluesky - Video Showcase Styles
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-black: #000000;
    --violet-light: #c084fc;
    --violet-main: #a855f7;
    --violet-dark: #7c3aed;
    --purple-light: #e879f9;
    --purple-main: #d946ef;
    --purple-dark: #a21caf;
    --magenta: #f0abfc;
    --glow-violet: rgba(168, 85, 247, 0.6);
    --glow-purple: rgba(217, 70, 239, 0.6);
    --text-white: #fafafa;
    --text-muted: rgba(250, 250, 250, 0.7);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Main Container with Scroll Snap */
.video-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Hide scrollbar but keep functionality */
.video-container::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.video-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================
   Video Sections
   ============================================ */
.video-section {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem;
    overflow: hidden;
}

/* Glow Container */
.glow-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video Glow Effect */
.video-glow {
    position: absolute;
    inset: -40px;
    border-radius: 30px;
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.5s ease;
    background: radial-gradient(
        ellipse at center,
        var(--glow-violet) 0%,
        var(--glow-purple) 50%,
        transparent 70%
    );
    z-index: 0;
    pointer-events: none;
}

.video-section.playing .video-glow {
    opacity: 0.8;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Video Player */
.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
    position: relative;
    z-index: 1;
    background: #111;
    box-shadow:
        0 0 0 1px rgba(168, 85, 247, 0.2),
        0 25px 50px -12px rgba(0, 0, 0, 0.8);
    transition: box-shadow 0.3s ease;
}

.video-section.playing .video-player {
    box-shadow:
        0 0 0 2px rgba(168, 85, 247, 0.4),
        0 0 40px rgba(168, 85, 247, 0.3),
        0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Hidden canvas for color sampling */
.color-sampler {
    display: none;
}

/* ============================================
   Bubbly Tentacle-like Titles
   ============================================ */
.section-title {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    width: 90%;
    max-width: 800px;
}

.title-text {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    display: inline-block;

    /* Gradient text */
    background: linear-gradient(
        135deg,
        var(--magenta) 0%,
        var(--violet-light) 25%,
        var(--purple-light) 50%,
        var(--violet-main) 75%,
        var(--purple-main) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    /* Bubbly text shadow glow */
    filter: drop-shadow(0 0 10px var(--glow-violet))
            drop-shadow(0 0 20px var(--glow-purple))
            drop-shadow(0 0 40px rgba(168, 85, 247, 0.4));

    /* Animation for flowing effect */
    animation: titleFlow 4s ease-in-out infinite, titleBubble 6s ease-in-out infinite;
}

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

@keyframes titleBubble {
    0%, 100% {
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 10px var(--glow-violet))
                drop-shadow(0 0 20px var(--glow-purple))
                drop-shadow(0 0 40px rgba(168, 85, 247, 0.4));
    }
    25% {
        transform: scale(1.02) translateY(-3px);
    }
    50% {
        transform: scale(1) translateY(0);
        filter: drop-shadow(0 0 15px var(--glow-purple))
                drop-shadow(0 0 30px var(--glow-violet))
                drop-shadow(0 0 50px rgba(217, 70, 239, 0.5));
    }
    75% {
        transform: scale(1.01) translateY(-2px);
    }
}

/* Tentacle decorations */
.section-title::before,
.section-title::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        var(--glow-purple) 0%,
        transparent 70%
    );
    filter: blur(20px);
    opacity: 0.5;
    animation: tentacleFloat 5s ease-in-out infinite;
}

.section-title::before {
    left: -50px;
    top: -20px;
    animation-delay: 0s;
}

.section-title::after {
    right: -50px;
    bottom: -20px;
    animation-delay: 2.5s;
}

@keyframes tentacleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(10px, -10px) scale(1.2);
        opacity: 0.6;
    }
    66% {
        transform: translate(-5px, 5px) scale(0.9);
        opacity: 0.4;
    }
}

/* ============================================
   Play Button
   ============================================ */
.play-button {
    position: absolute;
    z-index: 5;
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
        135deg,
        var(--violet-dark) 0%,
        var(--purple-dark) 100%
    );
    box-shadow:
        0 0 20px var(--glow-violet),
        0 0 40px var(--glow-purple),
        inset 0 0 20px rgba(255, 255, 255, 0.1);

    transition: all 0.3s ease;
}

.play-button svg {
    width: 36px;
    height: 36px;
    color: white;
    margin-left: 4px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow:
        0 0 30px var(--glow-violet),
        0 0 60px var(--glow-purple),
        inset 0 0 25px rgba(255, 255, 255, 0.2);
}

.play-button:active {
    transform: scale(0.95);
}

.video-section.playing .play-button {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
}

/* ============================================
   Navigation Dots
   ============================================ */
.section-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.nav-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--violet-main);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-dot::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: var(--glow-violet);
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-dot:hover {
    background: var(--violet-light);
    border-color: var(--purple-light);
    transform: scale(1.2);
}

.nav-dot:hover::before {
    opacity: 0.5;
}

.nav-dot.active {
    background: linear-gradient(135deg, var(--violet-main), var(--purple-main));
    border-color: var(--magenta);
    box-shadow: 0 0 15px var(--glow-violet);
}

.nav-dot.active::before {
    opacity: 0.7;
}

/* ============================================
   Scroll Indicator
   ============================================ */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-indicator span {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: linear-gradient(90deg, var(--violet-light), var(--purple-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--violet-main);
    border-bottom: 2px solid var(--violet-main);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: rotate(45deg) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: rotate(45deg) translate(5px, 5px);
        opacity: 0.5;
    }
}

/* ============================================
   Background Ambient Effects
   ============================================ */
.video-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse 80% 50% at 20% 20%,
            rgba(139, 92, 246, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse 60% 40% at 80% 80%,
            rgba(217, 70, 239, 0.06) 0%,
            transparent 50%
        );
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .section-title {
        top: 5%;
    }

    .title-text {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    .section-title::before,
    .section-title::after {
        width: 60px;
        height: 60px;
    }

    .glow-container {
        max-width: 95%;
    }

    .play-button {
        width: 64px;
        height: 64px;
    }

    .play-button svg {
        width: 28px;
        height: 28px;
    }

    .section-nav {
        right: 12px;
        gap: 12px;
    }

    .nav-dot {
        width: 10px;
        height: 10px;
    }

    .video-glow {
        inset: -20px;
        filter: blur(40px);
    }
}

@media (max-width: 480px) {
    .video-section {
        padding: 1rem;
    }

    .section-title {
        top: 3%;
    }

    .title-text {
        font-size: clamp(1.2rem, 7vw, 1.6rem);
    }

    .scroll-indicator span {
        font-size: 0.7rem;
    }
}

/* ============================================
   Video Controls Customization
   ============================================ */
.video-player::-webkit-media-controls-panel {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        transparent 100%
    );
}

/* ============================================
   Credits Section
   ============================================ */
.credits-section {
    justify-content: center;
    gap: 3rem;
}

/* Sign Up CTA */
.signup-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
}

.signup-label {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    background: linear-gradient(90deg, var(--violet-light), var(--purple-light), var(--magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px var(--glow-violet));
}

.signup-link {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    background: linear-gradient(
        135deg,
        var(--magenta) 0%,
        var(--violet-light) 25%,
        var(--purple-light) 50%,
        var(--violet-main) 75%,
        var(--purple-main) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    filter: drop-shadow(0 0 15px var(--glow-violet))
            drop-shadow(0 0 30px var(--glow-purple))
            drop-shadow(0 0 45px rgba(168, 85, 247, 0.4));

    animation: titleFlow 4s ease-in-out infinite, titleBubble 6s ease-in-out infinite;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.signup-link:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px var(--glow-violet))
            drop-shadow(0 0 40px var(--glow-purple))
            drop-shadow(0 0 60px rgba(217, 70, 239, 0.6));
}

.signup-link .external-icon {
    width: 0.5em;
    height: 0.5em;
}

.credits-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    z-index: 2;
}

.credit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.credit-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    background: linear-gradient(90deg, var(--violet-light), var(--purple-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.credit-link {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    background: linear-gradient(
        135deg,
        var(--magenta) 0%,
        var(--violet-light) 25%,
        var(--purple-light) 50%,
        var(--violet-main) 75%,
        var(--purple-main) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    filter: drop-shadow(0 0 10px var(--glow-violet))
            drop-shadow(0 0 20px var(--glow-purple));

    animation: titleFlow 4s ease-in-out infinite;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.credit-link:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px var(--glow-violet))
            drop-shadow(0 0 30px var(--glow-purple))
            drop-shadow(0 0 45px rgba(217, 70, 239, 0.5));
}

.external-icon {
    width: 0.6em;
    height: 0.6em;
    stroke: var(--violet-light);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.credit-link:hover .external-icon {
    opacity: 1;
}

/* Ambient glow for credits section */
.credits-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        var(--glow-purple) 0%,
        var(--glow-violet) 30%,
        transparent 70%
    );
    filter: blur(80px);
    opacity: 0.4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    animation: creditsGlowPulse 5s ease-in-out infinite;
}

@keyframes creditsGlowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .title-text,
    .section-title::before,
    .section-title::after,
    .video-glow,
    .scroll-arrow,
    .credits-glow,
    .credit-link,
    .signup-link {
        animation: none;
    }

    .video-container {
        scroll-behavior: auto;
    }
}
