/* ===========================================
   20241204.com - Retro-Futuristic Observatory
   =========================================== */

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

:root {
    --dusty-rose: #D4A59A;
    --charcoal: #4A4A4A;
    --espresso: #3D2B1F;
    --terracotta: #C8553D;
    --burnished-copper: #7A5C44;
    --parchment: #F5EDE0;
    --sage-mist: #A8BFA3;
    --dark-goldenrod: #B8860B;
    --warm-cream: #EDE3D3;
    --twilight-indigo: #6B7FA3;
    --amber-glow: #E8A838;
    --observatory-green: #2E8B6E;
    --font-display: 'Righteous', cursive;
    --font-display-alt: 'Playfair Display', serif;
    --font-body: 'Source Serif 4', serif;
    --font-accent: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', 'Space Mono', monospace;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--parchment);
    color: var(--espresso);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Typography --- */
.mono-label {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--burnished-copper);
}

.font-mono {
    font-family: var(--font-mono);
}

.body-text {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--espresso);
    max-width: 640px;
    margin: 0 auto;
}

.body-text-sm {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--charcoal);
}

/* --- Chapter Layout --- */
.chapter {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chapter-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10vh 2rem;
}

.chapter-header {
    text-align: center;
    margin-bottom: 4rem;
}

.chapter-number {
    display: block;
    margin-bottom: 1rem;
    color: var(--dark-goldenrod);
}

.chapter-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--espresso);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.chapter-body {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}

.chapter.visible .chapter-body {
    opacity: 1;
    transform: translateY(0);
}

.wireframe-divider {
    max-width: 200px;
    margin: 0 auto;
    color: var(--burnished-copper);
    opacity: 0.5;
}

.wireframe-divider svg {
    width: 100%;
    height: 2px;
}

/* --- Watercolor Backgrounds --- */
.watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

.hero-wash {
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, var(--dusty-rose) 0%, transparent 70%),
        radial-gradient(ellipse 70% 50% at 70% 60%, var(--sage-mist) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 80%, var(--twilight-indigo) 0%, transparent 70%);
    mix-blend-mode: multiply;
    filter: blur(40px);
    animation: watercolorMorph1 25s ease-in-out infinite alternate;
}

.coordinates-wash {
    background:
        radial-gradient(ellipse 70% 55% at 25% 50%, var(--dusty-rose) 0%, transparent 65%),
        radial-gradient(ellipse 65% 45% at 75% 40%, var(--amber-glow) 0%, transparent 60%);
    mix-blend-mode: multiply;
    filter: blur(50px);
    animation: watercolorMorph2 30s ease-in-out infinite alternate;
}

.observation-wash {
    background:
        radial-gradient(ellipse 75% 50% at 40% 30%, var(--sage-mist) 0%, transparent 65%),
        radial-gradient(ellipse 60% 55% at 60% 70%, var(--twilight-indigo) 0%, transparent 60%);
    mix-blend-mode: multiply;
    filter: blur(45px);
    animation: watercolorMorph3 28s ease-in-out infinite alternate;
}

.spectrum-wash {
    background:
        radial-gradient(ellipse 70% 50% at 35% 55%, var(--dusty-rose) 0%, transparent 65%),
        radial-gradient(ellipse 60% 45% at 65% 35%, var(--sage-mist) 0%, transparent 60%);
    mix-blend-mode: multiply;
    filter: blur(45px);
    animation: watercolorMorph1 22s ease-in-out infinite alternate;
}

.archive-wash {
    background:
        radial-gradient(ellipse 65% 50% at 50% 40%, var(--twilight-indigo) 0%, transparent 65%),
        radial-gradient(ellipse 70% 45% at 30% 70%, var(--dusty-rose) 0%, transparent 60%);
    mix-blend-mode: multiply;
    filter: blur(50px);
    animation: watercolorMorph2 26s ease-in-out infinite alternate;
}

.dimensions-wash {
    background:
        radial-gradient(ellipse 75% 55% at 60% 45%, var(--sage-mist) 0%, transparent 65%),
        radial-gradient(ellipse 55% 50% at 30% 60%, var(--twilight-indigo) 0%, transparent 60%);
    mix-blend-mode: multiply;
    filter: blur(45px);
    animation: watercolorMorph3 24s ease-in-out infinite alternate;
}

.colophon-wash {
    background:
        radial-gradient(ellipse 80% 60% at 50% 50%, var(--dusty-rose) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 40% 60%, var(--sage-mist) 0%, transparent 65%),
        radial-gradient(ellipse 50% 35% at 60% 40%, var(--twilight-indigo) 0%, transparent 60%);
    mix-blend-mode: multiply;
    filter: blur(50px);
    animation: watercolorMorph1 30s ease-in-out infinite alternate;
}

