:root {
    --deep-graphite: #1A1D23;
    --gunmetal: #2A2E37;
    --ash-gray: #6B7280;
    --cool-slate: #7B8594;
    --cool-silver: #A8B2C1;
    --pale-silver: #C8CDD6;
    --white-smoke: #E8ECF2;
    --signal-red: #E63946;
    color-scheme: dark;
}

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

body {
    background: var(--deep-graphite);
    color: var(--pale-silver);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ====== BACKGROUND PLANE ====== */
.bg-plane {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.memphis-shape {
    position: absolute;
    opacity: 0.12;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 100px solid var(--cool-silver);
    animation: shapeDrift0 70s ease-in-out infinite;
}

.shape-circle {
    width: 100px;
    height: 100px;
    border: 2px solid var(--cool-silver);
    border-radius: 50%;
    animation: shapeDrift1 80s ease-in-out infinite;
}

.shape-zigzag {
    width: 120px;
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 15px,
        var(--cool-silver) 15px,
        var(--cool-silver) 17px
    );
    clip-path: polygon(0% 100%, 10% 0%, 20% 100%, 30% 0%, 40% 100%, 50% 0%, 60% 100%, 70% 0%, 80% 100%, 90% 0%, 100% 100%);
    animation: shapeDrift2 90s ease-in-out infinite;
}

.shape-squiggle {
    width: 80px;
    height: 80px;
    border: 2px solid var(--cool-silver);
    border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
    animation: shapeDrift3 60s ease-in-out infinite;
}

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

@keyframes shapeDrift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-25px, 20px) rotate(10deg); }
    66% { transform: translate(15px, -15px) rotate(-5deg); }
}

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

@keyframes shapeDrift3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-15px, -20px) rotate(15deg); }
}

/* ====== NAV BAR ====== */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 50;
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.nav-bar.scrolled {
    background: rgba(42, 46, 55, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.nav-domain {
    font-family: 'Bungee', cursive;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white-smoke);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cool-slate);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--white-smoke);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--signal-red);
}

/* ====== ZONES ====== */
.zone {
    position: relative;
    overflow: hidden;
}

/* ====== THE SURFACE ====== */
.zone-surface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--deep-graphite);
}

.hero-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(3rem, 9vw, 8rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--white-smoke);
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) rotate(-8deg);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-title .letter.visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

.hero-title .letter.breathing {
    animation: letterBreathe var(--breathe-dur, 5s) ease-in-out infinite;
    animation-delay: var(--phase-offset, 0s);
}

@keyframes letterBreathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1.5px); }
}

/* Fish school */
.fish-school {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.fish-small {
    position: absolute;
    width: 30px;
    height: 16px;
}

.fish-s1 {
    top: 35%;
    animation: fishSwim1 22s linear infinite;
}

.fish-s2 {
    top: 42%;
    animation: fishSwim1 22s linear infinite -3s;
}

.fish-s3 {
    top: 38%;
    animation: fishSwim1 22s linear infinite -7s;
}

.fish-s4 {
    top: 45%;
    animation: fishSwim2 25s linear infinite;
}

.fish-s5 {
    top: 32%;
    animation: fishSwim2 25s linear infinite -5s;
}

@keyframes fishSwim1 {
    0% { left: -40px; transform: translateY(0); }
    25% { transform: translateY(-15px); }
    50% { transform: translateY(8px); }
    75% { transform: translateY(-10px); }
    100% { left: 110%; transform: translateY(0); }
}

@keyframes fishSwim2 {
    0% { right: -40px; left: auto; transform: translateY(0) scaleX(-1); }
    25% { transform: translateY(10px) scaleX(-1); }
    50% { transform: translateY(-12px) scaleX(-1); }
    75% { transform: translateY(6px) scaleX(-1); }
    100% { right: 110%; left: auto; transform: translateY(0) scaleX(-1); }
}

/* Zigzag line */
.zigzag-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 10px,
        var(--cool-silver) 10px,
        var(--cool-silver) 11px
    );
    clip-path: polygon(
        0% 100%, 2.5% 0%, 5% 100%, 7.5% 0%, 10% 100%, 12.5% 0%, 15% 100%, 17.5% 0%, 20% 100%,
        22.5% 0%, 25% 100%, 27.5% 0%, 30% 100%, 32.5% 0%, 35% 100%, 37.5% 0%, 40% 100%,
        42.5% 0%, 45% 100%, 47.5% 0%, 50% 100%, 52.5% 0%, 55% 100%, 57.5% 0%, 60% 100%,
        62.5% 0%, 65% 100%, 67.5% 0%, 70% 100%, 72.5% 0%, 75% 100%, 77.5% 0%, 80% 100%,
        82.5% 0%, 85% 100%, 87.5% 0%, 90% 100%, 92.5% 0%, 95% 100%, 97.5% 0%, 100% 100%
    );
    opacity: 0.25;
    animation: zigzagScroll 10s linear infinite;
}

.zigzag-bottom {
    bottom: 15%;
}

.zigzag-top {
    top: 0;
}

@keyframes zigzagScroll {
    0% { background-position-x: 0; }
    100% { background-position-x: 100px; }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: scrollBob 2s ease-in-out infinite;
}

