/* ============================================================
   monopole.boo - Fairycore Particle Physics
   Analogous Aurora Palette | Serif-Revival Typography
   ============================================================ */

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: #1a1333;
}
::-webkit-scrollbar-thumb {
    background: #8b6cc7;
    border-radius: 2px;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #8b6cc7 #1a1333;
}

body {
    background-color: #0d0a1a;
    color: #e8e0f0;
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Vertical Spine --- */
#spine {
    position: fixed;
    left: 38.2%;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: #b8a9c9;
    z-index: 5;
    animation: spine-pulse 4s ease-in-out infinite;
}

@keyframes spine-pulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.35; }
}

/* --- Navigation Orbs --- */
#nav-orbs {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.nav-orb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #c5b4e3;
    box-shadow: 0 0 8px 2px rgba(197, 180, 227, 0.5);
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease;
    position: relative;
}

.nav-orb:hover {
    transform: scale(1.4);
    box-shadow: 0 0 16px 4px rgba(197, 180, 227, 0.7);
}

.nav-orb.active {
    background-color: #7ee8c7;
    box-shadow: 0 0 10px 3px rgba(126, 232, 199, 0.5);
}

.nav-label {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.95rem;
    color: #e8e0f0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.nav-orb:hover .nav-label {
    opacity: 1;
}

/* --- Bokeh Particle Field --- */
#bokeh-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.bokeh-particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
}

/* Foreground particles - slightly blurred for depth */
.bokeh-particle.foreground {
    filter: blur(1px);
}

/* Particle color classes */
.bokeh-violet {
    background-color: #8b6cc7;
}
.bokeh-pink {
    background-color: #d4a0c7;
}
.bokeh-mint {
    background-color: #7ee8c7;
}
.bokeh-amber {
    background-color: #e8c874;
}

/* Bokeh particle animations - 12 unique drift paths */
@keyframes drift-1 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.6; }
    50% { transform: translate(80px, -120px); opacity: 0.4; }
    90% { opacity: 0.6; }
    100% { transform: translate(160px, -40px); opacity: 0; }
}
@keyframes drift-2 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.5; }
    50% { transform: translate(-100px, -80px); opacity: 0.35; }
    90% { opacity: 0.5; }
    100% { transform: translate(-60px, -200px); opacity: 0; }
}
@keyframes drift-3 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.45; }
    50% { transform: translate(50px, 100px); opacity: 0.3; }
    90% { opacity: 0.45; }
    100% { transform: translate(-30px, 180px); opacity: 0; }
}
@keyframes drift-4 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.55; }
    50% { transform: translate(-70px, 60px); opacity: 0.4; }
    90% { opacity: 0.55; }
    100% { transform: translate(40px, 140px); opacity: 0; }
}
@keyframes drift-5 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.5; }
    50% { transform: translate(120px, 40px); opacity: 0.35; }
    90% { opacity: 0.5; }
    100% { transform: translate(90px, -60px); opacity: 0; }
}
@keyframes drift-6 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.4; }
    50% { transform: translate(-40px, -150px); opacity: 0.25; }
    90% { opacity: 0.4; }
    100% { transform: translate(70px, -90px); opacity: 0; }
}
@keyframes drift-7 {
    0% { transform: translate(0, 0); opacity: 0; }
    15% { opacity: 0.5; }
    50% { transform: translate(60px, 80px); opacity: 0.35; }
    85% { opacity: 0.5; }
    100% { transform: translate(-50px, 50px); opacity: 0; }
}
@keyframes drift-8 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.45; }
    50% { transform: translate(-90px, -30px); opacity: 0.3; }
    90% { opacity: 0.45; }
    100% { transform: translate(-150px, 80px); opacity: 0; }
}
@keyframes drift-9 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.55; }
    50% { transform: translate(30px, -90px); opacity: 0.35; }
    90% { opacity: 0.55; }
    100% { transform: translate(110px, -180px); opacity: 0; }
}
@keyframes drift-10 {
    0% { transform: translate(0, 0); opacity: 0; }
    15% { opacity: 0.4; }
    50% { transform: translate(-60px, 120px); opacity: 0.25; }
    85% { opacity: 0.4; }
    100% { transform: translate(20px, 60px); opacity: 0; }
}
@keyframes drift-11 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.5; }
    50% { transform: translate(100px, -50px); opacity: 0.3; }
    90% { opacity: 0.5; }
    100% { transform: translate(-20px, -120px); opacity: 0; }
}
@keyframes drift-12 {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.45; }
    50% { transform: translate(-80px, 90px); opacity: 0.3; }
    90% { opacity: 0.45; }
    100% { transform: translate(50px, 160px); opacity: 0; }
}

