/* continuum.quest — Design System Styles */

:root {
    /* Colors — Analogous Spectrum */
    --void-indigo: #0d1117;
    --deep-obsidian: #161b22;
    --spectral-white: #e8eaf6;
    --phase-gray: #90a4ae;
    --deep-slate: #546e7a;
    --continuum-rose: #c2185b;
    --shift-violet: #7c4dff;
    --horizon-magenta: #ad1457;
    --plasma-blue: #448aff;
    --quanta-pink: #f48fb1;
}

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

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

body {
    background: var(--void-indigo);
    color: var(--spectral-white);
    font-family: 'Source Serif 4', Georgia, serif;
    overflow-x: hidden;
}

/* ========== PROGRESS INDICATOR ========== */

#progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background: var(--continuum-rose);
    z-index: 1000;
    transition: height 0.1s linear;
}

/* ========== CURSOR BLOB ========== */

#cursor-blob {
    position: fixed;
    width: 200px;
    height: 200px;
    background: rgba(244, 143, 177, 0.06);
    border-radius: 42% 58% 63% 37% / 54% 39% 61% 46%;
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), left 0.5s cubic-bezier(0.23, 1, 0.32, 1), top 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

/* ========== PHASES / SECTIONS ========== */

.phase {
    position: relative;
    min-height: 100vh;
    overflow: visible;
}

.phase-dark {
    background: var(--void-indigo);
}

.phase-obsidian {
    background: var(--deep-obsidian);
}

.phase-content {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 24px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    min-height: 100vh;
    align-content: center;
}

/* Grid variations per section */
.grid-origin {
    padding-left: 40px;
}

.grid-expansion {
    padding-left: calc(40px + 96px);
}

.grid-intersection {
    padding-left: 40px;
}

.grid-convergence {
    padding-left: calc(40px + 96px);
}

.grid-horizon {
    padding-left: 40px;
}

/* ========== TEXT BLOCKS ========== */

.text-block {
    position: relative;
    z-index: 10;
    grid-column: 2 / 9;
}

.text-block[data-col="2/8"] { grid-column: 2 / 8; }
.text-block[data-col="3/10"] { grid-column: 3 / 10; }
.text-block[data-col="1/6"] { grid-column: 1 / 6; }
.text-block[data-col="8/13"] { grid-column: 8 / 13; }
.text-block[data-col="4/11"] { grid-column: 4 / 11; }

/* ========== TYPOGRAPHY ========== */

.title-display {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: -0.03em;
    line-height: 0.92;
    color: var(--spectral-white);
    margin-bottom: 40px;
}

.title-secondary {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 500;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.08em;
    color: var(--continuum-rose);
    margin-bottom: 24px;
}

.body-serif {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: var(--phase-gray);
    margin-bottom: 24px;
}

.body-serif:last-child {
    margin-bottom: 0;
}

.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--deep-slate);
    margin-top: 40px;
    display: block;
}

/* ========== DIAGONAL SLASH ========== */

.diagonal-slash {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 8vh;
    z-index: 5;
    clip-path: polygon(0 0, 100% 60%, 100% 100%, 0 100%);
    background: rgba(194, 24, 91, 0.15);
    pointer-events: none;
}

.phase-obsidian .diagonal-slash {
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
}

/* ========== BLOBS ========== */

.blob {
    position: absolute;
    width: var(--blob-size, 300px);
    height: var(--blob-size, 300px);
    left: var(--blob-x, 50%);
    top: var(--blob-y, 50%);
    transform: translate(-50%, -50%);
    border-radius: 42% 58% 63% 37% / 54% 39% 61% 46%;
    pointer-events: none;
    z-index: 1;
    will-change: transform, border-radius;
    animation: blobDrift var(--blob-duration, 60s) ease-in-out infinite;
}

.blob-primary {
    background: rgba(124, 77, 255, 0.04);
    border: 1px solid rgba(124, 77, 255, 0.12);
}

.blob-secondary {
    background: rgba(194, 24, 91, 0.03);
    border: none;
    animation-duration: var(--blob-duration, 30s);
}

