/* ============================================================
   RRIPPL.com - Styles
   Color Palette:
     Abyssal Black:        #060a0f
     Midnight Current:     #0c1a2b
     Bioluminescent Teal:  #00d4aa
     Deep Phosphor:        #0088a3
     Drop Gold:            #c9a84c
     Pearl Mist:           #d8e2e8
     Fog Grey:             #7b8fa3
     Wave Crest White:     #eaf4f8
   ============================================================ */

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

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

body {
    background: #060a0f;
    color: #d8e2e8;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
    cursor: default;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.08em;
    color: #eaf4f8;
}

h2 {
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: 1.15;
    margin-bottom: 0.5em;
}

p {
    max-width: 600px;
    color: #d8e2e8;
}

.node-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: #0088a3;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1em;
}

/* --- Cursor Ripple Layer --- */
#cursor-ripple-layer,
#click-ripple-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
}

#click-ripple-layer {
    z-index: 9998;
}

.cursor-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid #00d4aa;
    pointer-events: none;
    animation: cursorRingExpand 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.click-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: clickRingExpand 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.click-ring:nth-child(odd) {
    border: 1.5px solid #c9a84c;
}

.click-ring:nth-child(even) {
    border: 1px solid #00d4aa;
}

@keyframes cursorRingExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
        border-width: 1.5px;
    }
    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
        border-width: 0.3px;
    }
}

@keyframes clickRingExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.7;
        border-width: 1.5px;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
        border-width: 0.3px;
    }
}

/* --- Navigation --- */
#nav-cluster {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    animation: navFadeIn 1s ease-out 3s forwards;
}

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

.nav-dot {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.3s ease;
    position: relative;
}

.nav-dot::after {
    content: attr(data-label);
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #7b8fa3;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.nav-dot:hover::after {
    opacity: 1;
}

.nav-dot:hover {
    transform: scale(1.3);
}

.nav-dot:hover svg circle {
    stroke: #c9a84c;
    transition: stroke 0.3s ease;
}

.nav-dot.active svg circle:first-child {
    stroke: #c9a84c;
    fill: #c9a84c;
    fill-opacity: 0.3;
}

/* --- Sections (common) --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- Drop Points --- */
.drop-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #c9a84c;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.5);
}

.drop-point::before,
.drop-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid #00d4aa;
    animation: dropPointPulse 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

.drop-point::before {
    animation-delay: 0s;
}

.drop-point::after {
    animation-delay: 2s;
}

@keyframes dropPointPulse {
    0% {
        width: 8px;
        height: 8px;
        margin-left: -4px;
        margin-top: -4px;
        opacity: 0.6;
        border-width: 1.5px;
    }
    100% {
        width: 120px;
        height: 120px;
        margin-left: -60px;
        margin-top: -60px;
        opacity: 0;
        border-width: 0.5px;
    }
}

#drop-point-1 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: goldDotFadeIn 800ms ease-out 600ms forwards;
}

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

#drop-point-2a { top: 30%; left: 25%; }
#drop-point-2b { top: 55%; left: 60%; }
#drop-point-2c { top: 70%; left: 35%; }
#drop-point-3 { top: 50%; left: 50%; transform: translate(-50%, -50%); }
#drop-point-4 { top: 30%; left: 50%; transform: translateX(-50%); }
#drop-point-5 { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* --- Section 1: The Still Surface --- */
#still-surface {
    height: 100vh;
    background: #060a0f;
}

#entry-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.entry-ring {
    fill: none;
    stroke: #00d4aa;
    stroke-width: 0.2;
    transform-origin: center;
    opacity: 0;
}

.arc-title {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.25em;
    opacity: 0;
    animation: arcTitleFadeIn 1.5s ease-out 2.5s forwards;
}

@keyframes arcTitleFadeIn {
    to { opacity: 0.9; }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0;
    animation: scrollIndicatorPulse 2s ease-in-out 4s infinite, scrollIndicatorFadeIn 1s ease 3.5s forwards;
}

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