@keyframes watercolorMorph1 {
    0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
    33% { transform: scale(1.05) translate(2%, -1%); opacity: 0.45; }
    66% { transform: scale(0.98) translate(-1%, 2%); opacity: 0.38; }
    100% { transform: scale(1.03) translate(1%, -2%); opacity: 0.42; }
}

@keyframes watercolorMorph2 {
    0% { transform: scale(1.02) translate(1%, 1%); opacity: 0.38; }
    50% { transform: scale(0.97) translate(-2%, 1%); opacity: 0.45; }
    100% { transform: scale(1.04) translate(0%, -1%); opacity: 0.35; }
}

@keyframes watercolorMorph3 {
    0% { transform: scale(0.98) translate(-1%, -1%); opacity: 0.42; }
    50% { transform: scale(1.05) translate(2%, 0%); opacity: 0.35; }
    100% { transform: scale(1) translate(-1%, 2%); opacity: 0.4; }
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--warm-cream);
}

.hero-ghost-date {
    position: absolute;
    font-family: var(--font-display);
    font-size: clamp(15rem, 30vw, 35rem);
    color: var(--espresso);
    opacity: 0.03;
    z-index: 1;
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
}

.hero-label {
    margin-bottom: 2rem;
}

.hero-label .mono-label {
    color: var(--dark-goldenrod);
    font-size: 0.8rem;
    letter-spacing: 0.25em;
}

.hero-date {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--espresso);
    line-height: 1;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.1em;
}

.date-segment {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), color 0.6s ease;
}

.date-segment:hover {
    transform: translateY(-8px);
    color: var(--terracotta);
}

.date-separator {
    color: var(--dark-goldenrod);
    font-size: 0.6em;
    opacity: 0.6;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--burnished-copper);
    max-width: 500px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

/* --- Spectrum Bars --- */
.spectrum-bar {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin: 1.5rem auto;
}

.spectrum-bar span {
    width: 4px;
    height: 24px;
    border-radius: 2px;
    animation: spectrumPulse 3s ease-in-out infinite;
}

.spectrum-bar span:nth-child(1) { background: var(--dusty-rose); animation-delay: 0s; }
.spectrum-bar span:nth-child(2) { background: var(--sage-mist); animation-delay: 0.15s; }
.spectrum-bar span:nth-child(3) { background: var(--twilight-indigo); animation-delay: 0.3s; }
.spectrum-bar span:nth-child(4) { background: var(--terracotta); animation-delay: 0.45s; }
.spectrum-bar span:nth-child(5) { background: var(--dark-goldenrod); animation-delay: 0.6s; }
.spectrum-bar span:nth-child(6) { background: var(--amber-glow); animation-delay: 0.75s; }
.spectrum-bar span:nth-child(7) { background: var(--dusty-rose); animation-delay: 0.9s; }
.spectrum-bar span:nth-child(8) { background: var(--sage-mist); animation-delay: 1.05s; }
.spectrum-bar span:nth-child(9) { background: var(--twilight-indigo); animation-delay: 1.2s; }
.spectrum-bar span:nth-child(10) { background: var(--terracotta); animation-delay: 1.35s; }
.spectrum-bar span:nth-child(11) { background: var(--dark-goldenrod); animation-delay: 1.5s; }
.spectrum-bar span:nth-child(12) { background: var(--amber-glow); animation-delay: 1.65s; }

@keyframes spectrumPulse {
    0%, 100% { transform: scaleY(1); opacity: 0.7; }
    50% { transform: scaleY(1.8); opacity: 1; }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: scrollBounce 2.5s ease-in-out infinite;
}

.scroll-indicator .mono-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--charcoal);
    opacity: 0.5;
}

.scroll-arrow {
    color: var(--dark-goldenrod);
    opacity: 0.6;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* --- Orbit Rings --- */
.orbit-ring {
    position: absolute;
    border: 1px solid var(--burnished-copper);
    border-radius: 50%;
    opacity: 0.08;
    z-index: 1;
    pointer-events: none;
}

.orbit-ring-1 {
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 60s linear infinite;
}

.orbit-ring-2 {
    width: 700px;
    height: 700px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 90s linear infinite reverse;
}

.orbit-ring-3 {
    width: 900px;
    height: 900px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 120s linear infinite;
}

@keyframes orbitSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --- Data Card (Chapter I) --- */
.data-card {
    background: rgba(245, 237, 224, 0.7);
    border: 1px solid rgba(122, 92, 68, 0.15);
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(122, 92, 68, 0.1);
    background: rgba(237, 227, 211, 0.5);
}

.grid-dots {
    display: grid;
    grid-template-columns: repeat(3, 6px);
    gap: 4px;
}

.grid-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--burnished-copper);
    opacity: 0.3;
}

.data-card-body {
    padding: 1.5rem;
}

