/* ==========================================================================
   continua.club - Candy Topology
   ========================================================================== */

/* --- Custom Properties --- */
:root {
    --bubblegum-pink: #FF6EA2;
    --lemon-drop: #FFEAA7;
    --grape-fizz: #6C5CE7;
    --mint-sorbet: #00D2D3;
    --cloud-white: #FFF9FB;
    --cotton-candy: #FFD6E0;
    --marshmallow-lilac: #DFE6FF;
    --deep-plum: #2D1B4E;
    --tangerine-pop: #FF9F43;
    --bounce-bezier: cubic-bezier(0.34, 1.56, 0.64, 1);
    --font-display: 'Quicksand', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--deep-plum);
    background: linear-gradient(
        to bottom,
        var(--cloud-white) 0%,
        var(--cloud-white) 20%,
        var(--cotton-candy) 50%,
        var(--marshmallow-lilac) 85%,
        var(--marshmallow-lilac) 100%
    );
    background-attachment: fixed;
    overflow-x: hidden;
    line-height: 1.7;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

/* --- Floating Elements Container --- */
.floating-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floater {
    position: absolute;
    will-change: transform;
    opacity: 0;
    transition: opacity 400ms ease-out;
}

.floater.visible {
    opacity: 1;
}

/* The Blob */
.floater-blob {
    width: 50px;
    height: 50px;
    border-radius: 30% 70% 60% 40% / 50% 60% 40% 50%;
    background: var(--bubblegum-pink);
    opacity: 0;
}
.floater-blob.visible { opacity: 0.35; }

.floater-1 {
    top: 12%;
    left: 8%;
    width: 55px;
    height: 55px;
    animation: float-drift-1 30s ease-in-out infinite, blob-rotate 30s linear infinite;
}

.floater-2 {
    top: 65%;
    left: 78%;
    width: 42px;
    height: 42px;
    animation: float-drift-2 25s ease-in-out infinite, blob-rotate 35s linear infinite reverse;
}

.floater-15 {
    top: 40%;
    left: 55%;
    width: 48px;
    height: 48px;
    animation: float-drift-5 28s ease-in-out infinite, blob-rotate 32s linear infinite;
}

/* The Ring */
.floater-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--grape-fizz);
    background: transparent;
    opacity: 0;
}
.floater-ring.visible { opacity: 0.4; }

.floater-3 {
    top: 25%;
    left: 85%;
    width: 45px;
    height: 45px;
    animation: float-drift-3 22s ease-in-out infinite;
}

.floater-4 {
    top: 70%;
    left: 15%;
    width: 35px;
    height: 35px;
    animation: float-drift-4 28s ease-in-out infinite;
}

.floater-16 {
    top: 50%;
    left: 42%;
    width: 38px;
    height: 38px;
    border-color: var(--mint-sorbet);
    animation: float-drift-6 24s ease-in-out infinite;
}

/* The Dot Cluster */
.floater-dot-cluster {
    width: 40px;
    height: 40px;
    position: absolute;
}
.floater-dot-cluster.visible { opacity: 0.5; }

.floater-dot-cluster .dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.floater-dot-cluster .dot:nth-child(1) { top: 0; left: 15px; }
.floater-dot-cluster .dot:nth-child(2) { bottom: 5px; left: 0; }
.floater-dot-cluster .dot:nth-child(3) { bottom: 5px; right: 0; }

.dot-pink { background: var(--bubblegum-pink); }
.dot-grape { background: var(--grape-fizz); }
.dot-mint { background: var(--mint-sorbet); }
.dot-lemon { background: var(--lemon-drop); }
.dot-tangerine { background: var(--tangerine-pop); }

.floater-5 {
    top: 18%;
    left: 45%;
    animation: float-drift-5 20s ease-in-out infinite;
}
.floater-5 .dot:nth-child(1) { animation: orbit-1 20s ease-in-out infinite; }
.floater-5 .dot:nth-child(2) { animation: orbit-2 20s ease-in-out infinite; }
.floater-5 .dot:nth-child(3) { animation: orbit-3 20s ease-in-out infinite; }