/* --- Section 0: Aurora Canopy --- */
.aurora-canopy {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    z-index: 3;
    background: radial-gradient(ellipse at 38% 38%, #1a1333 0%, #0d0a1a 70%);
}

.aurora-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    pointer-events: none;
}

.aurora-layer-1 {
    background: linear-gradient(135deg, #8b6cc7 0%, #7ee8c7 100%);
    opacity: 0.1;
    animation: aurora-shift-1 20s ease-in-out infinite;
}

.aurora-layer-2 {
    background: radial-gradient(ellipse at 50% 50%, #d4a0c7, transparent 70%);
    opacity: 0.06;
    animation: aurora-shift-2 15s ease-in-out infinite;
}

@keyframes aurora-shift-1 {
    0% { transform: translateX(0); }
    50% { transform: translateX(-25%); }
    100% { transform: translateX(0); }
}

@keyframes aurora-shift-2 {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.canopy-content {
    position: relative;
    z-index: 10;
    padding-left: 38.2%;
    padding-top: 38.2vh;
    transform: translateX(-50%);
}

.domain-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 6.5rem);
    letter-spacing: 0.06em;
    color: #e8e0f0;
    line-height: 1.1;
    opacity: 0;
}

.domain-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 100ms ease, transform 100ms ease;
}

.domain-title .letter.visible {
    opacity: 1;
    transform: translateY(0);
}

.tagline {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #a99fbd;
    margin-top: 1.2rem;
    opacity: 0;
    transition: opacity 600ms ease;
    max-width: 42em;
}

.tagline.visible {
    opacity: 1;
}

/* --- Discovery Nodes --- */
.discovery-node {
    position: relative;
    padding: 20vh 0;
    z-index: 3;
}

.bloom-trigger {
    position: absolute;
    left: 38.2%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #8b6cc7;
    box-shadow: 0 0 12px 4px rgba(126, 232, 199, 0.4);
    z-index: 10;
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.bloom-trigger.blooming {
    transform: translate(-50%, -50%) scale(2);
    box-shadow: 0 0 24px 8px rgba(126, 232, 199, 0.6);
}

.node-content {
    margin-left: 38.2%;
    padding-left: 3rem;
    padding-right: 10%;
    max-width: 62%;
    opacity: 0;
    clip-path: circle(4px at 0% 50%);
    transition: clip-path 600ms cubic-bezier(0.16, 1, 0.3, 1), opacity 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.node-content.revealed {
    opacity: 1;
    clip-path: circle(150% at 0% 50%);
}

/* Section 1: Text flows in from left */
.node-content-1 .section-heading,
.node-content-1 .body-text {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.node-content-1.revealed .section-heading {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0ms;
}

.node-content-1.revealed .body-text:nth-of-type(1) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 30ms;
}

.node-content-1.revealed .body-text:nth-of-type(2) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 60ms;
}

/* Section 2: Content fades in with aurora line above */
.node-content-2 .section-heading,
.node-content-2 .body-text {
    opacity: 0;
    transition: opacity 500ms ease;
}

.node-content-2.revealed .section-heading {
    opacity: 1;
    transition-delay: 200ms;
}

.node-content-2.revealed .body-text:nth-of-type(1) {
    opacity: 1;
    transition-delay: 350ms;
}

.node-content-2.revealed .body-text:nth-of-type(2) {
    opacity: 1;
    transition-delay: 500ms;
}

/* Section 3: Focus-pull blur effect */
.node-content-3 .section-heading,
.node-content-3 .body-text {
    opacity: 0;
    filter: blur(4px);
    transition: opacity 500ms ease, filter 500ms ease;
}

.node-content-3.revealed .section-heading {
    opacity: 1;
    filter: blur(0);
    transition-delay: 0ms;
}

.node-content-3.revealed .body-text:nth-of-type(1) {
    opacity: 1;
    filter: blur(0);
    transition-delay: 150ms;
}

.node-content-3.revealed .body-text:nth-of-type(2) {
    opacity: 1;
    filter: blur(0);
    transition-delay: 300ms;
}

.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 3rem);
    letter-spacing: 0.04em;
    color: #e8e0f0;
    margin-bottom: 1.5rem;
}

