:root {
    --deep-lagoon: #0a2e3d;
    --abyssal-teal: #041e2b;
    --coral-reef: #ff6b8a;
    --seafoam: #39e8c6;
    --bioluminescent: #a855f7;
    --pearl: #eef2f5;
    --kelp-sage: #68887a;
    --deep-current: #0c3548;
    --sea-glass: rgba(255, 255, 255, 0.19);
}

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

body {
    background: linear-gradient(180deg, var(--deep-lagoon) 0%, var(--abyssal-teal) 50%, var(--deep-lagoon) 100%);
    color: var(--pearl);
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Water texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 4px);
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255, 255, 255, 0.015) 3px,
        rgba(255, 255, 255, 0.015) 4px
    );
    animation: water-drift 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes water-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

/* ============================================
   Bubble Trail
   ============================================ */
.bubble-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.trail-bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(57, 232, 198, 0.15);
    border: 1px solid var(--sea-glass);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    transition: opacity 1s ease;
}

/* ============================================
   Surface
   ============================================ */
.surface {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.surface-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--pearl);
    text-shadow: 2px 3px 0px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.surface-sub {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--seafoam);
    opacity: 0.8;
    position: relative;
    z-index: 2;
}

/* ============================================
   Wave Divider
   ============================================ */
.wave-divider {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.wave-divider svg {
    width: 200%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.wave-divider-surface {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
}

.wave-1 {
    animation: wave-shift-1 8s ease-in-out infinite alternate;
}

.wave-2 {
    animation: wave-shift-2 12s ease-in-out infinite alternate;
}

.wave-3 {
    animation: wave-shift-3 16s ease-in-out infinite alternate;
}

@keyframes wave-shift-1 {
    0% { transform: translateX(0); }
    100% { transform: translateX(-360px); }
}

@keyframes wave-shift-2 {
    0% { transform: translateX(0); }
    100% { transform: translateX(-300px); }
}

@keyframes wave-shift-3 {
    0% { transform: translateX(0); }
    100% { transform: translateX(-270px); }
}

/* ============================================
   Masonry Layout
   ============================================ */
.masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.masonry-2col {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
}

.masonry-1col {
    grid-template-columns: 1fr;
    max-width: 700px;
}

/* ============================================
   Content Sections
   ============================================ */
.reef {
    position: relative;
    z-index: 1;
    padding: 60px 0;
}

.current {
    position: relative;
    z-index: 1;
    padding: 60px 0;
    background: linear-gradient(180deg, transparent, rgba(4, 30, 43, 0.3));
}

.deep {
    position: relative;
    z-index: 1;
    padding: 80px 0;
    background: var(--abyssal-teal);
}

.ascent {
    position: relative;
    z-index: 1;
    padding: 60px 0;
    background: linear-gradient(180deg, var(--abyssal-teal), var(--deep-lagoon));
}

/* Whale background */
.whale-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    pointer-events: none;
    animation: whale-drift 30s ease-in-out infinite alternate;
}

@keyframes whale-drift {
    0% { transform: translate(-50%, -50%) translateX(-5vw); }
    100% { transform: translate(-50%, -50%) translateX(5vw); }
}

/* ============================================
   Masonry Cards
   ============================================ */
.masonry-card {
    background: var(--deep-current);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 24px;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.masonry-card:hover {
    box-shadow: 0 0 20px rgba(57, 232, 198, 0.2);
}

.card-tall {
    grid-row: span 2;
}

.card-medium {
    grid-row: span 1;
}

.card-short {
    grid-row: span 1;
}

.card-full {
    grid-column: 1 / -1;
}

.card-accent {
    background: linear-gradient(135deg, rgba(255, 107, 138, 0.15), rgba(57, 232, 198, 0.1));
    border-color: rgba(255, 107, 138, 0.2);
}

.card-deep {
    background: rgba(4, 30, 43, 0.8);
    border-color: rgba(168, 85, 247, 0.15);
}

.card-deep:hover {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.25);
}

.card-final {
    border-color: rgba(255, 107, 138, 0.3);
}

.card-final:hover {
    box-shadow: 0 0 25px rgba(255, 107, 138, 0.25);
}

/* ============================================
   Card Content
   ============================================ */
.card-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--pearl);
    text-shadow: 2px 3px 0px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

.title-glow {
    color: var(--bioluminescent);
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.card-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    line-height: 1.7;
    color: var(--pearl);
    opacity: 0.85;
    margin-bottom: 12px;
}

.card-label {
    font-family: 'Caveat', cursive;
    font-size: 0.9rem;
    color: var(--kelp-sage);
    display: block;
    margin-top: 8px;
}

.card-quote {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: var(--coral-reef);
    line-height: 1.5;
}

/* Card data */
.card-data {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.data-key {
    font-family: 'Caveat', cursive;
    font-size: 0.9rem;
    color: var(--kelp-sage);
}

.data-val {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--seafoam);
}

.data-val.glow-purple {
    color: var(--bioluminescent);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Card illustrations */
.card-illustration {
    text-align: center;
    padding: 16px 0;
}

.card-illustration-large {
    padding: 24px 0;
}

/* ============================================
   Bioluminescent Glow Animation
   ============================================ */
@keyframes bio-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(57, 232, 198, 0.2); }
    50% { box-shadow: 0 0 30px rgba(57, 232, 198, 0.4); }
}

/* ============================================
   Reveal Animation
   ============================================ */
[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .masonry,
    .masonry-2col {
        grid-template-columns: 1fr;
    }

    .card-tall,
    .card-medium,
    .card-short {
        grid-row: span 1;
    }

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

    .masonry {
        padding: 20px 16px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .masonry {
        grid-template-columns: repeat(2, 1fr);
    }
}
