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

html {
    scroll-behavior: smooth;
}

body {
    background: #0b1120;
    color: #d4dae6;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.85;
    font-weight: 400;
    overflow-x: hidden;
    position: relative;
}

/* === SVG Field Lines === */
.field-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.field-lines path {
    fill: none;
    stroke: #c0cfe0;
    stroke-width: 1.5;
    opacity: 0.08;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
}

.field-lines path.active {
    animation: drawLine 3s ease-out forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

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

.bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(192,207,224,0.2);
    background: radial-gradient(circle at 30% 30%, rgba(74,127,255,0.1), transparent);
    box-shadow: inset 0 0 20px rgba(74,127,255,0.05);
    animation: floatBubble var(--duration) linear infinite;
    animation-delay: var(--delay);
    left: var(--left);
    width: var(--size);
    height: var(--size);
    bottom: -150px;
}

@keyframes floatBubble {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(calc(-100vh - 200px)) scale(1.1); opacity: 0; }
}

/* === Compass Navigation === */
.compass {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    cursor: pointer;
}

.compass-needle {
    animation: spinSlow 30s linear infinite;
    display: block;
}

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

.compass-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.compass-menu.open {
    pointer-events: auto;
    opacity: 1;
}

.compass-menu a {
    position: absolute;
    transform: rotate(var(--angle)) translateX(100px) rotate(calc(-1 * var(--angle)));
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: #d4dae6;
    text-decoration: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    transition-delay: var(--stagger);
}

.compass-menu.open a {
    opacity: 1;
}

.compass-menu a:nth-child(1) { --stagger: 0ms; }
.compass-menu a:nth-child(2) { --stagger: 50ms; }
.compass-menu a:nth-child(3) { --stagger: 100ms; }
.compass-menu a:nth-child(4) { --stagger: 150ms; }
.compass-menu a:nth-child(5) { --stagger: 200ms; }
.compass-menu a:nth-child(6) { --stagger: 250ms; }

.compass-menu a:hover {
    color: #6eb4ff;
}

/* === Hero Section === */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #0b1120;
    z-index: 2;
    overflow: hidden;
}

.hero-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    position: relative;
    z-index: 3;
}

.letter {
    display: inline-block;
    transform: translateY(var(--offset));
    color: transparent;
    background: linear-gradient(135deg, #c0cfe0, #4a7fff, #c0cfe0);
    -webkit-background-clip: text;
    background-clip: text;
    transition: transform 0.6s ease-out;
}

.hero-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: #6eb4ff;
    transform: rotate(-3deg);
    margin-top: 0.5rem;
    position: relative;
    z-index: 3;
}

/* Ripple rings */
.ripple-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 1px solid rgba(74,127,255,0.3);
    animation: pulse 4s ease-out infinite;
}

.ring-2 { animation-delay: 1.3s; }
.ring-3 { animation-delay: 2.6s; }

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

/* === Equation Overlays === */
.equation {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: #8b95a8;
    opacity: 0.12;
    pointer-events: none;
    z-index: 2;
}

.eq-1 {
    font-size: 3rem;
    top: 20%;
    left: 10%;
    transform: rotate(-5deg);
}

.eq-2 {
    font-size: 2.5rem;
    bottom: 15%;
    right: 8%;
    transform: rotate(3deg);
}

.eq-overlay {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 2rem;
    color: #8b95a8;
    opacity: 0.12;
    pointer-events: none;
    transform: rotate(var(--rot, 0deg));
    white-space: nowrap;
}

/* === Content Sections === */
.content-section {
    position: relative;
    z-index: 5;
    padding: 3rem 2.5rem;
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.content-section.visible {
    opacity: 1;
    transform: translateX(0) !important;
}

.content-section h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #c0cfe0;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #c0cfe0 0%, #8b95a8 50%, #c0cfe0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.content-section p {
    color: #d4dae6;
    margin-bottom: 1.2rem;
    font-weight: 400;
}

.content-section p:last-child {
    margin-bottom: 0;
}

/* Spray texture pseudo-elements */
.content-section::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(110,180,255,0.15) 0%, transparent 70%);
    filter: blur(30px);
    pointer-events: none;
    z-index: -1;
}

/* Section positioning — broken grid */
.section-left {
    margin-left: 10vw;
    width: 50vw;
    margin-top: 8vh;
    transform: translateX(-40px);
}
.section-left::before {
    top: -50px;
    right: -80px;
    background: radial-gradient(circle, rgba(110,180,255,0.15) 0%, transparent 70%);
}

/* Secondary/Tertiary bg usage: #111d35 #162040 #e07068 */
.content-section:nth-of-type(even) {
    background: rgba(17,29,53,0.3); /* #111d35 */
    border-left: 2px solid #162040;
}

.content-section h2 .accent {
    color: #e07068;
}

.section-right {
    margin-left: 45vw;
    width: 42vw;
    margin-top: 14vh;
    transform: translateX(40px);
}
.section-right::before {
    top: -30px;
    left: -100px;
}

.section-wide {
    margin-left: 5vw;
    width: 55vw;
    margin-top: 5vh;
    transform: translateX(-40px);
}
.section-wide::before {
    bottom: -60px;
    right: -60px;
    top: auto;
}

.section-left-far {
    margin-left: 55vw;
    width: 35vw;
    margin-top: 20vh;
    transform: translateX(40px);
}
.section-left-far::before {
    top: -40px;
    left: -120px;
}

/* === Spray Zones === */
.spray-zone {
    position: relative;
    z-index: 4;
    width: 100%;
    height: 200px;
    margin: 6vh 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.spray-zone svg {
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

.spray-label {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.4rem;
    color: #c8a96e;
    opacity: 0.4;
    transform: rotate(-2deg);
}

/* === Convergence Footer === */
.convergence {
    position: relative;
    z-index: 5;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 10vh;
    padding: 4rem 2rem;
}

.convergence-content {
    max-width: 600px;
}

.convergence h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, #c0cfe0, #4a7fff, #c0cfe0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
}

.convergence-text {
    color: #8b95a8;
    font-size: 1.15rem;
    line-height: 1.85;
    margin-bottom: 3rem;
}

.convergence-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4a7fff;
    margin: 0 auto 2rem;
    box-shadow: 0 0 30px rgba(74,127,255,0.6), 0 0 60px rgba(74,127,255,0.3);
    animation: glowPulse 2s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from { box-shadow: 0 0 30px rgba(74,127,255,0.6), 0 0 60px rgba(74,127,255,0.3); }
    to { box-shadow: 0 0 50px rgba(74,127,255,0.8), 0 0 100px rgba(74,127,255,0.4); }
}

.convergence-domain {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.2rem;
    color: #c8a96e;
}

/* === Ripple Click Effect === */
.click-ripple {
    position: fixed;
    border-radius: 50%;
    border: 2px solid rgba(74,127,255,0.4);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) scale(0);
    animation: clickRipple 0.6s ease-out forwards;
}

@keyframes clickRipple {
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
        width: 300px;
        height: 300px;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .content-section {
        margin-left: 5vw !important;
        width: 90vw !important;
    }

    .letter {
        --offset: calc(var(--offset) * 0.5) !important;
    }

    .hero-title {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .spray-zone {
        height: 120px;
    }

    .compass-menu a {
        transform: rotate(var(--angle)) translateX(70px) rotate(calc(-1 * var(--angle)));
        font-size: 0.85rem;
    }
}
