/* opensource.day - Evolved Minimal / Zen Contemplative */

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

:root {
    --abyssal-midnight: #0a0e1a;
    --nautical-dusk: #0f1628;
    --deep-indigo: #162040;
    --lunar-bone: #c8cdd8;
    --slate-whisper: #6b7a9a;
    --bioluminescent-blue: #4a8cc8;
    --phosphor-white: #d4e4f8;
    --faded-cerulean: #2a5a8a;
    --deep-amber: #c89a4a;
    --mono-muted: #3a4a6b;
    --bg-r: 15;
    --bg-g: 22;
    --bg-b: 40;
}

html {
    scroll-behavior: auto;
}

body {
    background: rgb(var(--bg-r), var(--bg-g), var(--bg-b));
    color: var(--lunar-bone);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-optical-sizing: auto;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Particle canvas - fixed behind everything */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Chambers */
.chamber {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 600ms ease;
}

/* Chamber 1: 100vh */
#chamber-1 {
    min-height: 100vh;
}

/* Chamber 2: 120vh (100vh-220vh range) */
#chamber-2 {
    min-height: 120vh;
    position: relative;
    overflow: hidden;
    align-items: flex-start;
}

/* Chamber 3: 120vh (220vh-340vh range) */
#chamber-3 {
    min-height: 120vh;
    position: relative;
}

/* Chamber 4: 100vh (340vh-440vh range) */
#chamber-4 {
    min-height: 100vh;
    background: transparent;
}

/* Chamber 5: 80vh (440vh-520vh range) */
#chamber-5 {
    min-height: 80vh;
}

/* Chamber 1: The Threshold */
.threshold-content {
    text-align: center;
}

.domain-name {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 300;
    font-variation-settings: 'opsz' 48;
    color: var(--lunar-bone);
    letter-spacing: 0.05em;
    opacity: 0;
    animation: threshold-fade 3s ease-out 0.5s forwards;
}

@keyframes threshold-fade {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chamber 2: The Current */
.dot-grid {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 0;
    will-change: transform;
    background-image: radial-gradient(circle, var(--deep-indigo) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.6;
}

.current-content {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    max-width: 600px;
    margin-left: 8vw;
    align-self: flex-start;
    padding-top: 15vh;
}

.reveal-line {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-variation-settings: 'opsz' 14;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 3rem;
    color: var(--lunar-bone);
    max-width: 45ch;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

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

/* Chamber 3: The Constellation */
.constellation-content {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.constellation-label {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    pointer-events: none;
}

.constellation-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-variation-settings: 'opsz' 14;
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: var(--slate-whisper);
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1000ms ease-out, transform 1000ms ease-out;
}

.constellation-text.visible {
    opacity: 0.6;
    transform: translateY(0);
}

/* Chamber 4: The Offering */
.offering-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2rem;
    width: 100%;
}

.koan {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--lunar-bone);
    text-align: center;
    max-width: 32ch;
    padding: 20vh 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.koan:first-child {
    padding-top: 10vh;
}

.koan:last-child {
    padding-bottom: 10vh;
}

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

/* Chamber 5: The Return */
.return-content {
    text-align: center;
}

.the-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--deep-amber);
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1200ms ease-out, transform 1200ms ease-out;
}

.the-date.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Source link */
.source-link {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 10px;
    color: var(--mono-muted);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 400ms ease;
}

.source-link:hover {
    opacity: 1;
    color: var(--slate-whisper);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 2px;
}

::-webkit-scrollbar-track {
    background: var(--abyssal-midnight);
}

::-webkit-scrollbar-thumb {
    background: var(--deep-indigo);
}

/* Selection */
::selection {
    background: var(--faded-cerulean);
    color: var(--phosphor-white);
}
