/* ringworld.quest — Contemplative Monument to Megastructure Engineering */

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

:root {
    --void-obsidian: #0C0A08;
    --deep-basalt: #1A1712;
    --ringworld-gold: #D4A94B;
    --tarnished-aureate: #A68832;
    --dust-marble: #C9C0B0;
    --eroded-stone: #8A7D6A;
    --carrara-vein: #F0EDE6;
    --calacatta-gold: #E8D5B4;
    --stone-gray: #B5AFA5;
    --basalt-dark: #2A2520;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-obsidian);
    color: var(--dust-marble);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.75;
    overflow-x: hidden;
}

.column {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* =====================
   WATER BUBBLE PARTICLES
   ===================== */
#bubble-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(212, 169, 75, 0.15), rgba(212, 169, 75, 0.05));
    bottom: -30px;
    animation: bubble-rise linear infinite;
}

.b1  { width: 8px;  height: 8px;  left: 5%;   animation-duration: 35s; animation-delay: 0s; }
.b2  { width: 16px; height: 16px; left: 12%;  animation-duration: 42s; animation-delay: 3s; }
.b3  { width: 6px;  height: 6px;  left: 22%;  animation-duration: 28s; animation-delay: 8s; }
.b4  { width: 20px; height: 20px; left: 33%;  animation-duration: 55s; animation-delay: 2s; }
.b5  { width: 10px; height: 10px; left: 41%;  animation-duration: 38s; animation-delay: 12s; }
.b6  { width: 14px; height: 14px; left: 55%;  animation-duration: 45s; animation-delay: 5s; }
.b7  { width: 24px; height: 24px; left: 63%;  animation-duration: 60s; animation-delay: 0s; }
.b8  { width: 8px;  height: 8px;  left: 72%;  animation-duration: 32s; animation-delay: 7s; }
.b9  { width: 12px; height: 12px; left: 80%;  animation-duration: 48s; animation-delay: 10s; }
.b10 { width: 6px;  height: 6px;  left: 88%;  animation-duration: 36s; animation-delay: 15s; }
.b11 { width: 18px; height: 18px; left: 95%;  animation-duration: 50s; animation-delay: 4s; }
.b12 { width: 4px;  height: 4px;  left: 48%;  animation-duration: 25s; animation-delay: 18s; }
.b13 { width: 10px; height: 10px; left: 17%;  animation-duration: 40s; animation-delay: 9s; }
.b14 { width: 14px; height: 14px; left: 76%;  animation-duration: 52s; animation-delay: 1s; }
.b15 { width: 8px;  height: 8px;  left: 35%;  animation-duration: 30s; animation-delay: 14s; }

@keyframes bubble-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(-110vh) scale(1.15);
        opacity: 0;
    }
}

/* =====================
   OPENING: THE VOID
   ===================== */
#void-opening {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.void-content {
    text-align: center;
}

#ring-arc {
    width: 60vw;
    max-width: 600px;
    height: auto;
    opacity: 0;
    animation: fade-in-slow 1.5s ease-out 0.5s forwards;
}

#site-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.12em;
    color: var(--dust-marble);
    margin-top: 2rem;
    opacity: 0;
    animation: fade-in-slow 1.5s ease-out 1.2s forwards;
}

#scroll-chevron {
    margin-top: 4rem;
    opacity: 0;
    animation: fade-in-slow 1s ease-out 2s forwards, pulse-attention 6s ease-in-out 3s infinite;
}

@keyframes fade-in-slow {
    to { opacity: 1; }
}

@keyframes pulse-attention {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* =====================
   TYPOGRAPHY
   ===================== */
h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    letter-spacing: 0.08em;
    color: var(--ringworld-gold);
    margin-bottom: 2rem;
    line-height: 1.2;
}

p {
    margin-bottom: 1.5rem;
}

/* =====================
   FADE-IN ELEMENTS
   ===================== */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =====================
   INSCRIPTION MARKS
   ===================== */
.inscription-mark {
    margin-bottom: 2.5rem;
    opacity: 0.6;
}

/* =====================
   SECTIONS
   ===================== */
#approach {
    padding: 6rem 0 4rem;
    position: relative;
    z-index: 2;
}

#surface {
    padding: 6rem 0 4rem;
    position: relative;
    z-index: 2;
}

#final-chamber {
    padding: 6rem 0 4rem;
    position: relative;
    z-index: 2;
}

