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

:root {
    --reef-turquoise: #0fb5ba;
    --coral-pop: #ff6b6b;
    --sunbleach-gold: #feca57;
    --ocean-midnight: #0c2340;
    --seafoam-glass: #e8f4f8;
    --foam-white: #f7fbfc;
    --kelp-charcoal: #1a2634;
    --lagoon-teal: #14b8a6;
    --abyss-indigo: #1e1b4b;
}

html {
    scroll-behavior: smooth;
}

body.ocean-surface {
    font-family: 'DM Sans', sans-serif;
    color: var(--foam-white);
    background: linear-gradient(to bottom, var(--lagoon-teal) 0%, var(--ocean-midnight) 50%, var(--abyss-indigo) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

/* === GLASSMORPHIC BASE === */
.glassmorphic {
    background: rgba(232, 244, 248, 0.15);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(12, 35, 64, 0.12);
    border-radius: 20px;
}

/* === HALFTONE WAVES BACKGROUND === */
.halftone-waves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle, rgba(15, 181, 186, 0.06) 1px, transparent 1px),
        radial-gradient(circle, rgba(15, 181, 186, 0.04) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(254, 202, 87, 0.03) 2px, transparent 2px);
    background-size: 8px 8px, 16px 16px, 24px 24px;
    animation: halftone-drift 40s linear infinite;
}

@keyframes halftone-drift {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 80px 40px, -60px 80px, 120px -60px; }
}

/* === REEF HEADER === */
.reef-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 70px;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 98% 90%, 95% 85%, 90% 92%, 85% 85%, 80% 88%, 75% 82%, 70% 90%, 65% 84%, 60% 88%, 55% 82%, 50% 90%, 45% 84%, 40% 88%, 35% 82%, 30% 90%, 25% 85%, 20% 92%, 15% 85%, 10% 90%, 5% 85%, 2% 88%, 0 85%);
    padding-bottom: 12px;
}

.pop-wordmark {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--foam-white);
    text-shadow: 3px 3px 0 var(--coral-pop);
}

.bubble-nav {
    display: flex;
    gap: 1rem;
}

.bubble-link {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--foam-white);
    background: var(--coral-pop);
    padding: 0.4rem 1rem;
    border-radius: 20px 20px 20px 4px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
    display: inline-block;
}

.bubble-link:hover {
    transform: scale(1.1);
    background: var(--sunbleach-gold);
    color: var(--kelp-charcoal);
}

/* === DASHBOARD GRID === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.2rem;
    padding: 90px 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* === CURRENT PANEL (Left) === */
.current-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-title {
    font-family: 'Bungee', cursive;
    font-size: clamp(1rem, 2vw, 1.3rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sunbleach-gold);
    margin-bottom: 0.5rem;
}

.counter-card {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: card-entrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.counter-card:nth-child(2) { animation-delay: 0.12s; }
.counter-card:nth-child(3) { animation-delay: 0.24s; }
.counter-card:nth-child(4) { animation-delay: 0.36s; }
.counter-card:nth-child(5) { animation-delay: 0.48s; }

@keyframes card-entrance {
    from { opacity: 0; transform: translateX(-40px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.counter-card:hover {
    transform: scale(1.03);
}

.counter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--coral-pop) 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.06;
    pointer-events: none;
}

.card-fish-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-bottom: 0.2rem;
}

.clownfish-icon { background: var(--coral-pop); }
.parrotfish-icon { background: var(--reef-turquoise); }
.angelfish-icon { background: var(--sunbleach-gold); }
.seahorse-icon { background: var(--sunbleach-gold); }

.counter-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(247, 251, 252, 0.7);
}

.counter-value {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--foam-white);
}

.counter-change {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
}

.counter-change.positive { color: var(--reef-turquoise); }
.counter-change.negative { color: var(--coral-pop); }

/* === REEF CENTER === */
.reef-center {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reef-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 20px;
}

/* Coral formations */
.coral {
    position: absolute;
    border-radius: 30% 70% 50% 50% / 50% 50% 70% 30%;
    opacity: 0.5;
}