.data-card-body .body-text {
    margin-bottom: 2rem;
    text-align: left;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(122, 92, 68, 0.08);
}

.data-key {
    color: var(--charcoal);
    opacity: 0.7;
}

.data-value {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--espresso);
}

/* --- Pull Quote (Chapter II) --- */
.pull-quote {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    color: var(--terracotta);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    line-height: 1.4;
    position: relative;
}

.quote-mark {
    color: var(--dark-goldenrod);
    opacity: 0.4;
    font-size: 1.3em;
}

/* --- Observation Grid --- */
.observation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.obs-item {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(245, 237, 224, 0.5);
    border: 1px solid rgba(122, 92, 68, 0.1);
    border-radius: 8px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.obs-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(61, 43, 31, 0.08);
}

.obs-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--dark-goldenrod);
}

.obs-icon svg {
    width: 100%;
    height: 100%;
}

.obs-item .mono-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.65rem;
}

.obs-value {
    font-family: var(--font-accent);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--espresso);
}

/* --- Spectrum Analysis (Chapter III) --- */
.spectrum-analysis {
    max-width: 650px;
    margin: 3rem auto 0;
}

.spectrum-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(122, 92, 68, 0.06);
}

.spectrum-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spectrum-info {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.spectrum-hex {
    font-size: 0.8rem;
    color: var(--charcoal);
    opacity: 0.6;
}

.spectrum-bar-viz {
    flex: 1;
    height: 8px;
    background: rgba(122, 92, 68, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.spectrum-fill {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.chapter.visible .spectrum-fill {
    width: var(--fill-width, 0%);
}

/* --- Timeline (Chapter IV) --- */
.archive-timeline {
    position: relative;
    max-width: 600px;
    margin: 3rem auto 0;
    padding-left: 60px;
}

.timeline-line {
    position: absolute;
    left: 25px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--burnished-copper) 10%, var(--burnished-copper) 90%, transparent);
    opacity: 0.3;
}

.timeline-entry {
    position: relative;
    padding: 0 0 3rem 2rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.chapter.visible .timeline-entry {
    opacity: 1;
    transform: translateX(0);
}

.chapter.visible .timeline-entry:nth-child(2) { transition-delay: 0.2s; }
.chapter.visible .timeline-entry:nth-child(3) { transition-delay: 0.4s; }
.chapter.visible .timeline-entry:nth-child(4) { transition-delay: 0.6s; }
.chapter.visible .timeline-entry:nth-child(5) { transition-delay: 0.8s; }

.timeline-entry:last-child::before {
    background: var(--observatory-green);
    box-shadow: 0 0 0 2px var(--observatory-green);
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -42px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dark-goldenrod);
    border: 2px solid var(--parchment);
    box-shadow: 0 0 0 2px var(--dark-goldenrod);
}

.timeline-year {
    margin-bottom: 0.5rem;
}

.timeline-year .font-mono {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--dark-goldenrod);
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--espresso);
    margin-bottom: 0.5rem;
}

/* --- Dimensions Grid (Chapter V) --- */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.dimension-card {
    background: rgba(245, 237, 224, 0.6);
    border: 1px solid rgba(122, 92, 68, 0.12);
    border-radius: 8px;
    padding: 2rem 1.5rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.dimension-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(61, 43, 31, 0.1);
}

.dimension-number {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--dark-goldenrod);
    opacity: 0.25;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    line-height: 1;
}

.dimension-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--espresso);
    margin-bottom: 0.75rem;
}

.dimension-viz {
    margin-top: 1rem;
    height: 80px;
    position: relative;
}

.dim-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Colophon --- */
.colophon-chapter {
    min-height: 60vh;
    text-align: center;
    background-color: var(--espresso);
}

.colophon-content {
    position: relative;
    z-index: 2;
}

.colophon-date {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--parchment);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.colophon-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--dusty-rose);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.colophon-spectrum .spectrum-bar span {
    opacity: 0.5;
}

.colophon-label {
    display: block;
    margin-top: 2rem;
    color: var(--burnished-copper);
    opacity: 0.5;
    font-size: 0.65rem;
    letter-spacing: 0.3em;
}

.colophon-wash {
    opacity: 0.15;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-date {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .hero-ghost-date {
        font-size: clamp(8rem, 25vw, 15rem);
    }

    .chapter-container {
        padding: 8vh 1.5rem;
    }

    .observation-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .dimensions-grid {
        grid-template-columns: 1fr;
    }

    .archive-timeline {
        padding-left: 40px;
    }

    .timeline-line {
        left: 10px;
    }

    .timeline-entry::before {
        left: -37px;
    }

    .spectrum-row {
        flex-wrap: wrap;
    }

    .spectrum-bar-viz {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 480px) {
    .hero-date {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .data-card {
        border-radius: 4px;
    }

    .pull-quote {
        font-size: 1.3rem;
    }
}
