/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --abyssal: #0a0e1a;
    --midnight: #101832;
    --deep-ocean: #162447;
    --cyan: #00c3ff;
    --magenta: #e84393;
    --green: #00e676;
    --text-primary: #c8d6e5;
    --text-secondary: #7f8fa6;
    --orange: #ff6b35;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--abyssal);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    overflow-x: hidden;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
}

/* ===== BUBBLE CONTAINER ===== */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 195, 255, 0.15) 100%);
    border: 1px solid rgba(0, 195, 255, 0.3);
    box-shadow: inset -3px -3px 8px rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* ===== DIVE INDICATOR ===== */
#dive-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    z-index: 200;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dive-ring {
    width: 60px;
    height: 60px;
}

.dive-ring-bg {
    fill: none;
    stroke: rgba(0, 195, 255, 0.2);
    stroke-width: 2;
}

.dive-ring-fill {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 2.5;
    stroke-dasharray: 169.65;
    stroke-dashoffset: 169.65;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.3s ease;
}

.dive-label {
    position: absolute;
    font-family: 'Permanent Marker', cursive;
    font-size: 0.55rem;
    color: var(--cyan);
    letter-spacing: 0.1em;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.radial-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#dive-indicator:hover .radial-menu,
#dive-indicator.active .radial-menu {
    opacity: 1;
    pointer-events: auto;
}

.radial-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(16, 24, 50, 0.9);
    border: 1px solid rgba(0, 195, 255, 0.4);
    color: var(--cyan);
    font-family: 'Permanent Marker', cursive;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.radial-item:hover {
    background: rgba(0, 195, 255, 0.15);
    border-color: var(--cyan);
}

/* ===== DIAGONAL SECTIONS ===== */
.diagonal-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.section-bg {
    position: absolute;
    inset: -10% -5%;
    width: 110%;
    height: 120%;
    z-index: 0;
}

.caustic-layer {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, var(--midnight) 0%, var(--abyssal) 70%);
    opacity: 0.5;
    filter: url(#caustic-filter);
}

.caustic-strong {
    opacity: 0.8;
}

.graffiti-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.graffiti-svg {
    width: 100%;
    height: 100%;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0, 195, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 195, 255, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

.section-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.content-inner {
    max-width: 1100px;
    width: 100%;
}

/* ===== SKEW SYSTEM ===== */
.section-surface {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    padding-bottom: 8vh;
}

.section-thermocline {
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    margin-top: -8vh;
    padding-top: 8vh;
    padding-bottom: 8vh;
}

.section-mesopelagic {
    clip-path: polygon(0 0, 100% 6%, 100% 100%, 0 88%);
    margin-top: -8vh;
    padding-top: 8vh;
    padding-bottom: 10vh;
    background: var(--abyssal);
}

.section-abyssal {
    clip-path: polygon(0 10%, 100% 0, 100% 88%, 0 100%);
    margin-top: -10vh;
    padding-top: 10vh;
    padding-bottom: 8vh;
    background: var(--midnight);
}

.section-hadal {
    clip-path: polygon(0 4%, 100% 0, 100% 100%, 0 100%);
    margin-top: -6vh;
    padding-top: 6vh;
}

/* ===== SECTION 1: SURFACE / HERO ===== */
.section-surface .section-bg {
    background: radial-gradient(ellipse at 40% 40%, var(--midnight), var(--abyssal));
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 12vw, 8rem);
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-shadow: 0 0 30px rgba(0, 195, 255, 0.4);
    text-align: center;
    transform: skewY(-6deg);
}

.accent-cyan { color: var(--cyan); }
.accent-magenta { color: var(--magenta); }
.accent-green { color: var(--green); }

.hero-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.3rem);
    margin-top: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.dive-prompt {
    display: block;
    text-align: center;
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    color: var(--magenta);
    margin-top: 3rem;
    animation: bob 2s ease-in-out infinite;
}

.scroll-arrow {
    text-align: center;
    margin-top: 1rem;
    animation: bob 2s ease-in-out infinite 0.3s;
}

.scroll-arrow svg polygon {
    animation: shimmer 3s ease-in-out infinite;
}

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

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

