/* ====================================
   RRIPPL.com - Ocean Deep Design
   ==================================== */

/* --- CSS Variables / Color Palette --- */
:root {
    --sun-kissed-foam: #e8f4f8;
    --living-teal: #0e8b9e;
    --fathom-blue: #0a5470;
    --pressure-ink: #083d55;
    --trench-black: #061f33;
    --hadal-dark: #030e1a;
    --phosphor-cyan: #00d4ff;
    --caustic-white: #c5eef8;
    --coral-signal: #ff6b4a;
    --surface-blue: #1a8fc4;
    --mid-blue: #0e6b8a;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    color: var(--sun-kissed-foam);
    background-color: var(--hadal-dark);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

p {
    font-family: 'Quicksand', sans-serif;
    font-weight: 400;
}

/* --- Depth Navigator (left edge wave) --- */
#depth-navigator {
    position: fixed;
    left: 0;
    top: 0;
    width: 30px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

#depth-wave-svg {
    width: 100%;
    height: 100%;
}

/* --- Depth Labels --- */
#depth-labels {
    position: fixed;
    left: 40px;
    top: 0;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#depth-labels.visible {
    opacity: 1;
}

.depth-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.depth-label.active {
    opacity: 1;
}

.depth-text {
    font-family: 'Comfortaa', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--phosphor-cyan);
    white-space: nowrap;
}

.depth-line {
    display: block;
    width: 30px;
    height: 1px;
    background: var(--phosphor-cyan);
    opacity: 0.3;
}

/* --- Sections Base --- */
.depth-section {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    will-change: background-color;
}

.section-content {
    position: relative;
    z-index: 10;
    display: grid;
    place-items: center;
    gap: clamp(3rem, 8vw, 8rem);
    padding: clamp(2rem, 5vw, 6rem);
    max-width: 1200px;
    width: 100%;
}

/* --- HERO Section --- */
#hero {
    background: radial-gradient(ellipse at center, var(--sun-kissed-foam), var(--surface-blue));
    min-height: 100vh;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

/* --- Site Title Letters --- */
#site-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.3em;
    color: white;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: scale(0.8);
    animation: letterAppear 0.8s ease forwards, letterFloat 3s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes letterAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes letterFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.letter:nth-child(1) { animation-delay: 0.5s, 1.3s; }
.letter:nth-child(2) { animation-delay: 0.7s, 1.5s; }
.letter:nth-child(3) { animation-delay: 0.9s, 1.7s; }
.letter:nth-child(4) { animation-delay: 1.1s, 1.9s; }
.letter:nth-child(5) { animation-delay: 1.3s, 2.1s; }
.letter:nth-child(6) { animation-delay: 1.5s, 2.3s; }

/* --- Hero Tagline --- */
.hero-tagline {
    font-family: 'Comfortaa', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--caustic-white);
    opacity: 0;
    animation: fadeIn 1.5s ease 2s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --- Scroll Chevron --- */
.scroll-chevron {
    opacity: 0;
    animation: fadeIn 1s ease 2.5s forwards, chevronBob 2s ease-in-out infinite 2.5s;
    cursor: pointer;
    will-change: transform;
}

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

/* --- Ripple Container (Hero background) --- */
.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    border: 2px solid rgba(197, 238, 248, 0.3);
    animation: rippleExpand 4s ease-out infinite;
    will-change: transform, opacity;
}

@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* --- Wave Dividers --- */
.wave-divider {
    position: relative;
    height: 120px;
    overflow: hidden;
    z-index: 5;
    margin-top: -60px;
    margin-bottom: -60px;
}

.wave-divider svg {
    width: 100%;
    height: 100%;
    display: block;
}

.wave-path {
    fill: none;
    stroke-width: 1.5;
    will-change: transform;
}

.wave-1 {
    stroke: rgba(14, 139, 158, 0.3);
    animation: waveShift1 8s ease-in-out infinite;
}

.wave-2 {
    stroke: rgba(0, 212, 255, 0.2);
    animation: waveShift2 10s ease-in-out infinite;
}

.wave-3 {
    stroke: rgba(197, 238, 248, 0.15);
    animation: waveShift3 12s ease-in-out infinite;
}

@keyframes waveShift1 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-3%); }
}

@keyframes waveShift2 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4%); }
}

@keyframes waveShift3 {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-2%); }
}

/* --- Content Panels --- */
.content-panel {
    padding: clamp(2rem, 4vw, 4rem);
    max-width: 650px;
    will-change: transform;
    transition: transform 0.6s ease;
}

