/* ==========================================================================
   monopole.cloud — Avant-Garde Timeline Observatory
   ========================================================================== */

/* --- CSS Custom Properties (Design Colors) --- */
:root {
    --color-deep-slate: #2A2A3A;
    --color-medium-slate: #5A5A6A;
    --color-timeline-grey: #8A8A9A;
    --color-cloud-form: #D0D0D8;
    --color-muted-canvas: #F2F2F6;
    --color-sharp-line: #4A4A5A;
    --color-node-accent: #6A7A9A;

    --font-display: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;

    --duration-kinetic: 0.8s;
    --duration-reveal: 0.7s;
    --duration-expand: 0.5s;
    --easing-kinetic: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
    background-color: var(--color-muted-canvas);
    color: var(--color-medium-slate);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--color-deep-slate);
    font-weight: 700;
    line-height: 1.2;
}

.kinetic-text {
    transform: scale(0.8);
    opacity: 0;
    transition: transform var(--duration-kinetic) var(--easing-kinetic),
                opacity var(--duration-kinetic) var(--easing-kinetic);
    will-change: transform, opacity;
}

.kinetic-text.revealed {
    transform: scale(1);
    opacity: 1;
}

/* --- 3D Cloud Forms (Decorative Background) --- */
.cloud-forms {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    transform: perspective(800px) rotateX(10deg);
    opacity: 0.35;
    transition: transform 4s ease;
    will-change: transform;
}

.cloud-blob {
    position: absolute;
    background: var(--color-cloud-form);
    border-radius: 50%;
}

/* Cloud 1 — top-right area */
.cloud-1 {
    top: 8%;
    right: 5%;
    width: 280px;
    height: 140px;
}

.cloud-1 .cloud-blob:nth-child(1) {
    width: 120px;
    height: 120px;
    top: 20px;
    left: 0;
}

.cloud-1 .cloud-blob:nth-child(2) {
    width: 160px;
    height: 140px;
    top: 0;
    left: 60px;
}

.cloud-1 .cloud-blob:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 30px;
    left: 160px;
}

.cloud-1 .cloud-blob:nth-child(4) {
    width: 80px;
    height: 80px;
    top: 40px;
    left: 200px;
}

/* Cloud 2 — left area */
.cloud-2 {
    top: 35%;
    left: 3%;
    width: 220px;
    height: 110px;
}

.cloud-2 .cloud-blob:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10px;
    left: 0;
}

.cloud-2 .cloud-blob:nth-child(2) {
    width: 130px;
    height: 110px;
    top: 0;
    left: 50px;
}

.cloud-2 .cloud-blob:nth-child(3) {
    width: 90px;
    height: 90px;
    top: 20px;
    left: 120px;
}

/* Cloud 3 — bottom-right */
.cloud-3 {
    top: 60%;
    right: 8%;
    width: 320px;
    height: 160px;
}

.cloud-3 .cloud-blob:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 50px;
    left: 0;
}

.cloud-3 .cloud-blob:nth-child(2) {
    width: 140px;
    height: 140px;
    top: 10px;
    left: 50px;
}

.cloud-3 .cloud-blob:nth-child(3) {
    width: 160px;
    height: 160px;
    top: 0;
    left: 100px;
}

.cloud-3 .cloud-blob:nth-child(4) {
    width: 110px;
    height: 110px;
    top: 30px;
    left: 200px;
}

.cloud-3 .cloud-blob:nth-child(5) {
    width: 80px;
    height: 80px;
    top: 60px;
    left: 250px;
}

/* Cloud 4 — lower-left */
.cloud-4 {
    top: 82%;
    left: 6%;
    width: 200px;
    height: 100px;
}

.cloud-4 .cloud-blob:nth-child(1) {
    width: 90px;
    height: 90px;
    top: 10px;
    left: 0;
}

.cloud-4 .cloud-blob:nth-child(2) {
    width: 120px;
    height: 100px;
    top: 0;
    left: 40px;
}

.cloud-4 .cloud-blob:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 20px;
    left: 110px;
}

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

.hero-inner {
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--color-deep-slate);
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    transform: scale(0.8);
    opacity: 0;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    color: var(--color-timeline-grey);
    letter-spacing: 0.3em;
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 1.2s ease 0.6s;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 1s ease 1.2s;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-indicator-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-timeline-grey);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.scroll-indicator-line {
    width: 1px;
    height: 40px;
    background: var(--color-timeline-grey);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 0.4; }
    50% { transform: scaleY(1.5); opacity: 1; }
}