/* ===== SECTION 2: THERMOCLINE ===== */
.section-thermocline .section-bg {
    background: radial-gradient(ellipse at 60% 50%, var(--midnight), var(--abyssal));
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    letter-spacing: -0.03em;
    text-shadow: 0 0 30px rgba(0, 195, 255, 0.4);
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.two-column {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.col-text p {
    margin-bottom: 1.2rem;
    color: var(--text-primary);
}

.wireframe-sphere {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sphere-svg {
    width: 100%;
    max-width: 300px;
    animation: sphereRotate 20s linear infinite;
}

.sphere-ring {
    fill: none;
    stroke-width: 1;
}

.sphere-node {
    animation: nodePulse 4s ease-in-out infinite;
}

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

@keyframes nodePulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* ===== SECTION 3: MESOPELAGIC ===== */
.data-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 2rem;
}

.data-card {
    background: rgba(16, 24, 50, 0.7);
    border: 1px solid rgba(0, 195, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2rem;
    position: relative;
    transition: filter 0.4s ease, transform 0.3s ease;
    will-change: filter;
}

.data-card.blur-reveal {
    filter: blur(12px);
    opacity: 0.5;
}

.data-card.blur-reveal.revealed {
    filter: blur(0px);
    opacity: 1;
}

.card-accent-bar {
    height: 3px;
    width: 60px;
    background: var(--cyan);
    margin-bottom: 1.2rem;
}

.accent-bar-magenta { background: var(--magenta); }
.accent-bar-green { background: var(--green); }

.data-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
}

.data-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.card-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--cyan);
    opacity: 0.5;
    display: block;
    margin-top: 1.2rem;
    letter-spacing: 0.05em;
}

/* ===== SECTION 4: ABYSSAL ===== */
.tech-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.tech-text-band {
    background: rgba(16, 24, 50, 0.85);
    padding: 2rem 2.5rem;
    border-left: 3px solid var(--cyan);
}

.tech-text-band p {
    margin-bottom: 1rem;
}

.tech-text-band p:last-child {
    margin-bottom: 0;
}

.code-block {
    background: rgba(10, 14, 26, 0.9);
    border: 1px solid rgba(0, 195, 255, 0.15);
    padding: 1.5rem 2rem;
    overflow-x: auto;
}

.code-block pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.85rem, 1vw, 1rem);
    letter-spacing: 0.02em;
    line-height: 1.8;
    color: var(--text-primary);
}

.code-keyword { color: var(--magenta); }
.code-key { color: var(--cyan); }
.code-num { color: var(--orange); }
.code-str { color: var(--green); }
.code-bool { color: var(--orange); }
.code-comment { color: var(--text-secondary); font-style: italic; }

.tech-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--cyan);
    text-shadow: 0 0 20px rgba(0, 195, 255, 0.3);
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ===== SECTION 5: HADAL ===== */
.section-hadal .section-bg {
    background: radial-gradient(ellipse at 50% 60%, var(--midnight), var(--abyssal));
}

.hadal-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hadal-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(0, 195, 255, 0.3);
    max-width: 700px;
    line-height: 1.3;
}

.hadal-sub {
    color: var(--text-secondary);
    max-width: 550px;
    margin-top: 2rem;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}

.hadal-signature {
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--magenta);
    opacity: 0.6;
    margin-top: 4rem;
    text-shadow: 0 0 30px rgba(232, 67, 147, 0.3);
    transform: rotate(-5deg);
}

.hadal-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    letter-spacing: 0.15em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .section-surface {
        clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
    }
    .section-thermocline {
        clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    }
    .section-mesopelagic {
        clip-path: polygon(0 0, 100% 3%, 100% 100%, 0 95%);
    }
    .section-abyssal {
        clip-path: polygon(0 5%, 100% 0, 100% 94%, 0 100%);
    }
    .section-hadal {
        clip-path: polygon(0 2%, 100% 0, 100% 100%, 0 100%);
    }

    .hero-title {
        transform: skewY(-3deg);
    }

    .two-column {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .data-cards {
        grid-template-columns: 1fr;
    }

    .section-content {
        padding: 60px 20px;
    }

    .tech-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    #dive-indicator {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }

    .dive-ring {
        width: 40px;
        height: 40px;
    }
}