/* Organic blob shapes with animation */
.panel-blob-1 {
    border-radius: 40% 60% 55% 45% / 60% 40% 50% 55%;
    animation: blobMorph1 12s ease-in-out infinite;
}

.panel-blob-2 {
    border-radius: 55% 45% 40% 60% / 50% 55% 45% 60%;
    animation: blobMorph2 12s ease-in-out infinite;
}

.panel-blob-3 {
    border-radius: 45% 55% 60% 40% / 55% 45% 50% 60%;
    animation: blobMorph3 12s ease-in-out infinite;
}

.panel-blob-4 {
    border-radius: 60% 40% 45% 55% / 45% 60% 55% 40%;
    animation: blobMorph1 12s ease-in-out infinite reverse;
}

.panel-blob-5 {
    border-radius: 50% 50% 55% 45% / 55% 45% 50% 50%;
    animation: blobMorph2 12s ease-in-out infinite reverse;
}

@keyframes blobMorph1 {
    0%, 100% { border-radius: 40% 60% 55% 45% / 60% 40% 50% 55%; }
    25% { border-radius: 55% 45% 60% 40% / 45% 55% 50% 60%; }
    50% { border-radius: 60% 40% 45% 55% / 55% 45% 60% 50%; }
    75% { border-radius: 45% 55% 50% 60% / 40% 60% 45% 55%; }
}

@keyframes blobMorph2 {
    0%, 100% { border-radius: 55% 45% 40% 60% / 50% 55% 45% 60%; }
    25% { border-radius: 40% 60% 50% 55% / 60% 40% 55% 45%; }
    50% { border-radius: 50% 50% 60% 40% / 45% 55% 40% 60%; }
    75% { border-radius: 60% 40% 45% 55% / 55% 50% 60% 45%; }
}

@keyframes blobMorph3 {
    0%, 100% { border-radius: 45% 55% 60% 40% / 55% 45% 50% 60%; }
    25% { border-radius: 60% 40% 50% 50% / 40% 60% 55% 45%; }
    50% { border-radius: 55% 45% 45% 55% / 60% 50% 40% 55%; }
    75% { border-radius: 40% 60% 55% 45% / 50% 45% 60% 40%; }
}

/* Surface panels - bright, with caustic shimmer */
.surface-panel {
    background: rgba(232, 244, 248, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(197, 238, 248, 0.2);
    color: var(--sun-kissed-foam);
}

.surface-panel h2 {
    color: white;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Twilight panels - bioluminescent glow */
.twilight-panel {
    background: rgba(8, 61, 85, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.1), inset 0 0 20px rgba(0, 212, 255, 0.03);
    animation-name: biolumPulse, blobMorph3;
    animation-duration: 4s, 12s;
    animation-timing-function: ease-in-out, ease-in-out;
    animation-iteration-count: infinite, infinite;
}

@keyframes biolumPulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.1), inset 0 0 20px rgba(0, 212, 255, 0.03);
    }
    50% {
        box-shadow: 0 0 60px rgba(0, 212, 255, 0.2), inset 0 0 30px rgba(0, 212, 255, 0.06);
    }
}

/* Abyss panels - dim center glow */
.abyss-panel {
    background: radial-gradient(ellipse at center, rgba(10, 84, 112, 0.15), rgba(3, 14, 26, 0));
    border: 1px solid rgba(0, 212, 255, 0.05);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.08), inset 0 0 20px rgba(0, 212, 255, 0.02);
}

.abyss-panel h2 {
    color: var(--caustic-white);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

/* Thermal vent panel */
.thermal-panel {
    background: radial-gradient(ellipse at center, rgba(255, 107, 74, 0.12), rgba(6, 31, 51, 0.3));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 107, 74, 0.2);
    border-radius: 50%;
    padding: clamp(3rem, 6vw, 6rem);
    text-align: center;
    max-width: 600px;
}

.thermal-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--coral-signal);
    text-shadow: 0 0 40px rgba(255, 107, 74, 0.5), 0 0 80px rgba(255, 107, 74, 0.2);
    animation: thermalGlow 2s ease-in-out infinite;
}

@keyframes thermalGlow {
    0%, 100% {
        text-shadow: 0 0 40px rgba(255, 107, 74, 0.5), 0 0 80px rgba(255, 107, 74, 0.2);
        filter: hue-rotate(0deg);
    }
    50% {
        text-shadow: 0 0 60px rgba(255, 107, 74, 0.7), 0 0 120px rgba(255, 107, 74, 0.3);
        filter: hue-rotate(10deg);
    }
}

