/* namu.day - A Forgotten Field Guide */
/* Colors: #B8A9C9 Lavender Haze, #F4C462 Sunbeam Gold, #2E2845 Twilight Indigo, #F0EDE5 Aged Paper, #E8967A Faded Coral, #6B7F5E Chalkboard Sage, #FDF8F0 Chalk White */

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

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

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: #2E2845;
    background-color: #FDF8F0;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== Time Indicator ===== */
#time-indicator {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
}

.time-pip {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #F4C462;
    box-shadow: 0 0 12px rgba(244, 196, 98, 0.5);
    transition: background 0.8s ease, box-shadow 0.8s ease;
}

.time-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #2E2845;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    opacity: 0.6;
    transition: color 0.8s ease;
}

/* ===== Chapter General ===== */
.chapter {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    overflow: hidden;
}

.chapter-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    transition: background 1s ease;
}

.chapter-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.chapter-label {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.chapter-number {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #E8967A;
    opacity: 0.8;
}

.chapter-name {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6B7F5E;
}

.chapter-title {
    font-family: 'Shrikhand', cursive;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #2E2845;
    margin-bottom: 2rem;
    line-height: 1.15;
}

.chapter-text {
    text-align: left;
    max-width: 580px;
    margin: 0 auto;
}

.chapter-text p {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    line-height: 1.85;
    color: #2E2845;
    margin-bottom: 1.5rem;
}

/* ===== Dawn Chapter ===== */
#dawn {
    text-align: center;
}

#dawn .chapter-bg {
    background: linear-gradient(180deg, #B8A9C9 0%, #E8967A 40%, #F4C462 80%, #FDF8F0 100%);
    opacity: 0;
    transition: opacity 3s ease;
}

#dawn.awakened .chapter-bg {
    opacity: 1;
}

.tree-silhouette {
    margin: 0 auto 2rem;
    width: 150px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s ease 1s, transform 2s ease 1s;
}

#dawn.awakened .tree-silhouette {
    opacity: 1;
    transform: translateY(0);
}

.tree-silhouette svg {
    width: 100%;
    height: auto;
}

.sun-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #F4C462;
    box-shadow: 0 0 40px rgba(244, 196, 98, 0.4);
    margin: 0 auto 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 2.5s ease 0.5s, transform 2.5s ease 0.5s;
}

#dawn.awakened .sun-circle {
    opacity: 1;
    transform: translateY(0);
}

.site-title {
    font-family: 'Shrikhand', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #2E2845;
    margin-bottom: 0.5rem;
    opacity: 0;
    transition: opacity 2s ease 2s;
}

#dawn.awakened .site-title {
    opacity: 1;
}

.site-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: #6B7F5E;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 2s ease 2.5s;
}

#dawn.awakened .site-subtitle {
    opacity: 1;
}

#dawn .chapter-label {
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 2s ease 3s;
}

#dawn.awakened .chapter-label {
    opacity: 1;
}

/* ===== Morning Chapter ===== */
#morning .chapter-bg {
    background: linear-gradient(180deg, #FDF8F0 0%, #F0EDE5 100%);
}

/* ===== Midday Chapter ===== */
#midday .chapter-bg {
    background: linear-gradient(180deg, #F0EDE5 0%, #FDF8F0 50%, #F0EDE5 100%);
}

/* ===== Afternoon Chapter ===== */
#afternoon .chapter-bg {
    background: linear-gradient(180deg, #F0EDE5 0%, #E8E0D4 100%);
}

/* ===== Dusk Chapter ===== */
#dusk .chapter-bg {
    background: linear-gradient(180deg, #E8967A 0%, #B8A9C9 50%, #2E2845 100%);
    opacity: 0.3;
}

#dusk .chapter-title {
    color: #2E2845;
}

#dusk .chapter-text p {
    color: #2E2845;
}

.closing-tree {
    margin: 3rem auto 0;
    width: 120px;
    opacity: 0.5;
}

.closing-tree svg {
    width: 100%;
    height: auto;
}

/* ===== Illustration Panel ===== */
.illustration-panel {
    background: rgba(253, 248, 240, 0.8);
    border: 2px solid rgba(107, 127, 94, 0.2);
    border-radius: 4px;
    padding: 2rem;
    margin: 1.5rem auto 2rem;
    max-width: 400px;
}

.edu-illustration {
    width: 100%;
    height: auto;
}

/* ===== Footer ===== */
#night {
    background: #2E2845;
    padding: 4rem 2rem;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-domain {
    font-family: 'Shrikhand', cursive;
    font-weight: 400;
    font-size: 1.4rem;
    color: #F4C462;
    margin-bottom: 0.3rem;
}

.footer-hangul {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #B8A9C9;
    margin-bottom: 2.5rem;
    opacity: 0.7;
}

.chapter-nav {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.nav-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.nav-dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(253, 248, 240, 0.2);
    border: 1px solid rgba(253, 248, 240, 0.3);
    transition: background 0.3s ease, transform 0.3s ease;
}

.nav-dot:hover::before,
.nav-dot.active::before {
    background: #F4C462;
    transform: scale(1.3);
    border-color: #F4C462;
}

.nav-dot span {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #F0EDE5;
    opacity: 0.6;
}

.nav-dot:hover span,
.nav-dot.active span {
    opacity: 1;
}

/* ===== Scroll Reveal ===== */
.chapter-content {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.chapter-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

#dawn .chapter-content {
    opacity: 1;
    transform: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .chapter {
        padding: 4rem 1.5rem;
    }

    #time-indicator {
        left: 0.5rem;
    }

    .time-label {
        display: none;
    }

    .illustration-panel {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .chapter-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

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