@keyframes scrollIndicatorPulse {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* Entry ring animations */
.ring-animate-1 {
    animation: entryRing1 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.4s forwards;
}
.ring-animate-2 {
    animation: entryRing2 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.8s forwards;
}
.ring-animate-3 {
    animation: entryRing3 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2.2s forwards;
}

@keyframes entryRing1 {
    0% { r: 0.3; opacity: 0.8; stroke-width: 0.3; }
    100% { r: 45; opacity: 0; stroke-width: 0.05; }
}
@keyframes entryRing2 {
    0% { r: 0.3; opacity: 0.7; stroke-width: 0.25; }
    100% { r: 40; opacity: 0; stroke-width: 0.05; }
}
@keyframes entryRing3 {
    0% { r: 0.3; opacity: 0.6; stroke-width: 0.2; }
    100% { r: 35; opacity: 0; stroke-width: 0.05; }
}

/* --- Section 2: The Propagation Field --- */
#propagation-field {
    min-height: 200vh;
    background: linear-gradient(180deg, #060a0f 0%, #0c1a2b 30%, #0c1a2b 70%, #060a0f 100%);
    flex-direction: column;
    padding: 10vh 0;
}

.propagation-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.3;
}

.propagation-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 5;
    min-height: 180vh;
}

.content-node {
    position: absolute;
    width: clamp(280px, 35vw, 450px);
    padding: 40px;
    border-radius: 50% / 40%;
    background: radial-gradient(ellipse at center, rgba(12, 26, 43, 0.9) 0%, rgba(6, 10, 15, 0.6) 70%, transparent 100%);
    border: 1px solid rgba(0, 212, 170, 0.15);
    backdrop-filter: blur(4px);
}

.content-node .node-inner {
    text-align: center;
}

.content-node h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 0.5em;
}

.content-node p {
    margin: 0 auto;
    font-size: 15px;
    color: #7b8fa3;
    max-width: 350px;
}

.node-1 { top: 5%; left: 5%; }
.node-2 { top: 35%; right: 5%; left: auto; }
.node-3 { top: 65%; left: 15%; }

/* Interference Nodes */
.interference-node {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.2) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
    animation: interferenceGlow 3s ease-in-out infinite;
}

.interference-node.visible {
    opacity: 1;
}

.interference-node span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.06em;
    color: #00d4aa;
    text-transform: uppercase;
    white-space: nowrap;
}

@keyframes interferenceGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 212, 170, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 170, 0.5); }
}

.i-node-1 { top: 22%; left: 45%; }
.i-node-2 { top: 50%; left: 38%; }
.i-node-3 { top: 55%; right: 25%; }

/* --- Section 3: The Resonance Chamber --- */
#resonance-chamber {
    min-height: 200vh;
    background: #060a0f;
    position: relative;
}

.resonance-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cymatics-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 40% 40% at 20% 30%, rgba(0, 136, 163, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 35% 35% at 70% 60%, rgba(0, 136, 163, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0, 136, 163, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 30% 30% at 80% 20%, rgba(0, 212, 170, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse 45% 45% at 30% 80%, rgba(0, 136, 163, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 25% 25% at 60% 40%, rgba(0, 212, 170, 0.03) 0%, transparent 70%);
    animation: cymaticsDrift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes cymaticsDrift {
    0% { background-position: 0% 0%, 100% 100%, 50% 50%, 80% 20%, 30% 80%, 60% 40%; }
    100% { background-position: 10% 5%, 90% 95%, 55% 45%, 75% 25%, 35% 75%, 65% 35%; }
}

.wave-text-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 5;
    white-space: nowrap;
}

.wave-text-secondary {
    margin-top: 20px;
}

.wave-char {
    display: inline-block;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 300;
    font-style: italic;
    color: #eaf4f8;
    letter-spacing: 0.08em;
    transition: transform 0.1s ease-out;
}

.wave-text-secondary .wave-char {
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    color: #7b8fa3;
}

.resonance-annotations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.annotation {
    position: absolute;
    left: var(--a-x);
    top: var(--a-y);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #0088a3;
    opacity: 0.5;
}

/* --- Section 4: The Deep --- */
#the-deep {
    min-height: 150vh;
    background: linear-gradient(180deg, #060a0f 0%, #050810 50%, #060a0f 100%);
}

.depth-container {
    width: 100%;
    max-width: 1000px;
    height: 100vh;
    position: sticky;
    top: 0;
    perspective: 1000px;
    transform-style: preserve-3d;
    margin: 0 auto;
}

.depth-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.layer-back {
    transform: translateZ(-300px);
    opacity: 0.4;
}

.layer-mid {
    transform: translateZ(-150px);
    opacity: 0.65;
}

.layer-front {
    transform: translateZ(0);
    opacity: 1;
}

.depth-content {
    max-width: 500px;
    text-align: center;
}

.layer-back .depth-content {
    transform: translateY(-80px) translateX(-100px);
}

.layer-mid .depth-content {
    transform: translateY(40px) translateX(80px);
}

.layer-front .depth-content {
    transform: translateY(100px);
}

.depth-content h2 {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
}

.depth-content p {
    margin: 0 auto;
    color: #7b8fa3;
}

.depth-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 136, 163, 0.15);
    pointer-events: none;
}