.thermal-text {
    color: var(--sun-kissed-foam);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

/* Thermal shimmer overlay */
.thermal-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    background: radial-gradient(ellipse at 50% 80%, rgba(255, 107, 74, 0.08), transparent 70%);
    animation: shimmerReveal 2s ease-out forwards;
}

.thermal-shimmer.active {
    opacity: 1;
    animation: thermalShimmerPulse 3s ease-in-out infinite;
}

@keyframes thermalShimmerPulse {
    0%, 100% {
        opacity: 0.6;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 1;
        filter: hue-rotate(15deg);
    }
}

/* --- Section Zone Backgrounds --- */
#surface-zone {
    background: linear-gradient(180deg, var(--surface-blue), var(--mid-blue));
}

#twilight-zone-1 {
    background: linear-gradient(180deg, var(--mid-blue), var(--fathom-blue));
}

#twilight-zone-2 {
    background: linear-gradient(180deg, var(--fathom-blue), var(--pressure-ink));
}

#thermal-vent {
    background: linear-gradient(180deg, var(--pressure-ink), #0d2a3d);
}

#abyssal-zone {
    background: linear-gradient(180deg, var(--trench-black), var(--hadal-dark));
}

#hadal-zone {
    background: var(--hadal-dark);
    min-height: 80vh;
}

/* --- Caustic Overlay --- */
.caustic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 40%, rgba(197, 238, 248, 0.08), transparent 60%),
                radial-gradient(ellipse at 70% 60%, rgba(197, 238, 248, 0.06), transparent 50%);
    filter: url(#caustic-filter);
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
}

/* --- Particle Fields (twilight/abyss) --- */
.particle-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--phosphor-cyan);
    will-change: transform, opacity;
}

/* --- Bubble Containers --- */
.bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), rgba(255,255,255,0.05));
    border: 1px solid rgba(200, 238, 248, 0.3);
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.1);
    will-change: transform, opacity;
}

/* --- Thermal Particles --- */
.thermal-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.thermal-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--coral-signal);
    will-change: transform, opacity;
}

/* --- Hadal Zone --- */
.hadal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.hadal-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--phosphor-cyan);
    opacity: 0.6;
    text-align: center;
    animation: deepPulse 3s ease-in-out infinite;
    will-change: transform;
}

@keyframes deepPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.02); opacity: 0.75; }
}

/* --- Interaction Ripple Effect --- */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    border: 2px solid var(--phosphor-cyan);
    pointer-events: none;
    z-index: 9999;
    animation: clickRippleOut 0.8s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes clickRippleOut {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* --- Hover Ripple on Interactive Elements --- */
a, .content-panel {
    position: relative;
    overflow: visible;
}

a {
    color: var(--living-teal);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--phosphor-cyan);
    animation: linkPulse 1.5s ease-in-out infinite;
}

@keyframes linkPulse {
    0%, 100% { color: var(--living-teal); }
    50% { color: var(--phosphor-cyan); }
}

/* --- Section Entry Animation --- */
.depth-section .section-content {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

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

/* --- Macro Ripple Background Effect --- */
.macro-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
}

.macro-ripple.surface-ripple {
    background: radial-gradient(circle, rgba(197, 238, 248, 0.06), transparent 70%);
    animation: macroRippleExpand 8s ease-out infinite;
}

.macro-ripple.twilight-ripple {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.04), transparent 70%);
    animation: macroRippleExpand 10s ease-out infinite;
}

.macro-ripple.abyss-ripple {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.02), transparent 70%);
    animation: macroRippleExpand 12s ease-out infinite;
}

@keyframes macroRippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.5;
    }
    100% {
        width: 200vmax;
        height: 200vmax;
        opacity: 0;
    }
}

/* --- Hover Ripple on Content Panels --- */
.content-panel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 2px solid var(--phosphor-cyan);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.content-panel:hover::after {
    animation: panelHoverRipple 1s ease-out;
}

@keyframes panelHoverRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
    }
    100% {
        width: 120%;
        height: 120%;
        opacity: 0;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #depth-navigator,
    #depth-labels {
        display: none;
    }

    .content-panel {
        padding: clamp(1.5rem, 4vw, 3rem);
        max-width: 90vw;
    }

    .thermal-panel {
        border-radius: 40% 60% 55% 45% / 60% 40% 50% 55%;
    }

    #site-title {
        letter-spacing: 0.15em;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

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