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

:root {
    --tangerine: #FF6B35;
    --seafoam: #4ECDC4;
    --sunflare: #FFE66D;
    --cream: #FFF8F0;
    --ink: #2B2D42;
    --lavender: #C5CAE9;
    --horizon-color: #FF6B35;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--cream);
    color: var(--ink);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* === Horizon Line === */
#horizon-line {
    position: fixed;
    top: 45vh;
    left: 15vw;
    width: 70vw;
    height: 1px;
    background-color: var(--horizon-color);
    z-index: 100;
    pointer-events: none;
    transition: background-color 0.6s ease;
}

/* === Navigation Dots === */
#nav-dots {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(43, 45, 66, 0.4);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s ease, border-color 0.4s ease;
}

.nav-dot:hover {
    transform: scale(1.08);
}

.nav-dot.active {
    background-color: var(--horizon-color);
    border-color: var(--horizon-color);
}

/* === Panels === */
.panel {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--cream);
}

.grain-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.02;
    background: var(--sunflare);
    filter: url(#grain);
    pointer-events: none;
    z-index: 1;
}

/* === Parallax Layers === */
.layer-slow,
.layer-mid,
.layer-fast {
    position: absolute;
    inset: 0;
    will-change: transform;
}

.layer-slow { z-index: 2; }
.layer-mid { z-index: 3; }
.layer-fast { z-index: 4; position: relative; }

/* === Temporal Grid === */
.temporal-grid {
    display: grid;
    grid-template-columns: 2fr 5fr 3fr;
    column-gap: clamp(12px, 2vw, 32px);
    min-height: 100vh;
    align-items: center;
    padding: 0 clamp(16px, 4vw, 64px);
}

/* === Columns === */
.col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.col-left {
    align-items: flex-start;
}

.col-center {
    align-items: flex-start;
}

.col-right {
    align-items: flex-end;
}

/* === Headlines === */
.headline {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7.5rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
    color: var(--ink);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.panel:nth-child(1) .headline { color: var(--tangerine); }
.panel:nth-child(3) .headline { color: var(--seafoam); }
.panel:nth-child(5) .headline { color: var(--ink); }

.headline:hover {
    transform: scale(1.02);
}

/* === Body Text === */
.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.65;
    max-width: 40ch;
    color: var(--ink);
    opacity: 0.85;
}

/* === Mid Layer Text (Timestamps) === */
.mid-text {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.4;
    position: absolute;
    bottom: 15%;
    right: 10%;
}

/* === Parallel Lines === */
.parallel-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 60%;
    min-width: 80px;
}

.pline {
    display: block;
    height: 0.5px;
    width: 100%;
}

/* === Grid Fragment (Calendar) === */
.grid-fragment {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--lavender);
    opacity: 0.2;
    text-align: center;
}

.grid-fragment span {
    padding: 2px 4px;
}

/* === Lunar Ring Calendar Motifs === */
.lunar-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--tangerine);
    opacity: 0.08;
    pointer-events: none;
}

.lunar-ring-1 {
    width: 200px; height: 200px;
    top: 15%; left: 8%;
    border-color: var(--tangerine);
}

.lunar-ring-2 {
    width: 120px; height: 120px;
    top: 60%; left: 75%;
    border-color: var(--seafoam);
    border-width: 5px;
}

.lunar-ring-3 {
    width: 300px; height: 300px;
    top: 30%; left: 50%;
    border-color: var(--tangerine);
    border-width: 2px;
    opacity: 0.05;
}

.lunar-ring-4 {
    width: 250px; height: 250px;
    top: 10%; right: 5%; left: auto;
    border-color: var(--seafoam);
}

.lunar-ring-5 {
    width: 150px; height: 150px;
    top: 55%; left: 12%;
    border-color: var(--tangerine);
    border-width: 4px;
}

.lunar-ring-6 {
    width: 180px; height: 180px;
    top: 20%; left: 60%;
    border-color: var(--sunflare);
    border-width: 4px;
    opacity: 0.12;
}

.lunar-ring-7 {
    width: 280px; height: 280px;
    top: 50%; left: 5%;
    border-color: var(--tangerine);
    border-width: 2px;
}

.lunar-ring-8 {
    width: 100px; height: 100px;
    top: 70%; right: 15%; left: auto;
    border-color: var(--seafoam);
    border-width: 6px;
    opacity: 0.1;
}

/* === Rokuyou Badges === */
.rokuyou-badge {
    position: absolute;
    pointer-events: none;
}

.rokuyou-1 { top: 25%; left: 20%; }
.rokuyou-2 { top: 65%; right: 20%; }
.rokuyou-3 { top: 35%; right: 15%; }
.rokuyou-4 { top: 20%; left: 30%; }

/* === Sun Arcs === */
.sun-arc {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    z-index: 1;
}

.sun-arc-1 {
    width: 50vw; height: 50vw;
    bottom: -25vw; right: -10vw;
    border: 2px solid var(--tangerine);
    box-shadow: 0 0 0 2px transparent, inset 0 0 80px rgba(78, 205, 196, 0.05);
    opacity: 0.15;
}

.sun-arc-2 {
    width: 60vw; height: 60vw;
    top: -30vw; left: -15vw;
    border: 2px solid var(--seafoam);
    opacity: 0.12;
}

.sun-arc-3 {
    width: 45vw; height: 45vw;
    bottom: -20vw; left: 30%;
    border: 2px solid var(--sunflare);
    opacity: 0.18;
}

/* === Interstitial === */
.interstitial {
    height: 50vh;
    position: relative;
    background: var(--cream);
    z-index: 0;
}

/* === Mobile === */
@media (max-width: 768px) {
    .temporal-grid {
        grid-template-columns: 1fr;
        padding: 0 24px;
    }

    .col-left,
    .col-right {
        display: none;
    }

    .panel::before,
    .panel::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 8px;
        z-index: 10;
    }

    .panel:nth-child(1)::before { left: 0; background: var(--seafoam); opacity: 0.5; }
    .panel:nth-child(1)::after { right: 0; background: var(--sunflare); opacity: 0.5; }
    .panel:nth-child(3)::before { left: 0; background: var(--tangerine); opacity: 0.5; }
    .panel:nth-child(3)::after { right: 0; background: var(--sunflare); opacity: 0.5; }
    .panel:nth-child(5)::before { left: 0; background: var(--tangerine); opacity: 0.5; }
    .panel:nth-child(5)::after { right: 0; background: var(--seafoam); opacity: 0.5; }

    .headline {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    #horizon-line {
        left: 5vw;
        width: 90vw;
    }
}
