/* === Custom Properties === */
:root {
    --horizon-blue: #5b8fa8;
    --tidal-foam: #d4e5ed;
    --kelp-gold: #c4a254;
    --salt-linen: #f7f3ee;
    --abyssal-slate: #2c3e4a;
    --sea-glass: #e8f0e8;
    --mist-white: #fafcfd;
    --sandstone: #d4a574;
    --light-blue: #b8c9d4;
    --deep-text: #3a4a54;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Libre Baskerville', Georgia, serif;
    --font-accent: 'DM Sans', Arial, sans-serif;

    --gutter: clamp(24px, 4vw, 64px);
    --content-max: 1200px;

    --spring-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--deep-text);
    background: var(--salt-linen);
    line-height: 1.85;
    overflow-x: hidden;
}

/* === Navigation Dots === */
.nav-dots {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--horizon-blue);
    background: transparent;
    cursor: pointer;
    transition: background 0.4s var(--spring-smooth), transform 0.3s var(--spring-overshoot);
}

.nav-dot.active {
    background: var(--horizon-blue);
    transform: scale(1.3);
}

.nav-dot:hover {
    background: var(--kelp-gold);
    border-color: var(--kelp-gold);
}

/* === Scenes (shared) === */
.scene {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.scene-content {
    position: relative;
    z-index: 2;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--gutter);
    min-height: 100vh;
}

/* === Scene 1: Tidepool Introduction === */
.scene-1 {
    background: var(--salt-linen);
}

.scene-1 .scene-content {
    display: flex;
    align-items: flex-start;
    padding-top: 18vh;
}

.hero-text {
    max-width: 600px;
    opacity: 0;
    animation: fadeInHero 1.2s var(--spring-smooth) 0.3s forwards;
}

@keyframes fadeInHero {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 600;
    color: var(--abyssal-slate);
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.hero-gold-line {
    width: 120px;
    height: 3px;
    background: var(--kelp-gold);
    margin: 1.5rem 0;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.35rem);
    color: var(--horizon-blue);
    font-style: italic;
}

/* === Bubbles === */
.bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(91, 143, 168, 0.08), rgba(91, 143, 168, 0.02));
    border: 1px solid rgba(91, 143, 168, 0.15);
    animation: bubbleRise linear infinite, bubbleSway ease-in-out infinite;
}

.bubble::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    top: 20%;
    left: 35%;
    transform: rotate(-30deg);
}

.bubbles-dark .bubble {
    background: radial-gradient(circle at 40% 35%, rgba(212, 229, 237, 0.08), rgba(212, 229, 237, 0.02));
    border-color: rgba(212, 229, 237, 0.12);
}

.bubbles-dark .bubble::after {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes bubbleRise {
    0% { transform: translateY(100vh); }
    100% { transform: translateY(-120vh); }
}

@keyframes bubbleSway {
    0%, 100% { margin-left: 0; }
    50% { margin-left: 12px; }
}

/* === Scene 2: The Sand Garden === */
.scene-2 {
    background: var(--sea-glass);
    background-image: repeating-linear-gradient(90deg, transparent, transparent 14px, rgba(44, 62, 74, 0.04) 14px, rgba(44, 62, 74, 0.04) 15px);
}

.scene-2 .scene-content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
    align-content: center;
}

.card {
    background: rgba(250, 252, 253, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(91, 143, 168, 0.12);
    border-radius: 24px;
    padding: 2.5rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--spring-overshoot), transform 0.8s var(--spring-overshoot);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-label {
    font-family: var(--font-accent);
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kelp-gold);
    display: block;
    margin-bottom: 0.75rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 600;
    color: var(--abyssal-slate);
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.card-text {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    color: var(--deep-text);
    line-height: 1.85;
}

/* Z-pattern card positioning */
.card-1 {
    grid-column: 1 / 7;
    max-width: 380px;
}

.card-2 {
    grid-column: 4 / 10;
    max-width: 380px;
    justify-self: center;
}

.card-3 {
    grid-column: 7 / 13;
    max-width: 380px;
    justify-self: end;
}

/* Card hover bubbles */
.card {
    position: relative;
    overflow: visible;
}

.card-bubble {
    position: absolute;
    bottom: -5px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(91, 143, 168, 0.12), rgba(91, 143, 168, 0.04));
    border: 1px solid rgba(91, 143, 168, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.card:hover .card-bubble {
    animation: cardBubbleFloat 1.2s var(--spring-smooth) forwards;
}

@keyframes cardBubbleFloat {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-80px); }
}

/* Bubble Divider */
.bubble-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 3;
    pointer-events: none;
}

.micro-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 143, 168, 0.1), rgba(91, 143, 168, 0.03));
    border: 1px solid rgba(91, 143, 168, 0.12);
}

/* === Scene 3: The Current === */
.scene-3 {
    background: var(--salt-linen);
}

.scene-3 .scene-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 12vh;
    padding-bottom: 12vh;
    min-height: 100vh;
    justify-content: center;
}

.flow-block {
    max-width: 520px;
    opacity: 0;
    transition: opacity 0.8s var(--spring-smooth), transform 0.8s var(--spring-smooth);
    margin-bottom: 2rem;
}

.flow-block p {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.85;
    color: var(--deep-text);
}

.flow-left {
    align-self: flex-start;
    margin-left: 8%;
    transform: translateX(-30px);
}

.flow-right {
    align-self: flex-end;
    margin-right: 8%;
    transform: translateX(30px);
}

.flow-block.visible {
    opacity: 1;
    transform: translateX(0);
}

.flow-rule {
    width: 100%;
    height: 1px;
    background: var(--light-blue);
    margin: 1.5rem 0;
}

/* Micro-bubbles column */
.micro-bubbles-column {
    position: absolute;
    left: 50%;
    top: 0;
    width: 40px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

/* === Scene 4: The Observation Deck === */
.scene-4 {
    background: var(--abyssal-slate);
}

.scene-4 .scene-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.deck-quote {
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s var(--spring-smooth), transform 1s var(--spring-smooth);
}

.deck-quote.visible {
    opacity: 1;
    transform: translateY(0);
}

.deck-gold-line {
    width: 60px;
    height: 1px;
    background: var(--kelp-gold);
    margin: 0 auto 2.5rem;
}

.deck-quote blockquote {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 400;
    color: var(--mist-white);
    letter-spacing: 0.02em;
    line-height: 1.5;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .bubble { animation: none !important; }
    .hero-text { animation: none; opacity: 1; }
    .card, .flow-block, .deck-quote {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* === Mobile === */
@media (max-width: 768px) {
    .nav-dots {
        right: 12px;
    }

    .scene-2 .scene-content {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        align-items: flex-start;
    }

    .card-1, .card-2, .card-3 {
        max-width: 100%;
    }

    .card-2 {
        margin-left: 8%;
    }

    .card-3 {
        margin-left: 16%;
    }

    .flow-left, .flow-right {
        align-self: flex-start;
        margin-left: 8%;
        margin-right: 8%;
    }

    .micro-bubbles-column {
        display: none;
    }
}
