:root {
    --primary-cyan: #08FDD8;
    --primary-dark: #0f0f10;
    --secondary-dark: #1A1B1F;
    --accent-dark: #2B2C31;
    --text-primary: #ffffff;
    --text-secondary: #B0B3B8;
    --glow-primary: rgba(8, 253, 216, 0.4);
    --glow-secondary: rgba(8, 253, 216, 0.1);
    --gradient-1: linear-gradient(135deg, #08FDD8, #00D4FF, #0099FF);
    --gradient-2: linear-gradient(135deg, #FF0080, #FF8C00, #FFD700);
    --gradient-3: linear-gradient(135deg, #9D50BB, #6E48AA, #4A90E2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--primary-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    line-height: 1.6;
    position: relative;
}

/* Optimized animated background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 300%;
    height: 300%;
    z-index: -2;
    background: 
        radial-gradient(circle at 10% 20%, rgba(8, 253, 216, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(255, 0, 128, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(0, 153, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(157, 80, 187, 0.03) 0%, transparent 40%),
        radial-gradient(var(--glow-secondary) 1px, transparent 1px),
        linear-gradient(90deg, transparent 98%, rgba(8, 253, 216, 0.02) 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 80px 80px, 100% 6px;
    animation: cosmicDrift 200s linear infinite;
    opacity: 0.8;
    will-change: transform;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(8, 253, 216, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 0, 128, 0.015) 0%, transparent 50%);
    animation: breathe 8s ease-in-out infinite;
    pointer-events: none;
    will-change: opacity, transform;
}

/* Keyframes */
@keyframes cosmicDrift {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    25% { transform: translate3d(-5%, -5%, 0) rotate(0.5deg); }
    50% { transform: translate3d(-10%, -10%, 0) rotate(1deg); }
    75% { transform: translate3d(-15%, -5%, 0) rotate(0.5deg); }
    100% { transform: translate3d(-20%, -20%, 0) rotate(2deg); }
}

@keyframes breathe {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

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

@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(80px) scale(0.9);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-60px) rotateY(-15deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(60px) rotateY(15deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateX(15deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
    }
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: var(--primary-cyan);
        box-shadow: 0 0 20px rgba(8, 253, 216, 0.2);
    }
    50% {
        border-color: rgba(8, 253, 216, 0.8);
        box-shadow: 0 0 40px rgba(8, 253, 216, 0.4);
    }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px rgba(8, 253, 216, 0.3));
    }
    to {
        filter: drop-shadow(0 0 30px rgba(8, 253, 216, 0.5));
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections */
section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    scroll-snap-align: start;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(8, 253, 216, 0.08);
    padding: 40px 20px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 5vw;
}

/* Intro Section */
.intro {
    background: radial-gradient(ellipse at center, rgba(8, 253, 216, 0.1) 0%, transparent 70%);
    overflow: hidden;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
    animation: fadeInScale 1.2s ease-out 0.2s forwards;
    opacity: 0;
}

.hex-logo-svg {
    width: 220px;
    height: auto;
    max-width: 90vw;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 30px rgba(8, 253, 216, 0.4));
    animation: glow 2s ease-in-out infinite alternate;
}

.hex-logo-svg:hover {
    transform: scale(1.08) rotate(3deg);
    filter: drop-shadow(0 0 50px rgba(8, 253, 216, 0.6));
}

.hex-logo-svg polygon {
    animation: borderGlow 3s ease-in-out infinite;
}

/* Terminal */
.terminal {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    font-weight: 400;
    margin: 0 auto 3rem;
    text-align: left;
    max-width: 800px;
    padding: 2.5rem;
    background: rgba(26, 27, 31, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(8, 253, 216, 0.15);
    backdrop-filter: blur(25px);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    white-space: pre-wrap;
    color: var(--primary-cyan);
}

.terminal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-cyan), transparent, var(--primary-cyan));
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.terminal:hover {
    border-color: rgba(8, 253, 216, 0.3);
    background: rgba(26, 27, 31, 0.8);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(8, 253, 216, 0.1);
}

.terminal:hover::before {
    opacity: 0.2;
}

.cursor {
    display: inline-block;
    width: 12px;
    height: 1.2em;
    background: var(--primary-cyan);
    margin-left: 4px;
    animation: blink 0.8s step-end infinite;
    box-shadow: 0 0 15px var(--primary-cyan);
    border-radius: 1px;
}

/* Quote Sections */
.quote-section {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    padding: 8vh 4vw;
    opacity: 0;
    animation-fill-mode: forwards;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.02em;
    position: relative;
    perspective: 1000px;
}

.quote-section .section-content {
    position: relative;
    z-index: 2;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quote-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(8, 253, 216, 0.03) 0%, transparent 60%);
    border-radius: 24px;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    transform: scale(0.9);
}

.quote-section:hover::before {
    opacity: 1;
    transform: scale(1);
}

.quote-section:hover .section-content {
    transform: translateY(-4px) scale(1.02);
}

.quote-section.in-view::before {
    opacity: 1;
}

.quote-text {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(8, 253, 216, 0.3);
    white-space: pre-line;
    word-wrap: break-word;
    max-width: 100%;
    display: block;
}

.quote-text br {
    display: block;
    margin: 0.5em 0;
}

/* Quote entrance animations */
.quote-section:nth-of-type(2) { animation: slideInFromLeft 1s ease-out 0.3s forwards; }
.quote-section:nth-of-type(3) { animation: slideInFromRight 1s ease-out 0.5s forwards; }
.quote-section:nth-of-type(4) { animation: fadeInScale 1s ease-out 0.7s forwards; }
.quote-section:nth-of-type(5) { animation: slideInFromBottom 1s ease-out 0.9s forwards; }
.quote-section:nth-of-type(6) { animation: slideInFromLeft 1s ease-out 1.1s forwards; }
.quote-section:nth-of-type(7) { animation: slideInFromRight 1s ease-out 1.3s forwards; }

