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

html {
    overflow: hidden;
    height: 100%;
}

body {
    overflow: hidden;
    height: 100%;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    line-height: 1.72;
    color: #c8e6f0;
    background: #0b2e3f;
}

/* === Wave Overlay === */
.wave-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 200vw;
    height: 80px;
    z-index: 100;
    pointer-events: none;
}

.wave-path {
    fill: #7ec8d8;
    opacity: 0.15;
    animation: wave-drift 20s linear infinite;
}

@keyframes wave-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === Navigation Indicator === */
.nav-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.nav-line {
    position: absolute;
    width: 1px;
    height: 100%;
    background: rgba(74, 144, 164, 0.3);
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #4a90a4;
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: all 0.8s ease;
}

.nav-dot.active {
    background: #7ec8d8;
    box-shadow: 0 0 12px rgba(126, 200, 216, 0.6), 0 0 24px rgba(126, 200, 216, 0.3);
    border-color: #7ec8d8;
}

/* === Scroll Container === */
.scroll-container {
    display: flex;
    height: 100vh;
    width: fit-content;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.section {
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* === Section 1: Surface === */
.section-surface {
    width: 100vw;
    background: linear-gradient(135deg, #1a5c72 0%, #1a5c72 40%, #133e54 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.caustics {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.caustic-layer {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.caustic-1 {
    width: 60vw;
    height: 60vw;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, #7ec8d8 0%, transparent 70%);
    animation: caustic-drift 15s ease-in-out infinite alternate;
}

.caustic-2 {
    width: 45vw;
    height: 45vw;
    top: 30%;
    right: -5%;
    background: radial-gradient(circle, #e0f4ff 0%, transparent 70%);
    animation: caustic-drift 18s ease-in-out infinite alternate-reverse;
    opacity: 0.08;
}

.caustic-3 {
    width: 50vw;
    height: 50vw;
    bottom: -15%;
    left: 25%;
    background: radial-gradient(circle, #7ec8d8 0%, transparent 70%);
    animation: caustic-drift 12s ease-in-out infinite alternate;
    opacity: 0.12;
}

@keyframes caustic-drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5%, -3%) scale(1.05); }
    66% { transform: translate(-3%, 5%) scale(0.95); }
    100% { transform: translate(2%, 2%) scale(1.02); }
}

.light-rays {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.ray {
    position: absolute;
    width: 3px;
    height: 120%;
    background: linear-gradient(to bottom, rgba(224, 244, 255, 0.15), transparent 80%);
    transform-origin: top center;
    transform: rotate(15deg);
}

.ray-1 {
    left: 25%;
    animation: ray-pulse 6s ease-in-out infinite;
}

.ray-2 {
    left: 50%;
    transform: rotate(12deg);
    animation: ray-pulse 8s ease-in-out infinite 2s;
    opacity: 0.7;
}

.ray-3 {
    left: 72%;
    transform: rotate(18deg);
    animation: ray-pulse 7s ease-in-out infinite 1s;
    opacity: 0.5;
}

@keyframes ray-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.surface-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.wordmark {
    font-family: 'Alfa Slab One', serif;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: 0.06em;
    color: #e0f4ff;
    text-shadow: 0 0 30px rgba(126, 200, 216, 0.4);
    opacity: 0;
}

.wordmark.visible {
    animation: wordmark-in 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4a90a4;
    opacity: 0;
    margin-top: 1rem;
}

.tagline.visible {
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-hint {
    position: absolute;
    bottom: 10%;
    right: 10%;
    z-index: 10;
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.4; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(5px); }
}

/* === Section 2: Shallows === */
.section-shallows {
    width: 120vw;
    background: linear-gradient(to right, #1a5c72, #133e54);
    display: flex;
    align-items: center;
}

.puzzle-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.puzzle-piece {
    animation: float-piece 12s ease-in-out infinite;
}

.p1 { animation-delay: 0s; }
.p2 { animation-delay: -4s; }
.p3 { animation-delay: -8s; }

@keyframes float-piece {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -15px) rotate(2deg); }
    50% { transform: translate(-5px, 10px) rotate(-1deg); }
    75% { transform: translate(8px, 5px) rotate(1.5deg); }
}

.shallows-cards {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 4vw;
    padding: 0 8vw;
    align-items: flex-start;
    width: 100%;
}

.glass-card {
    background: rgba(126, 200, 216, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(126, 200, 216, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 360px;
    flex-shrink: 0;
}

.card-1 { margin-top: 15vh; }
.card-2 { margin-top: 40vh; }
.card-3 { margin-top: 22vh; }

.section-title {
    font-family: 'Alfa Slab One', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.06em;
    color: #e0f4ff;
    margin-bottom: 1rem;
}

.glass-card p {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: #c8e6f0;
}

/* === Reveal animation === */
.reveal {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateX(0);
}

/* === Section 3: Reef === */
.section-reef {
    width: 150vw;
    background: #133e54;
    position: relative;
}

.grid-lines, .connection-paths {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.conn-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.05s linear;
}

.endpoint-dot {
    animation: dot-pulse 3s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 0.3; r: 3; }
    50% { opacity: 0.8; r: 5; }
}

.reef-nodes {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.reef-node {
    position: absolute;
    background: rgba(126, 200, 216, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(126, 200, 216, 0.25);
    border-radius: 16px;
    padding: 2rem;
    max-width: 280px;
}

.reef-node h3 {
    font-family: 'Alfa Slab One', serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    letter-spacing: 0.06em;
    color: #e0f4ff;
    margin-bottom: 0.75rem;
}

.reef-node p {
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: #c8e6f0;
}

/* === Section 4: Deep === */
.section-deep {
    width: 100vw;
    background: #0b2e3f;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bioluminescent-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bio-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #f0c27a, transparent);
    animation: bio-pulse var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes bio-pulse {
    0%, 100% { opacity: 0.1; transform: scale(0.8) translate(0,0); }
    50% { opacity: 0.7; transform: scale(1.2) translate(5px, -5px); }
}

.deep-content {
    position: relative;
    z-index: 10;
    max-width: 700px;
    padding: 0 2rem;
    text-align: center;
}

.vision-text {
    font-family: 'Alfa Slab One', serif;
    font-size: clamp(1.4rem, 3.5vw, 2.5rem);
    letter-spacing: 0.04em;
    color: #e0f4ff;
    line-height: 1.5;
    text-shadow: 0 0 30px rgba(126, 200, 216, 0.3);
    animation: glow-text 6s ease-in-out infinite;
}

@keyframes glow-text {
    0%, 100% { text-shadow: 0 0 20px rgba(126, 200, 216, 0.3); }
    50% { text-shadow: 0 0 40px rgba(126, 200, 216, 0.5), 0 0 60px rgba(126, 200, 216, 0.2); }
}

/* === Section 5: Floor === */
.section-floor {
    width: 100vw;
    background: #0b2e3f;
    position: relative;
}

.floor-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.grid-dot {
    animation: dot-pulse 4s ease-in-out infinite;
}

.floor-contacts {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.contact-point {
    position: absolute;
}

.coord {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4a90a4;
    margin-bottom: 0.5rem;
}

.contact-link {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: #e0f4ff;
    text-decoration: none;
    background-image: linear-gradient(#f0c27a, #f0c27a);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.6s ease;
}

.contact-link:hover {
    background-size: 100% 1px;
}

.floor-wordmark {
    position: absolute;
    bottom: 10%;
    right: 5%;
    font-family: 'Alfa Slab One', serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.06em;
    color: #4a90a4;
    opacity: 0.6;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    .caustic-layer, .puzzle-piece, .bio-particle, .ray, .wave-path, .scroll-hint {
        animation: none !important;
    }
    .scroll-container {
        transition-duration: 0.01s;
    }
    .reveal {
        transition-duration: 0.01s;
    }
}