/* =====================
   MARBLE THRESHOLDS
   ===================== */
.marble-threshold {
    width: 100%;
    padding: 5rem 2rem;
    position: relative;
    z-index: 2;
    animation: pulse-marble 6s ease-in-out infinite;
}

.threshold-1 {
    background:
        repeating-linear-gradient(12deg, transparent, transparent 80px, rgba(232, 213, 180, 0.12) 80px, rgba(232, 213, 180, 0.12) 82px),
        repeating-linear-gradient(167deg, transparent, transparent 120px, rgba(181, 175, 165, 0.1) 120px, rgba(181, 175, 165, 0.1) 121px),
        repeating-linear-gradient(78deg, transparent, transparent 60px, rgba(232, 213, 180, 0.08) 60px, rgba(232, 213, 180, 0.08) 62px),
        var(--carrara-vein);
}

.threshold-2 {
    background:
        repeating-linear-gradient(22deg, transparent, transparent 100px, rgba(232, 213, 180, 0.14) 100px, rgba(232, 213, 180, 0.14) 101px),
        repeating-linear-gradient(155deg, transparent, transparent 70px, rgba(181, 175, 165, 0.09) 70px, rgba(181, 175, 165, 0.09) 72px),
        repeating-linear-gradient(90deg, transparent, transparent 90px, rgba(232, 213, 180, 0.06) 90px, rgba(232, 213, 180, 0.06) 91px),
        var(--carrara-vein);
}

.threshold-3 {
    background:
        repeating-linear-gradient(8deg, transparent, transparent 110px, rgba(232, 213, 180, 0.1) 110px, rgba(232, 213, 180, 0.1) 112px),
        repeating-linear-gradient(172deg, transparent, transparent 65px, rgba(181, 175, 165, 0.12) 65px, rgba(181, 175, 165, 0.12) 66px),
        repeating-linear-gradient(55deg, transparent, transparent 130px, rgba(232, 213, 180, 0.07) 130px, rgba(232, 213, 180, 0.07) 132px),
        var(--carrara-vein);
}

.threshold-final {
    background:
        repeating-linear-gradient(15deg, transparent, transparent 90px, rgba(232, 213, 180, 0.11) 90px, rgba(232, 213, 180, 0.11) 91px),
        repeating-linear-gradient(160deg, transparent, transparent 75px, rgba(181, 175, 165, 0.08) 75px, rgba(181, 175, 165, 0.08) 77px),
        repeating-linear-gradient(68deg, transparent, transparent 100px, rgba(232, 213, 180, 0.09) 100px, rgba(232, 213, 180, 0.09) 101px),
        var(--carrara-vein);
    width: 100%;
    padding: 5rem 2rem;
    text-align: center;
}

@keyframes pulse-marble {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.03); }
}

/* =====================
   PULL QUOTES
   ===================== */
.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.5;
    color: var(--basalt-dark);
    text-align: center;
    font-style: italic;
}

/* =====================
   RING ARC DIVIDER
   ===================== */
.ring-arc-divider {
    margin: 4rem 0;
    text-align: center;
}

.ring-arc-divider svg {
    width: 100%;
    max-width: 500px;
    height: 40px;
    opacity: 0.5;
}

/* =====================
   CENTRAL DIAGRAM
   ===================== */
#cross-section {
    padding: 4rem 0;
    position: relative;
    z-index: 2;
}

.diagram-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

#ring-diagram {
    width: 100%;
    height: auto;
}

.diagram-stroke {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease-out;
}

.diagram-stroke.drawn {
    stroke-dashoffset: 0;
}

.diagram-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    fill: var(--eroded-stone);
    text-transform: uppercase;
}

.label-fade {
    opacity: 0;
    transition: opacity 600ms ease-out;
}

.label-fade.visible {
    opacity: 1;
}

/* =====================
   CLOSING INSCRIPTION
   ===================== */
#closing-inscription {
    position: relative;
    z-index: 2;
}

.inscription-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-variant: small-caps;
    letter-spacing: 0.2em;
    color: var(--basalt-dark);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.inscription-attribution {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    letter-spacing: 0.15em;
    color: var(--eroded-stone);
    text-transform: uppercase;
}

/* =====================
   FINAL VOID
   ===================== */
#final-void {
    height: 30vh;
    background: var(--void-obsidian);
    position: relative;
    z-index: 2;
}
