:root {
    --sand: #EDE8DF;
    --linen: #E2DCD2;
    --tidal-ink: #2B3A42;
    --storm-slate: #5E7A84;
    --coral: #E07A5F;
    --kelp-sage: #8FAAAA;
    --night-tide: #1B2A33;
    --sea-foam: #B8D4D2;
}

@property --counter {
    syntax: '<integer>';
    initial-value: 0;
    inherits: false;
}

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

body {
    background-color: var(--sand);
    color: var(--tidal-ink);
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(226, 220, 210, 0.85);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 7px,
        rgba(196, 191, 178, 0.3) 7px,
        rgba(196, 191, 178, 0.3) 8px
    );
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    border-right: 1px solid rgba(143, 170, 170, 0.3);
}

.sidebar-wordmark {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--tidal-ink);
    margin-bottom: 48px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex: 1;
}

.nav-item {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--storm-slate);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-item::before {
    content: attr(data-index);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 10px;
    color: var(--coral);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:hover {
    color: var(--coral);
}

.nav-item:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.sidebar-progress {
    margin: 32px 0;
}

.progress-line {
    position: relative;
    width: 1px;
    height: 120px;
    background: var(--kelp-sage);
    margin-left: 3px;
}

.progress-dot {
    position: absolute;
    left: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--coral);
}

.sidebar-counter {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 48px;
    color: var(--kelp-sage);
    line-height: 1;
}

/* Mobile nav */
.mobile-nav-trigger {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 60;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-trigger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--tidal-ink);
}

/* Content Field */
.content-field {
    margin-left: 280px;
    position: relative;
    min-height: 100vh;
}

/* Background Ellipses */
.bg-ellipse {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.ellipse-1 {
    width: 350px;
    height: 250px;
    background: var(--kelp-sage);
    opacity: 0.1;
    top: 10%;
    right: 5%;
    transform: rotate(8deg);
    animation: drift 20s ease-in-out infinite alternate;
}

.ellipse-2 {
    width: 280px;
    height: 200px;
    background: var(--sea-foam);
    opacity: 0.12;
    top: 40%;
    right: 20%;
    transform: rotate(-5deg);
    animation: drift 25s ease-in-out infinite alternate-reverse;
}

.ellipse-3 {
    width: 400px;
    height: 300px;
    background: var(--kelp-sage);
    opacity: 0.08;
    top: 70%;
    left: 10%;
    transform: rotate(12deg);
    animation: drift 22s ease-in-out infinite alternate;
}

@keyframes drift {
    0% { transform: translate(0, 0) rotate(8deg); }
    100% { transform: translate(35px, 15px) rotate(12deg); }
}

/* Sections */
.section {
    position: relative;
    min-height: 100vh;
    padding: 15vh 60px 15vh 40px;
    z-index: 1;
}

.section-counter {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--coral);
    opacity: 0.12;
    position: absolute;
    top: 12vh;
    left: 30px;
    z-index: 0;
    --counter: 0;
    counter-reset: num var(--counter);
    transition: --counter 0.6s ease-out;
}

.section-counter.counted {
    --counter: var(--target);
}

.section-counter::after {
    content: '0' counter(num);
}

/* Hero */
.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--tidal-ink);
    margin-left: 15%;
    margin-top: 30vh;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--storm-slate);
    margin-left: 15%;
    margin-top: 12px;
    position: relative;
    z-index: 2;
}

/* Content Blocks with staggered margins */
.content-block {
    position: relative;
    z-index: 2;
    max-width: 560px;
}

.offset-1 { margin-left: 5%; }
.offset-2 { margin-left: 12%; }
.offset-3 { margin-left: 2%; }

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--tidal-ink);
    margin-bottom: 24px;
}

.body-text {
    margin-bottom: 1.5rem;
    color: var(--tidal-ink);
}

.marginal-note {
    font-family: 'Caveat', cursive;
    font-size: 0.95rem;
    color: var(--storm-slate);
    margin-top: 8px;
    opacity: 0.7;
}

/* Section Bands */
.section-band {
    position: relative;
    height: 80px;
    overflow: hidden;
    z-index: 1;
}

.band-shape {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    mix-blend-mode: multiply;
}