.floater-6 {
    top: 80%;
    left: 60%;
    animation: float-drift-6 18s ease-in-out infinite;
}
.floater-6 .dot:nth-child(1) { animation: orbit-1 22s ease-in-out infinite; }
.floater-6 .dot:nth-child(2) { animation: orbit-2 22s ease-in-out infinite; }
.floater-6 .dot:nth-child(3) { animation: orbit-3 22s ease-in-out infinite; }

/* The Squircle */
.floater-squircle {
    width: 60px;
    height: 60px;
    border-radius: 35%;
    background: var(--lemon-drop);
    opacity: 0;
}
.floater-squircle.visible { opacity: 0.25; }

.floater-7 {
    top: 35%;
    left: 5%;
    width: 65px;
    height: 65px;
    animation: float-drift-3 25s ease-in-out infinite, squircle-morph 25s ease-in-out infinite;
}

.floater-8 {
    top: 55%;
    left: 90%;
    width: 55px;
    height: 55px;
    animation: float-drift-4 22s ease-in-out infinite, squircle-morph 20s ease-in-out infinite;
}

.floater-18 {
    top: 15%;
    left: 70%;
    width: 50px;
    height: 50px;
    animation: float-drift-1 26s ease-in-out infinite, squircle-morph 22s ease-in-out infinite;
}

/* The Torus */
.floater-torus {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 35%, var(--mint-sorbet) 36%, var(--mint-sorbet) 55%, transparent 56%);
    opacity: 0;
}
.floater-torus.visible { opacity: 0.45; }

.floater-9 {
    top: 45%;
    left: 25%;
    width: 42px;
    height: 42px;
    animation: float-drift-1 18s ease-in-out infinite;
}

.floater-10 {
    top: 8%;
    left: 65%;
    width: 38px;
    height: 38px;
    animation: float-drift-2 22s ease-in-out infinite;
}

.floater-17 {
    top: 75%;
    left: 35%;
    width: 44px;
    height: 44px;
    animation: float-drift-5 20s ease-in-out infinite;
}

/* The Line Segment */
.floater-line {
    width: 70px;
    height: 3px;
    border-radius: 2px;
    background: var(--tangerine-pop);
    opacity: 0;
}
.floater-line.visible { opacity: 0.3; }

.floater-11 {
    top: 30%;
    left: 70%;
    width: 75px;
    animation: float-drift-6 20s ease-in-out infinite, line-rotate 40s linear infinite;
}

.floater-12 {
    top: 85%;
    left: 20%;
    width: 65px;
    animation: float-drift-3 24s ease-in-out infinite, line-rotate 35s linear infinite reverse;
}

/* The Crescent */
.floater-crescent {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--cotton-candy);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    position: absolute;
    opacity: 0;
    overflow: hidden;
}
.floater-crescent.visible { opacity: 0.45; }

.floater-crescent::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cloud-white);
    top: -4px;
    left: 8px;
}

.floater-13 {
    top: 60%;
    left: 50%;
    width: 32px;
    height: 32px;
    animation: float-drift-2 26s ease-in-out infinite;
}

.floater-14 {
    top: 5%;
    left: 30%;
    width: 28px;
    height: 28px;
    animation: float-drift-4 30s ease-in-out infinite;
}

/* --- Float Drift Keyframes --- */
@keyframes float-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-15px, 25px); }
    75% { transform: translate(20px, 10px); }
}

@keyframes float-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-25px, 15px); }
    50% { transform: translate(20px, -30px); }
    75% { transform: translate(-10px, -15px); }
}

@keyframes float-drift-3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(20px, -25px); }
    66% { transform: translate(-30px, 10px); }
}

@keyframes float-drift-4 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(15px, 30px); }
    50% { transform: translate(-20px, -10px); }
    75% { transform: translate(25px, -20px); }
}

@keyframes float-drift-5 {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-20px, -15px); }
    40% { transform: translate(25px, 10px); }
    60% { transform: translate(-10px, 30px); }
    80% { transform: translate(15px, -25px); }
}