/* --- Timeline Container --- */
.timeline-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 2rem 10rem;
    z-index: 1;
}

/* Timeline Spine */
.timeline-spine {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--color-timeline-grey);
    transform: translateX(-50%) scaleY(0);
    transform-origin: top center;
    transition: transform 1.5s var(--easing-kinetic);
    will-change: transform;
}

.timeline-spine.drawn {
    transform: translateX(-50%) scaleY(1);
}

/* --- Timeline Nodes --- */
.timeline-node {
    position: relative;
    width: 45%;
    margin-bottom: 6rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--duration-reveal) ease, transform var(--duration-reveal) ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Left nodes */
.node-left {
    margin-right: auto;
    margin-left: 2%;
    text-align: right;
}

/* Right nodes */
.node-right {
    margin-left: auto;
    margin-right: 2%;
    text-align: left;
}

/* Node Dot on the spine */
.node-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--color-muted-canvas);
    border: 2px solid var(--color-timeline-grey);
    border-radius: 50%;
    top: 0.5rem;
    z-index: 2;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.node-left .node-dot {
    right: -9.5%;
    transform: translateX(50%);
}

.node-right .node-dot {
    left: -9.5%;
    transform: translateX(-50%);
}

.timeline-node.active .node-dot {
    background: var(--color-node-accent);
    border-color: var(--color-node-accent);
    transform: translateX(50%) scale(1.3);
}

.node-right.active .node-dot {
    transform: translateX(-50%) scale(1.3);
}

/* Sharp Angle Connector — 45-degree diagonal */
.node-connector {
    position: absolute;
    width: 50px;
    height: 2px;
    background: var(--color-sharp-line);
    top: 0.85rem;
    z-index: 1;
}

.node-left .node-connector {
    right: -7.5%;
    transform: rotate(-45deg);
    transform-origin: right center;
}

.node-right .node-connector {
    left: -7.5%;
    transform: rotate(45deg);
    transform-origin: left center;
}

/* Node Label (timestamp) */
.node-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-timeline-grey);
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

/* Node Content */
.node-content {
    cursor: pointer;
}

.node-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: var(--color-deep-slate);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.timeline-node.active .node-title {
    color: var(--color-node-accent);
}

/* Progressive Disclosure — collapsed by default */
.node-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-expand) var(--easing-kinetic),
                opacity 0.4s ease;
    opacity: 0;
}

.timeline-node.expanded .node-body {
    max-height: 300px;
    opacity: 1;
}

.node-body p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    color: var(--color-medium-slate);
    line-height: 1.85;
    padding-top: 0.5rem;
}

/* --- Closing Section --- */
.closing {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 4rem 2rem;
}

.closing-inner {
    text-align: center;
    max-width: 700px;
}

.closing-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    color: var(--color-deep-slate);
    line-height: 1.4;
    margin-bottom: 2rem;
}

.closing-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-timeline-grey);
    letter-spacing: 0.25em;
    text-transform: lowercase;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .timeline-container {
        padding: 4rem 1.5rem 8rem;
    }

    .timeline-spine {
        left: 1.5rem;
    }

    .timeline-node {
        width: calc(100% - 4rem);
        margin-left: 3.5rem;
        margin-right: 0;
        text-align: left;
    }

    .node-left,
    .node-right {
        margin-left: 3.5rem;
        margin-right: 0;
        text-align: left;
    }

    .node-dot {
        left: -2.5rem;
        right: auto;
        transform: translateX(-50%);
    }

    .node-left .node-dot {
        right: auto;
        left: -2.5rem;
        transform: translateX(-50%);
    }

    .node-right .node-dot {
        left: -2.5rem;
        transform: translateX(-50%);
    }

    .timeline-node.active .node-dot,
    .node-left.active .node-dot {
        transform: translateX(-50%) scale(1.3);
    }

    .node-right.active .node-dot {
        transform: translateX(-50%) scale(1.3);
    }

    .node-connector {
        display: none;
    }

    .cloud-1 {
        width: 160px;
        height: 80px;
    }

    .cloud-3 {
        width: 180px;
        height: 90px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        letter-spacing: 0.08em;
    }

    .timeline-node {
        margin-bottom: 4rem;
    }

    .closing-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }
}