.body-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: #e8e0f0;
    max-width: 42em;
    margin-bottom: 1.2rem;
}

.body-text a {
    color: #d4a0c7;
    text-decoration: none;
    background-image: linear-gradient(#d4a0c7, #d4a0c7);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 300ms ease;
}

.body-text a:hover {
    background-size: 100% 1px;
}

/* --- Aurora Separators --- */
.aurora-separator {
    display: block;
    width: 100%;
    height: 60px;
    position: relative;
    z-index: 3;
    overflow: visible;
}

.aurora-path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    transition: stroke-dashoffset 2s ease;
}

.aurora-separator.drawn .aurora-path {
    stroke-dashoffset: 0;
}

/* --- Section 4: Convergence --- */
.convergence-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    padding: 10vh 0;
    background: linear-gradient(135deg, rgba(139, 108, 199, 0.08) 0%, rgba(212, 160, 199, 0.08) 40%, rgba(126, 232, 199, 0.08) 100%);
}

.convergence-content {
    width: 100%;
    max-width: 480px;
    text-align: center;
    padding: 0 2rem;
    opacity: 0;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 1200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 1200ms ease;
}

.convergence-content.revealed {
    opacity: 1;
    clip-path: circle(150% at 50% 50%);
}

.monopole-diagram {
    display: block;
    width: 280px;
    height: 280px;
    margin: 0 auto 3rem;
}

.field-line {
    opacity: 0;
    transition: opacity 800ms ease;
}

.convergence-content.revealed .field-line {
    opacity: 0.6;
}

.convergence-content.revealed .field-line:nth-child(n+12) {
    opacity: 0.35;
}

.field-dot {
    opacity: 0;
    transition: opacity 600ms ease;
}

.convergence-content.revealed .field-dot {
    opacity: 0.5;
    transition-delay: 400ms;
}

.convergence-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.04em;
    color: #e8e0f0;
    margin-bottom: 2rem;
}

.convergence-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: #e8e0f0;
    margin-bottom: 1.5rem;
}

.convergence-caption {
    font-family: 'Petrona', serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #b8a9c9;
    margin-top: 3rem;
}

/* --- Tertiary Text (Petrona) --- */
.caption-text {
    font-family: 'Petrona', serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #b8a9c9;
}

/* --- Mobile Responsive (< 768px) --- */
@media (max-width: 768px) {
    #spine {
        display: none;
    }

    #nav-orbs {
        top: auto;
        bottom: 16px;
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 16px;
    }

    .nav-label {
        display: none;
    }

    .canopy-content {
        padding-left: 8%;
        padding-right: 8%;
        padding-top: 30vh;
        transform: none;
    }

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

    .node-content {
        margin-left: 0;
        padding-left: 8%;
        padding-right: 8%;
        max-width: 100%;
        clip-path: none;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 600ms ease, transform 600ms ease;
    }

    .node-content.revealed {
        opacity: 1;
        transform: translateY(0);
        clip-path: none;
    }

    .bloom-trigger {
        left: 8%;
    }

    .discovery-node {
        padding: 12vh 0;
    }

    .convergence-content {
        clip-path: none;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 800ms ease, transform 800ms ease;
    }

    .convergence-content.revealed {
        clip-path: none;
        opacity: 1;
        transform: translateY(0);
    }

    .monopole-diagram {
        width: 200px;
        height: 200px;
    }
}