.depth-ring-1 {
    width: 300px;
    height: 300px;
    top: 20%;
    left: 10%;
    animation: depthRingSlow 8s ease-in-out infinite;
}

.depth-ring-2 {
    width: 200px;
    height: 200px;
    bottom: 25%;
    right: 15%;
    animation: depthRingSlow 6s ease-in-out infinite reverse;
}

.depth-ring-3 {
    width: 250px;
    height: 250px;
    top: 35%;
    right: 10%;
    animation: depthRingSlow 10s ease-in-out infinite;
}

@keyframes depthRingSlow {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.15); opacity: 0.3; }
}

/* --- Section 5: The Shore --- */
#the-shore {
    min-height: 100vh;
    background: linear-gradient(180deg, #060a0f 0%, #060a0f 100%);
    flex-direction: column;
    padding: 15vh 40px;
}

.shore-content {
    position: relative;
    text-align: center;
    max-width: 700px;
    z-index: 5;
}

.shore-text h2 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 0.5em;
}

.shore-text p {
    margin: 0 auto 2em;
    color: #7b8fa3;
    max-width: 550px;
}

.shore-closing {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #0088a3;
    margin-top: 3em;
}

.shore-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    pointer-events: none;
    z-index: 1;
}

/* --- Scroll Reveal --- */
.scroll-reveal {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(4px);
    transition: opacity 600ms ease-out, transform 600ms ease-out, filter 600ms ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* --- Section Ring Burst on Enter --- */
.section.entered .drop-point {
    animation: sectionBurst 300ms ease-out;
}

@keyframes sectionBurst {
    0% { box-shadow: 0 0 12px rgba(201, 168, 76, 0.5); }
    50% { box-shadow: 0 0 30px rgba(201, 168, 76, 0.9), 0 0 60px rgba(0, 212, 170, 0.3); }
    100% { box-shadow: 0 0 12px rgba(201, 168, 76, 0.5); }
}

/* --- Ring Field for propagation (ambient) --- */
.ring-field {
    mix-blend-mode: screen;
}

/* Ambient propagation rings */
.ambient-ring {
    fill: none;
    stroke: #0088a3;
    opacity: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-node {
        position: relative;
        width: 90%;
        max-width: 400px;
        margin: 30px auto;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        border-radius: 30px;
    }

    .propagation-content {
        display: flex;
        flex-direction: column;
        min-height: auto;
        padding: 10vh 20px;
    }

    .interference-node {
        display: none;
    }

    .depth-container {
        perspective: none;
    }

    .depth-layer {
        position: relative;
        transform: none !important;
        opacity: 1;
        height: auto;
        padding: 60px 20px;
    }

    .layer-back .depth-content,
    .layer-mid .depth-content,
    .layer-front .depth-content {
        transform: none;
    }

    #nav-cluster {
        top: 12px;
        right: 12px;
        gap: 6px;
    }

    .nav-dot::after {
        display: none;
    }

    .wave-char {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .wave-text-secondary .wave-char {
        font-size: clamp(1rem, 4vw, 1.8rem);
    }
}