.coral-1 {
    bottom: 0;
    left: 10%;
    width: 120px;
    height: 180px;
    background: var(--coral-pop);
    border-radius: 40% 60% 30% 70% / 60% 40% 80% 20%;
}

.coral-2 {
    bottom: 0;
    left: 35%;
    width: 80px;
    height: 130px;
    background: var(--sunbleach-gold);
    border-radius: 50% 50% 20% 80% / 70% 30% 70% 30%;
}

.coral-3 {
    bottom: 0;
    right: 20%;
    width: 100px;
    height: 160px;
    background: var(--reef-turquoise);
    border-radius: 60% 40% 40% 60% / 50% 60% 40% 50%;
}

.coral-4 {
    bottom: 0;
    right: 5%;
    width: 70px;
    height: 100px;
    background: var(--coral-pop);
    border-radius: 30% 70% 50% 50% / 70% 30% 60% 40%;
    opacity: 0.35;
}

/* Fish swimming animations */
.fish {
    position: absolute;
    z-index: 2;
    filter: drop-shadow(0 2px 8px rgba(12, 35, 64, 0.2));
}

.fish-clownfish {
    top: 20%;
    animation: swim-1 20s ease-in-out infinite;
}

.fish-parrotfish {
    top: 45%;
    animation: swim-2 25s ease-in-out infinite;
}

.fish-angelfish {
    top: 30%;
    animation: swim-3 22s ease-in-out infinite;
}

.fish-lionfish {
    top: 60%;
    animation: swim-4 28s ease-in-out infinite;
}

@keyframes swim-1 {
    0% { transform: translateX(-100px) translateY(0); }
    25% { transform: translateX(120px) translateY(-20px); }
    50% { transform: translateX(300px) translateY(10px); }
    75% { transform: translateX(150px) translateY(-15px); }
    100% { transform: translateX(-100px) translateY(0); }
}

@keyframes swim-2 {
    0% { transform: translateX(400px) translateY(0) scaleX(-1); }
    25% { transform: translateX(200px) translateY(15px) scaleX(-1); }
    50% { transform: translateX(-50px) translateY(-10px) scaleX(-1); }
    75% { transform: translateX(100px) translateY(20px) scaleX(-1); }
    100% { transform: translateX(400px) translateY(0) scaleX(-1); }
}

@keyframes swim-3 {
    0% { transform: translateX(-80px) translateY(0); }
    30% { transform: translateX(180px) translateY(-30px); }
    60% { transform: translateX(350px) translateY(15px); }
    100% { transform: translateX(-80px) translateY(0); }
}

@keyframes swim-4 {
    0% { transform: translateX(450px) translateY(0) scaleX(-1); }
    35% { transform: translateX(150px) translateY(-20px) scaleX(-1); }
    65% { transform: translateX(-30px) translateY(10px) scaleX(-1); }
    100% { transform: translateX(450px) translateY(0) scaleX(-1); }
}

.reef-overlay {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 3rem 2rem;
    max-width: 480px;
}

.reef-headline {
    font-family: 'Bungee', cursive;
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--foam-white);
    text-shadow: 4px 4px 0 var(--coral-pop);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.reef-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: rgba(247, 251, 252, 0.85);
    line-height: 1.65;
}

/* === TRADE TIDE (Right) === */
.trade-tide {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.trade-card {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    transform: translateX(50px);
    animation: trade-slide-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.trade-card[data-delay="0"] { animation-delay: 0.3s; }
.trade-card[data-delay="1"] { animation-delay: 0.42s; }
.trade-card[data-delay="2"] { animation-delay: 0.54s; }
.trade-card[data-delay="3"] { animation-delay: 0.66s; }
.trade-card[data-delay="4"] { animation-delay: 0.78s; }

@keyframes trade-slide-in {
    to { opacity: 1; transform: translateX(0); }
}

.trade-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.05;
    pointer-events: none;
}

.trade-card:nth-child(2)::before {
    background-image: radial-gradient(circle, var(--coral-pop) 1px, transparent 1px);
    background-size: 6px 6px;
}

.trade-card:nth-child(3)::before {
    background-image: radial-gradient(circle, var(--reef-turquoise) 1px, transparent 1px);
    background-size: 8px 8px;
}

.trade-card:nth-child(4)::before {
    background-image: radial-gradient(circle, var(--sunbleach-gold) 1px, transparent 1px);
    background-size: 5px 5px;
}

.trade-fish {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--kelp-charcoal);
}

