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

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(to bottom, #1c1c22, #22222c);
    color: #f0ece4;
    /* Palette tokens: #2e2e38 (quiet), #e8c47a (glow) */
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    min-height: 500vh;
}

/* === Reach (Section) Base === */
.reach {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

/* === Reach Navigation Dots === */
.reach-nav {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.reach-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #f0ece4;
    opacity: 0.15;
    transition: opacity 0.4s ease;
}

.reach-dot.active {
    opacity: 1;
}

/* === Reach 1 — Hero === */
.reach-1 {
    justify-content: center;
    align-items: center;
}

.hero-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f0ece4;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
}

.hero-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-text .char.visible {
    opacity: 1;
    transform: translateY(var(--sine-offset, 0px));
}

.pulse-line {
    width: 30%;
    height: 1px;
    background: #d4a853;
    margin-top: 3rem;
    opacity: 0;
    animation: pulse-line 3s ease-in-out infinite;
    will-change: opacity, width;
}

.pulse-line.active {
    opacity: 1;
}

@keyframes pulse-line {
    0%, 100% { width: 30%; opacity: 0.6; }
    50% { width: 70%; opacity: 1; }
}

/* === Reach 2 — Hours === */
.reach-2 {
    align-items: stretch;
    justify-content: center;
}

.reach-2-columns {
    display: flex;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    gap: 0;
}

.col-left {
    flex: 7;
    padding-right: 30px;
    text-align: left;
}

.col-left p, .col-right p {
    margin-bottom: 1.5rem;
}

.river-space {
    flex: 0 0 60px;
    position: relative;
}

.col-right {
    flex: 5;
    padding-left: 30px;
    padding-top: 60px;
    text-align: left;
}

/* === Candle Glows === */
.candle {
    position: absolute;
    pointer-events: none;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(232, 196, 122, 0.08) 0%, transparent 60%),
                radial-gradient(circle at center, rgba(212, 168, 83, 0.03) 0%, transparent 80%);
    animation: breathe 8s ease-in-out infinite;
    will-change: opacity;
}

.candle-1 { top: 30%; left: 48%; animation-delay: 2s; }
.candle-2 { top: 55%; left: 46%; animation-delay: 5s; }
.candle-3 { top: 75%; left: 50%; animation-delay: 11s; }

@keyframes breathe {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* === Empty Frames === */
.empty-frame {
    position: absolute;
    border: 1px solid #a8a8b0;
    pointer-events: none;
    animation: frame-breathe 6s ease-in-out infinite;
    will-change: opacity;
}

.frame-1 {
    width: 200px;
    height: 140px;
    top: 15%;
    right: 5%;
    transform: rotate(1.5deg);
    opacity: 0.12;
}

.frame-2 {
    width: 160px;
    height: 160px;
    top: 20%;
    left: 5%;
    opacity: 0.08;
}

.frame-3 {
    width: 240px;
    height: 180px;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.05;
}

@keyframes frame-breathe {
    0%, 100% { opacity: var(--frame-base-opacity, 0.1); }
    50% { opacity: calc(var(--frame-base-opacity, 0.1) + 0.03); }
}

.frame-1 { --frame-base-opacity: 0.12; }
.frame-2 { --frame-base-opacity: 0.08; }
.frame-3 { --frame-base-opacity: 0.05; }

/* === Reach 3 — Days (Clock) === */
.reach-3 {
    flex-direction: column;
    gap: 2rem;
}

.clock-circle {
    width: min(60vw, 400px);
    height: min(60vw, 400px);
    border-radius: 50%;
    border: 1px solid #a8a8b0;
    position: relative;
}

.clock-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4a853;
    animation: pulse-dot 3.2s ease-in-out infinite;
    will-change: opacity;
}

.dot-12 { top: 8%; left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.dot-3 { top: 50%; right: 8%; transform: translateY(-50%); animation-delay: 0.8s; }
.dot-6 { bottom: 8%; left: 50%; transform: translateX(-50%); animation-delay: 1.6s; }
.dot-9 { top: 50%; left: 8%; transform: translateY(-50%); animation-delay: 2.4s; }

@keyframes pulse-dot {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

.clock-hand {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 35%;
    background: #a8a8b0;
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(-60deg);
}

.timestamp {
    text-align: center;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85em;
    color: #a8a8b0;
}

/* === Reach 4 — Months === */
.reach-4 {
    align-items: center;
    justify-content: center;
}

.reach-4-columns {
    display: flex;
    gap: 4%;
    max-width: 1100px;
    width: 100%;
}

.vignette {
    flex: 1;
    border-top: 1px solid transparent;
    padding-top: 1.5rem;
    background-image: linear-gradient(to right, #d4a853, transparent 60%);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: top left;
}

.vignette-2 { margin-top: 40px; }
.vignette-3 { margin-top: 80px; }

/* === Reach 5 — Years === */
.reach-5 {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 15vh;
    padding-bottom: 20vh;
}

.reach-5-content {
    max-width: 640px;
    text-align: left;
}

.display-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    line-height: 1.5;
    color: #f0ece4;
}

.ambient-footer {
    margin-top: 6rem;
    text-align: center;
}

.footer-domain {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8a8b0;
}

.footer-rule {
    width: 60px;
    height: 1px;
    background: #a8a8b0;
    margin: 1rem auto 0;
    opacity: 0.4;
}

/* === Organic Flow SVG Paths === */
.flow-path {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200vh;
    pointer-events: none;
    z-index: 0;
}

.flow-path-1 { top: 0; }
.flow-path-2 { top: 100vh; }
.flow-path-3 { top: 200vh; }

.flow-path path {
    fill: none;
    stroke: #a8a8b0;
    stroke-width: 0.5;
    opacity: 0.1;
    stroke-dasharray: var(--path-length, 3000);
    stroke-dashoffset: var(--path-length, 3000);
    transition: stroke-dashoffset 4s ease-out;
}

.flow-path path.drawn {
    stroke-dashoffset: 0;
}

/* === Reveal Animation === */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .pulse-line,
    .candle,
    .empty-frame,
    .clock-dot {
        animation: none;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-text .char {
        opacity: 1;
        transform: none;
    }
}