@keyframes float-drift-6 {
    0%, 100% { transform: translate(0, 0); }
    30% { transform: translate(30px, 20px); }
    60% { transform: translate(-25px, -15px); }
}

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

@keyframes squircle-morph {
    0%, 100% { border-radius: 35%; }
    25% { border-radius: 40% 30% 38% 32%; }
    50% { border-radius: 28% 42% 35% 38%; }
    75% { border-radius: 38% 32% 42% 28%; }
}

@keyframes line-rotate {
    0% { transform: rotate(0deg) translate(0, 0); }
    25% { transform: rotate(15deg) translate(10px, -5px); }
    50% { transform: rotate(-10deg) translate(-8px, 8px); }
    75% { transform: rotate(5deg) translate(5px, -3px); }
    100% { transform: rotate(0deg) translate(0, 0); }
}

@keyframes orbit-1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(5px, -8px); }
    50% { transform: translate(-3px, 5px); }
    75% { transform: translate(6px, 3px); }
}

@keyframes orbit-2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-6px, 4px); }
    50% { transform: translate(4px, -6px); }
    75% { transform: translate(-3px, 7px); }
}

@keyframes orbit-3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(4px, 6px); }
    50% { transform: translate(-5px, -4px); }
    75% { transform: translate(7px, -3px); }
}

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

.dot-nav-item {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--deep-plum);
    opacity: 0.3;
    cursor: pointer;
    transition: all 250ms ease-out;
    padding: 0;
}

.dot-nav-item.active {
    background: var(--bubblegum-pink);
    opacity: 1;
    width: 12px;
    height: 12px;
    transform: scale(1.1);
}

.dot-nav-item:hover {
    opacity: 0.7;
    transform: scale(1.2);
}

/* --- Connecting Paths SVG --- */
.connecting-paths {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.connect-path {
    transition: stroke-dashoffset 50ms linear;
}

.path-dot {
    transition: transform 200ms ease-out;
}

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

/* --- Ripple Container --- */
.ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--bubblegum-pink);
    opacity: 0.3;
    transform: scale(0);
    animation: ripple-expand 400ms ease-out forwards;
}

@keyframes ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    scroll-snap-align: start;
}

.hero-content {
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--deep-plum);
    display: inline-block;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(-40px) scale(0.5);
}

.letter.animate {
    animation: bounce-enter 500ms var(--bounce-bezier) forwards;
    animation-delay: calc(var(--i) * 60ms + 200ms);
}