.scroll-arrow {
    width: 20px;
    height: 14px;
}

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

/* ====== THE REEF ====== */
.zone-reef {
    min-height: 180vh;
    padding: 80px 0;
    background: var(--deep-graphite);
}

.reef-content {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.content-block {
    background: var(--gunmetal);
    border: 2px solid var(--ash-gray);
    padding: 32px;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.block-left {
    max-width: 55%;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
}

.block-right {
    max-width: 55%;
    margin-left: auto;
    clip-path: polygon(24px 0, 100% 0, 100% 100%, 0 100%, 0 24px);
}

.block-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cool-slate);
    margin-bottom: 8px;
}

.section-heading {
    font-family: 'Bungee', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--white-smoke);
    margin-bottom: 16px;
}

.body-text {
    color: var(--pale-silver);
    margin-bottom: 1rem;
    max-width: 38em;
}

.mono-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--pale-silver);
    max-width: 38em;
}

/* Overlay plane: pull quote */
.overlay-element {
    position: relative;
    z-index: 5;
}

.pullquote {
    max-width: 480px;
    margin: 40px auto;
    padding: 24px 32px;
    background: var(--gunmetal);
    border: 2px solid var(--signal-red);
    box-shadow: 4px 4px 0 rgba(13, 15, 19, 0.4);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}

.pullquote-mark {
    font-family: 'Bungee', cursive;
    font-size: 3rem;
    color: var(--signal-red);
    line-height: 1;
    display: block;
    margin-bottom: -8px;
}

.pullquote-text {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--white-smoke);
    line-height: 1.4;
}

/* Reef fish decorations */
.reef-fish-decor {
    position: absolute;
    z-index: 1;
    opacity: 0.5;
}

.fish-reef-1 {
    width: 60px;
    height: 40px;
    right: 8%;
    top: 25%;
    animation: reefFishDrift 18s ease-in-out infinite;
}

.fish-reef-2 {
    width: 50px;
    height: 35px;
    left: 5%;
    top: 60%;
    animation: reefFishDrift 22s ease-in-out infinite -6s;
}

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

/* ====== THE CURRENT ====== */
.zone-current {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #12141A;
    position: relative;
}

.current-content {
    max-width: 480px;
    padding: 80px 24px;
    position: relative;
    z-index: 2;
}

.current-block {
    margin-bottom: 40px;
}

.predator-fish {
    position: absolute;
    width: 120px;
    height: 60px;
    right: 10%;
    top: 40%;
    opacity: 0.35;
    z-index: 1;
    animation: predatorDrift 30s ease-in-out infinite;
}

@keyframes predatorDrift {
    0% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-40px) translateY(15px); }
    50% { transform: translateX(20px) translateY(-10px); }
    75% { transform: translateX(-20px) translateY(5px); }
    100% { transform: translateX(0) translateY(0); }
}

/* ====== THE DEEP ====== */
.zone-deep {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--deep-graphite);
    position: relative;
}

.deep-content {
    max-width: 560px;
    padding: 80px 24px;
    position: relative;
    z-index: 2;
}

.deep-block {
    margin-bottom: 48px;
}

.deep-block .body-text {
    color: var(--pale-silver);
    letter-spacing: 0.015em;
}

/* Deep sea fish with glow */
.deep-fish {
    position: absolute;
    opacity: 0.4;
    z-index: 1;
    filter: drop-shadow(0 0 12px rgba(168, 178, 193, 0.3));
}

.deep-fish-1 {
    width: 60px;
    height: 30px;
    left: 15%;
    top: 30%;
    animation: deepDrift1 20s ease-in-out infinite;
}

.deep-fish-2 {
    width: 50px;
    height: 25px;
    right: 20%;
    bottom: 30%;
    animation: deepDrift2 25s ease-in-out infinite;
}

@keyframes deepDrift1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(15px, 10px); }
    66% { transform: translate(-10px, -8px); }
}

@keyframes deepDrift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-12px, 6px); }
}

.domain-terminus {
    font-family: 'Bungee', cursive;
    font-size: clamp(4rem, 12vw, 10rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--white-smoke);
    opacity: 0.15;
    position: absolute;
    bottom: -0.15em;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 0;
    pointer-events: none;
}

/* ====== FADE REVEAL ====== */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .block-left,
    .block-right {
        max-width: 100%;
        margin-left: 0;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-link {
        font-size: 0.7rem;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .section-heading {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .pullquote {
        max-width: 100%;
        margin: 30px 24px;
    }

    .predator-fish {
        width: 80px;
        right: 5%;
    }

    .reef-fish-decor {
        display: none;
    }

    .domain-terminus {
        font-size: clamp(2.5rem, 15vw, 5rem);
    }
}

/* ====== REDUCED MOTION ====== */
@media (prefers-reduced-motion: reduce) {
    .memphis-shape {
        animation: none;
    }

    .fish-small {
        animation: none;
    }

    .hero-title .letter.breathing {
        animation: none;
    }

    .zigzag-line {
        animation: none;
    }

    .scroll-indicator {
        animation: none;
    }

    .reef-fish-decor {
        animation: none;
    }

    .predator-fish {
        animation: none;
    }

    .deep-fish {
        animation: none;
    }

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

    .hero-title .letter {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