.quote-word {
    display: inline-block;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    transition: all 0.3s ease;
    white-space: pre;
}

.quote-word:hover {
    transform: translateY(-2px);
    text-shadow: 0 0 20px var(--primary-cyan);
}

/* Quote line */
.quote-line {
    display: block;
    margin: 0.5em 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.3;
    letter-spacing: inherit;
    opacity: 0;
    transition: none;
}

.quote-section.in-view .quote-line {
    animation: quoteLineFadeIn 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes quoteLineFadeIn {
    to {
        opacity: 1;
    }
}

/* Section Themes */
.section-theme-1 {
    background: linear-gradient(135deg, rgba(26, 27, 31, 0.9) 0%, rgba(8, 253, 216, 0.06) 50%, rgba(0, 212, 255, 0.04) 100%);
}

.section-theme-2 {
    background: linear-gradient(135deg, rgba(15, 15, 16, 0.95) 0%, rgba(255, 0, 128, 0.04) 50%, rgba(26, 27, 31, 0.8) 100%);
}

.section-theme-3 {
    background: linear-gradient(120deg, rgba(26, 27, 31, 0.9) 0%, rgba(157, 80, 187, 0.05) 50%, rgba(43, 44, 49, 0.7) 100%);
}

.section-theme-4 {
    background: linear-gradient(120deg, rgba(15, 15, 16, 0.95) 0%, rgba(0, 153, 255, 0.05) 30%, rgba(8, 253, 216, 0.03) 70%, rgba(26, 27, 31, 0.9) 100%);
}

.section-theme-5 {
    background: linear-gradient(145deg, rgba(26, 27, 31, 0.8) 0%, rgba(255, 140, 0, 0.04) 50%, rgba(43, 44, 49, 0.9) 100%);
}

.section-theme-6 {
    background: linear-gradient(120deg, rgba(15, 15, 16, 0.9) 0%, rgba(8, 253, 216, 0.08) 50%, rgba(0, 212, 255, 0.05) 100%);
}

/* Contact Section */
.contact {
    background: var(--primary-dark);
    border-top: 1px solid rgba(8, 253, 216, 0.3);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(8, 253, 216, 0.02), transparent);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

.contact-command {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 600;
    animation: slideInFromBottom 0.8s ease-out 0.2s forwards;
    opacity: 0;
    position: relative;
    color: var(--primary-cyan);
}

.contact-command::before {
    content: '> ';
    color: var(--primary-cyan);
    font-weight: 700;
    animation: blink 1.5s step-end infinite;
}

.contact-email {
    margin-bottom: 2.5rem;
    animation: slideInFromBottom 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.contact-email a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 500;
    border-bottom: 2px solid var(--primary-cyan);
    transition: all 0.3s ease;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    background: rgba(8, 253, 216, 0.05);
    border: 1px solid rgba(8, 253, 216, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.contact-email a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(8, 253, 216, 0.2), transparent);
    transition: left 0.6s ease;
    z-index: -1;
}

.contact-email a:hover {
    color: var(--primary-cyan);
    text-shadow: 0 0 10px rgba(8, 253, 216, 0.5);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 40px rgba(8, 253, 216, 0.2);
    border-color: var(--primary-cyan);
    background: rgba(8, 253, 216, 0.1);
}

.contact-email a:hover::before {
    left: 100%;
}

.icons {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    animation: slideInFromBottom 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

.icons a {
    font-size: 2.2rem;
    opacity: 0.8;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
    border-radius: 50%;
    background: rgba(8, 253, 216, 0.05);
    border: 1px solid rgba(8, 253, 216, 0.15);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.icons a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: conic-gradient(from 0deg, var(--primary-cyan), transparent, var(--primary-cyan));
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.icons a:hover {
    opacity: 1;
    transform: scale(1.2) rotate(10deg);
    background: rgba(8, 253, 216, 0.2);
    border-color: var(--primary-cyan);
    box-shadow: 0 15px 40px rgba(8, 253, 216, 0.3);
}

.icons a:hover::before {
    opacity: 0.2;
    animation: rotate 2s linear infinite;
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(8, 253, 216, 0.1);
    z-index: 1000;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-cyan), #00D4FF);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary-cyan);
}

/* Floating Particles */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -5vh;
    width: 2.5px;
    height: 2.5px;
    background: var(--primary-cyan, #08FDD8);
    border-radius: 50%;
    opacity: 0.3;
    will-change: transform, opacity;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--drift, 0vw));
        opacity: 0;
    }
}

/* Focus states */
*:focus-visible {
    outline: 2px solid var(--primary-cyan);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quote-section {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        padding: 4vh 4vw;
    }
    
    .quote-text {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .terminal {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
        padding: 2rem;
    }

    .hex-logo-svg {
        width: 180px;
    }

    .icons {
        gap: 20px;
    }

    .icons a {
        font-size: 1.8rem;
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .quote-section {
        font-size: clamp(1.1rem, 5vw, 1.5rem);
        padding: 3vh 4vw;
    }

    .terminal {
        font-size: clamp(0.8rem, 4vw, 1rem);
        padding: 1.5rem;
    }

    .hex-logo-svg {
        width: 150px;
    }

    .icons {
        gap: 15px;
    }

    .icons a {
        font-size: 1.6rem;
        padding: 0.7rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}