@keyframes bounce-enter {
    0% {
        opacity: 0;
        transform: translateY(-40px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    color: var(--deep-plum);
    opacity: 0;
    transform: translateY(-20px);
    margin-top: 1rem;
}

.hero-tagline.animate {
    animation: tagline-enter 600ms var(--bounce-bezier) forwards;
    animation-delay: 1200ms;
}

@keyframes tagline-enter {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

.hero-chevron {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: chevron-pulse 1.5s ease-in-out infinite;
    opacity: 0;
}

.hero-chevron.animate {
    opacity: 1;
    transition: opacity 400ms ease-out;
}

@keyframes chevron-pulse {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* --- Content Sections --- */
.content-section {
    min-height: 80vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 6rem 2rem;
    scroll-snap-align: start;
}

.section-inner {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* S-curve layout: alternate left and right */
.section-left .section-inner {
    justify-items: start;
}

.section-right .section-inner {
    justify-items: end;
}

/* --- Squircle Content Containers --- */
.squircle {
    background: var(--cloud-white);
    border-radius: 32% 38% 34% 36% / 36% 32% 38% 34%;
    padding: 3rem 2.5rem;
    box-shadow:
        inset 0 2px 12px rgba(255, 110, 162, 0.15),
        0 8px 32px rgba(108, 92, 231, 0.12);
    transform: translate(var(--drift-x, 0), var(--drift-y, 0));
    transition: transform 250ms ease-out, box-shadow 250ms ease-out, border-radius 250ms ease-out;
    position: relative;
    /* Bounce-enter initial state for scroll animation */
    opacity: 0;
    will-change: transform, opacity;
}

.squircle.in-view {
    opacity: 1;
    animation: squircle-enter 500ms var(--bounce-bezier) forwards;
}

@keyframes squircle-enter {
    0% {
        opacity: 0;
        transform: translate(var(--drift-x, 0), calc(var(--drift-y, 0) + 60px));
    }
    100% {
        opacity: 1;
        transform: translate(var(--drift-x, 0), var(--drift-y, 0));
    }
}

.squircle:hover {
    transform: translate(var(--drift-x, 0), var(--drift-y, 0)) scale(1.03);
    box-shadow:
        inset 0 2px 12px rgba(255, 110, 162, 0.15),
        0 12px 48px rgba(108, 92, 231, 0.2);
    border-radius: 36% 34% 38% 32% / 32% 36% 34% 38%;
}

.squircle-main {
    grid-column: 1 / 8;
    max-width: 600px;
}

.section-right .squircle-main {
    grid-column: 5 / 13;
    justify-self: end;
}

.squircle-accent {
    grid-column: 7 / 13;
    max-width: 450px;
    background: var(--cotton-candy);
    margin-top: 2rem;
}

.section-right .squircle-accent {
    grid-column: 1 / 7;
    justify-self: start;
    margin-top: 2rem;
}

.section-left .squircle-accent {
    justify-self: end;
}

.squircle-small {
    grid-column: 1 / 6;
    max-width: 350px;
    background: var(--marshmallow-lilac);
    margin-top: 1.5rem;
}

.section-right .squircle-small {
    grid-column: 1 / 6;
    justify-self: start;
}

.squircle-tiny {
    grid-column: 6 / 11;
    max-width: 320px;
    background: var(--lemon-drop);
    padding: 2rem 2rem;
    margin-top: 1rem;
}

.section-right .squircle-tiny {
    grid-column: 7 / 13;
    justify-self: end;
}

/* Squircle morph on hover */
@keyframes squircle-idle-morph {
    0%, 100% { border-radius: 32% 38% 34% 36% / 36% 32% 38% 34%; }
    25% { border-radius: 36% 34% 38% 32% / 32% 38% 34% 36%; }
    50% { border-radius: 38% 32% 36% 34% / 34% 36% 32% 38%; }
    75% { border-radius: 34% 36% 32% 38% / 38% 34% 36% 32%; }
}

.squircle.in-view {
    animation: squircle-idle-morph 4s ease-in-out infinite;
}

/* --- Typography --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: var(--deep-plum);
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

.section-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--deep-plum);
    line-height: 1.7;
    letter-spacing: 0.01em;
    max-width: 38em;
    margin-bottom: 1rem;
}

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

.mono-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--grape-fizz);
}

.section-label {
    display: block;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.fun-fact {
    display: block;
    line-height: 1.6;
}

/* --- Illustrations --- */
.illustration-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.illustration {
    max-width: 100%;
    height: auto;
}

.illustration-caption {
    text-align: center;
    display: block;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    padding: 4rem 2rem;
    text-align: center;
}

.footer-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--deep-plum);
    margin-bottom: 0.5rem;
}

.footer-sub {
    color: var(--grape-fizz);
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-inner {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .squircle {
        max-width: 100% !important;
        transform: translate(0, 0) !important;
    }

    .squircle:hover {
        transform: scale(1.02) !important;
    }

    .squircle.in-view {
        animation: squircle-enter-mobile 500ms var(--bounce-bezier) forwards;
    }

    @keyframes squircle-enter-mobile {
        0% {
            opacity: 0;
            transform: translateY(40px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .content-section {
        padding: 3rem 1rem;
        min-height: auto;
    }

    .squircle {
        padding: 2rem 1.5rem;
    }

    .dot-nav {
        right: 12px;
    }

    .dot-nav-item {
        width: 8px;
        height: 8px;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .squircle {
        border-radius: 24px;
        padding: 1.5rem 1.2rem;
    }

    .squircle:hover {
        border-radius: 28px;
    }
}