.band-ellipse-1 { width: 180px; height: 60px; border-radius: 50%; background: var(--kelp-sage); opacity: 0.15; left: 10%; animation: bandDrift 20s linear infinite; }
.band-rect-1 { width: 120px; height: 40px; border-radius: 30% 70% 60% 40% / 50% 60% 40% 50%; background: var(--coral); opacity: 0.1; left: 35%; animation: bandDrift 18s linear infinite reverse; }
.band-ellipse-2 { width: 150px; height: 50px; border-radius: 50%; background: var(--sea-foam); opacity: 0.12; right: 15%; animation: bandDrift 22s linear infinite; }
.band-rect-2 { width: 140px; height: 45px; border-radius: 40% 60% 50% 50% / 55% 45% 55% 45%; background: var(--coral); opacity: 0.08; left: 20%; animation: bandDrift 16s linear infinite; }
.band-ellipse-3 { width: 200px; height: 55px; border-radius: 50%; background: var(--kelp-sage); opacity: 0.1; right: 10%; animation: bandDrift 24s linear infinite reverse; }
.band-ellipse-4 { width: 160px; height: 48px; border-radius: 50%; background: var(--sea-foam); opacity: 0.14; left: 5%; animation: bandDrift 19s linear infinite; }
.band-rect-3 { width: 100px; height: 35px; border-radius: 50% 40% 60% 50% / 40% 60% 40% 60%; background: var(--coral); opacity: 0.09; left: 45%; animation: bandDrift 21s linear infinite reverse; }
.band-ellipse-5 { width: 130px; height: 42px; border-radius: 50%; background: var(--kelp-sage); opacity: 0.11; right: 20%; animation: bandDrift 17s linear infinite; }
.band-rect-4 { width: 110px; height: 38px; border-radius: 35% 65% 55% 45% / 50% 50% 50% 50%; background: var(--coral); opacity: 0.1; left: 30%; animation: bandDrift 23s linear infinite; }
.band-ellipse-6 { width: 170px; height: 52px; border-radius: 50%; background: var(--sea-foam); opacity: 0.13; right: 8%; animation: bandDrift 20s linear infinite reverse; }

@keyframes bandDrift {
    0% { transform: translateY(-50%) translateX(0); }
    100% { transform: translateY(-50%) translateX(30px); }
}

/* Leaf Clusters */
.leaf-cluster {
    position: absolute;
    bottom: 15vh;
    left: 60%;
    z-index: 1;
}

.cluster-right {
    left: auto;
    right: 10%;
    bottom: 20vh;
}

.leaf {
    position: absolute;
    width: 20px;
    height: 40px;
    border: 1px solid var(--kelp-sage);
    border-radius: 0 80% 0 80%;
    background: transparent;
}

.leaf-1 { transform: rotate(-30deg); top: 0; left: 0; }
.leaf-2 { transform: rotate(10deg); top: -10px; left: 18px; }
.leaf-3 { transform: rotate(-60deg); top: 15px; left: 8px; }
.leaf-4 { transform: rotate(20deg); top: 0; left: 0; }
.leaf-5 { transform: rotate(-40deg); top: -5px; left: 22px; }

/* Petal Dots */
.petal-dots {
    position: absolute;
    bottom: 20vh;
    right: 15%;
    width: 40px;
    height: 40px;
    z-index: 1;
}

.petal-cluster-2 {
    right: auto;
    left: 70%;
    bottom: 12vh;
}

.petal {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--coral);
    position: absolute;
}

.petal:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.petal:nth-child(2) { top: 30%; left: 85%; }
.petal:nth-child(3) { top: 70%; left: 85%; }
.petal:nth-child(4) { top: 100%; left: 50%; transform: translateX(-50%); }
.petal:nth-child(5) { top: 70%; left: 0; }
.petal:nth-child(6) { top: 30%; left: 0; }
.petal:nth-child(7) { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Reveal */
[data-reveal] {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.4s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-nav-trigger {
        display: flex;
    }

    .content-field {
        margin-left: 0;
    }

    .section {
        padding: 12vh 24px;
    }

    .hero-title {
        margin-left: 0;
    }

    .hero-subtitle {
        margin-left: 0;
    }

    .content-block {
        margin-left: 0 !important;
        max-width: 100%;
    }

    .leaf-cluster,
    .petal-dots {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bg-ellipse {
        animation: none;
    }

    .band-shape {
        animation: none;
    }

    .section-counter {
        transition: none;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .nav-item::before {
        transition: none;
    }
}
