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

:root{
    --bg-deep:#0b0e11;
    --bg-mid:#161b22;
    --bg-surface:#2d333b;
    --teal:#66d9cc;
    --teal-dark:#4a9e9e;
    --text-primary:#e6edf3;
    --text-secondary:#c9d1d9;
    --font-display:'Cormorant Garamond',serif;
    --font-body:'Space Grotesk',sans-serif;
    --font-mono:'Fira Code',monospace;
}

html{scroll-behavior:smooth}

body{
    background:var(--bg-deep);
    color:var(--text-secondary);
    font-family:var(--font-body);
    font-weight:300;
    font-size:1rem;
    line-height:1.7;
    overflow-x:hidden;
}

.flowing-curves{
    position:fixed;
    top:0;left:0;
    width:100%;height:100%;
    z-index:-1;
    pointer-events:none;
}

.curve{
    opacity:0.2;
    stroke-dasharray:8000;
    stroke-dashoffset:8000;
    animation:flowCurve 45s linear infinite;
}
.curve-1{animation-duration:40s;opacity:0.25}
.curve-2{animation-duration:55s;opacity:0.15;animation-delay:-10s}
.curve-3{animation-duration:50s;opacity:0.18;animation-delay:-20s}
.curve-4{animation-duration:60s;opacity:0.12;animation-delay:-5s}

@keyframes flowCurve{
    0%{stroke-dashoffset:8000}
    50%{stroke-dashoffset:0}
    100%{stroke-dashoffset:-8000}
}

/* Hero */
.hero{
    height:100vh;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    position:relative;
}

.hero-curve{
    position:absolute;
    top:0;left:50%;
    transform:translateX(-50%);
    width:100px;height:100%;
    z-index:0;
}

.intro-curve{
    stroke-dasharray:600;
    stroke-dashoffset:600;
    animation:drawCurve 2.5s cubic-bezier(0.4,0,0.2,1) 0.4s forwards;
}

@keyframes drawCurve{
    to{stroke-dashoffset:0}
}

.hero-title{
    font-family:var(--font-display);
    font-weight:600;
    font-style:italic;
    font-size:clamp(3rem,7vw,6rem);
    color:var(--text-primary);
    letter-spacing:0.02em;
    line-height:1.05;
    opacity:0;
    animation:fadeIn 1.2s ease 1.2s forwards;
    position:relative;z-index:1;
}

.hero-subtitle{
    font-family:var(--font-body);
    font-size:1rem;
    color:var(--text-secondary);
    opacity:0;
    animation:fadeIn 1s ease 1.8s forwards;
    position:relative;z-index:1;
}

@keyframes fadeIn{
    to{opacity:0.6}
}

.scroll-chevron{
    position:absolute;
    bottom:3rem;
    opacity:0.5;
    animation:bob 3s ease-in-out infinite;
}

@keyframes bob{
    0%,100%{transform:translateY(0)}
    50%{transform:translateY(8px)}
}

/* Diagonal Sections */
.diagonal-section{
    position:relative;
    padding:12vh 5vw 14vh;
    min-height:80vh;
    transition:filter 0.8s cubic-bezier(0.25,0.1,0.25,1),opacity 0.8s cubic-bezier(0.25,0.1,0.25,1);
    filter:blur(12px);
    opacity:0.3;
}

.diagonal-section.in-view{
    filter:blur(0px);
    opacity:1;
}

.diagonal-section.past-view{
    filter:blur(6px);
    opacity:0.6;
}

.section-1{
    background:var(--bg-mid);
    clip-path:polygon(0 0,100% 5vh,100% 100%,0 calc(100% - 5vh));
}
.section-2{
    background:var(--bg-deep);
    clip-path:polygon(0 5vh,100% 0,100% calc(100% - 5vh),0 100%);
}
.section-3{
    background:var(--bg-mid);
    clip-path:polygon(0 0,100% 4vh,100% 100%,0 calc(100% - 4vh));
}
.section-4{
    background:var(--bg-deep);
    clip-path:polygon(0 4vh,100% 0,100% calc(100% - 6vh),0 100%);
}
.section-5{
    background:var(--bg-mid);
    clip-path:polygon(0 0,100% 6vh,100% 100%,0 calc(100% - 3vh));
}

.section-content{
    max-width:38rem;
    position:relative;
    z-index:1;
}

.section-1 .section-content,
.section-3 .section-content,
.section-5 .section-content{
    margin-left:10vw;
}

.section-2 .section-content,
.section-4 .section-content{
    margin-left:auto;
    margin-right:10vw;
}

.section-title{
    font-family:var(--font-display);
    font-weight:600;
    font-style:italic;
    font-size:clamp(2.8rem,6vw,5.5rem);
    color:var(--text-primary);
    letter-spacing:0.02em;
    line-height:1.05;
    margin-bottom:1.5rem;
}

.section-text{
    margin-bottom:1rem;
    font-size:0.95rem;
}

.logic{
    font-family:var(--font-mono);
    color:var(--text-primary);
    font-size:0.9em;
    transition:text-shadow 0.2s ease;
}

.logic.glow{
    text-shadow:0 0 8px rgba(102,217,204,0.3);
}

.section-diagram{
    width:180px;
    height:auto;
    margin-top:2rem;
    opacity:0.7;
}

/* Bubbles */
.bubble{
    position:absolute;
    border-radius:50%;
    background:var(--text-secondary);
    opacity:0.08;
    animation:rise linear infinite;
}

@keyframes rise{
    0%{transform:translateY(0)}
    100%{transform:translateY(-120vh)}
}

/* Footer */
.site-footer{
    padding:8rem 0 4rem;
    text-align:center;
}

.footer-text{
    font-family:var(--font-display);
    font-size:2rem;
    color:var(--text-secondary);
    opacity:0.4;
}

/* Reduced motion */
@media(prefers-reduced-motion:reduce){
    .diagonal-section{filter:none!important;opacity:1!important;transition:none}
    .curve,.bubble,.scroll-chevron,.intro-curve{animation:none}
    .hero-title,.hero-subtitle{opacity:0.6;animation:none}
    .intro-curve{stroke-dashoffset:0}
}