.clownfish-dot { background: var(--coral-pop); }
.parrotfish-dot { background: var(--reef-turquoise); }
.angelfish-dot { background: var(--sunbleach-gold); }
.seahorse-dot { background: var(--sunbleach-gold); }
.lionfish-dot { background: var(--coral-pop); }

.trade-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.trade-type {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(247, 251, 252, 0.7);
}

.trade-volume {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    color: var(--foam-white);
}

.trade-unit {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    color: rgba(247, 251, 252, 0.5);
}

/* === DEPTH TRANSITION === */
.depth-transition {
    height: 200px;
    position: relative;
    z-index: 1;
}

/* === DEEP DIVE === */
.deep-dive {
    position: relative;
    z-index: 1;
    padding: 2rem 1.5rem 4rem;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.depth-panel {
    padding: 3rem 2.5rem;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    overflow: visible;
}

.depth-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.depth-heading {
    font-family: 'Bungee', cursive;
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--foam-white);
    text-shadow: 3px 3px 0 rgba(255, 107, 107, 0.5);
    margin-bottom: 1rem;
}

.depth-text {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: rgba(247, 251, 252, 0.85);
    line-height: 1.75;
    max-width: 650px;
}

/* === SPEECH BUBBLES === */
.speech-bubble {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 20px 20px 20px 4px;
    margin-bottom: 1.2rem;
    position: relative;
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.depth-panel.visible .speech-bubble {
    transform: scale(1);
}

.bubble-coral {
    background: var(--coral-pop);
}

.bubble-gold {
    background: var(--sunbleach-gold);
}

.bubble-text {
    font-family: 'Bungee', cursive;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--foam-white);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bubble-gold .bubble-text {
    color: var(--kelp-charcoal);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 16px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 4px solid transparent;
}

.bubble-coral::after {
    border-top: 10px solid var(--coral-pop);
}

.bubble-gold::after {
    border-top: 10px solid var(--sunbleach-gold);
}

/* Deep fish */
.deep-fish {
    position: absolute;
    opacity: 0.25;
    z-index: -1;
}

.deep-fish-1 {
    right: -30px;
    top: 50%;
    animation: deep-swim-1 30s ease-in-out infinite;
}

.deep-fish-2 {
    left: -40px;
    bottom: 20%;
    animation: deep-swim-2 35s ease-in-out infinite;
}

.deep-fish-3 {
    right: 10%;
    top: 20%;
    animation: deep-swim-3 25s ease-in-out infinite;
}

@keyframes deep-swim-1 {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-80px) translateY(20px); }
}

@keyframes deep-swim-2 {
    0%, 100% { transform: translateX(0) translateY(0) scaleX(-1); }
    50% { transform: translateX(60px) translateY(-15px) scaleX(-1); }
}

@keyframes deep-swim-3 {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(50px) translateY(30px); }
}

/* === FOOTER === */
.ocean-floor {
    text-align: center;
    padding: 2rem;
    margin: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

.footer-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: rgba(247, 251, 252, 0.6);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding-top: 80px;
    }

    .current-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .panel-title {
        grid-column: 1 / -1;
    }

    .reef-center {
        min-height: 350px;
    }

    .trade-tide {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .trade-tide .panel-title {
        grid-column: 1 / -1;
    }

    .reef-header {
        clip-path: none;
        padding-bottom: 0;
    }
}

@media (max-width: 600px) {
    .current-panel {
        grid-template-columns: 1fr;
    }

    .trade-tide {
        grid-template-columns: 1fr;
    }

    .bubble-nav {
        gap: 0.5rem;
    }

    .bubble-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }

    .depth-panel {
        padding: 2rem 1.5rem;
    }
}