.blob-horizon {
    background: rgba(124, 77, 255, 0.02);
    border: 1px solid rgba(124, 77, 255, 0.05);
}

.blob-interaction {
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(244, 143, 177, 0.06);
    border-radius: 50% 42% 58% 37% / 46% 54% 39% 61%;
    pointer-events: none;
    z-index: 2;
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

@keyframes blobDrift {
    0% {
        border-radius: 42% 58% 63% 37% / 54% 39% 61% 46%;
        transform: translate(-50%, -50%) translate(0, 0);
    }
    25% {
        border-radius: 55% 45% 50% 50% / 48% 52% 48% 52%;
        transform: translate(-50%, -50%) translate(10px, -15px);
    }
    50% {
        border-radius: 58% 42% 37% 63% / 46% 61% 39% 54%;
        transform: translate(-50%, -50%) translate(15px, -20px);
    }
    75% {
        border-radius: 45% 55% 52% 48% / 52% 48% 55% 45%;
        transform: translate(-50%, -50%) translate(-10px, -5px);
    }
    100% {
        border-radius: 42% 58% 63% 37% / 54% 39% 61% 46%;
        transform: translate(-50%, -50%) translate(0, 0);
    }
}

/* ========== AXIS MARKERS ========== */

.axis-marker {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.axis-v {
    width: 0.5px;
    background: rgba(84, 110, 122, 0.4);
}

.axis-h {
    height: 0.5px;
    background: rgba(84, 110, 122, 0.4);
}

/* ========== SVG DIAGRAMS ========== */

.svg-diagram {
    position: relative;
    z-index: 5;
    grid-column: 1 / -1;
    overflow: visible;
}

.continuum-line {
    width: 100%;
    height: 200px;
    margin-top: 64px;
}

.diverging-rays {
    width: 50%;
    max-width: 600px;
    height: auto;
    margin-top: 64px;
    grid-column: 4 / 10;
}

.phase-transition {
    width: 300px;
    height: 300px;
    grid-column: 6 / 8;
    justify-self: center;
    margin-top: 40px;
}

.converging-lines {
    width: 60%;
    max-width: 600px;
    height: auto;
    margin-top: 64px;
    grid-column: 4 / 10;
}

.infinite-line {
    position: absolute;
    bottom: 30%;
    left: 0;
    width: 100%;
    height: 10px;
    grid-column: 1 / -1;
}

.svg-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.svg-path.animated {
    stroke-dashoffset: 0;
}

.ray {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

.ray.animated {
    stroke-dashoffset: 0;
    transition-delay: var(--ray-delay, 0ms);
}

.svg-path-secondary {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.svg-path-secondary.animated {
    stroke-dashoffset: 0;
    transition-delay: 300ms;
}

/* ========== REVEAL ANIMATIONS ========== */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== HORIZON CENTER ========== */

.horizon-center {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.infinity-symbol {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(6rem, 15vw, 14rem);
    color: var(--continuum-rose);
    line-height: 1;
    display: block;
    margin-bottom: 40px;
}

.horizon-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.horizon-meta .annotation {
    margin-top: 0;
}

/* ========== INFINITE LINE ANIMATION ========== */

#infinite-line-path {
    stroke-dasharray: 1440;
    stroke-dashoffset: 1440;
    animation: infiniteDraw 8s linear infinite;
}

@keyframes infiniteDraw {
    0% {
        stroke-dashoffset: 1440;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
    .phase-content {
        padding: 0 24px;
    }

    .grid-expansion,
    .grid-convergence {
        padding-left: 24px;
    }

    .text-block[data-col="2/8"],
    .text-block[data-col="3/10"],
    .text-block[data-col="4/11"] {
        grid-column: 1 / -1;
    }

    .text-block[data-col="1/6"],
    .text-block[data-col="8/13"] {
        grid-column: 1 / -1;
    }

    .diverging-rays,
    .converging-lines {
        grid-column: 1 / -1;
        width: 100%;
    }

    .phase-transition {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .title-display {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .infinity-symbol {
        font-size: clamp(4rem, 20vw, 10rem);
    }

    .blob {
        opacity: 0.5;
    }

    #cursor-blob {
        display: none;
    }
}
