/* =============================================
   heisei.day — Zen Meditation on the Heisei Era
   ============================================= */

/* CSS Custom Properties */
:root {
    --paper: #F5F0E8;
    --sapphire: #2B4F81;
    --dark-charcoal: #3D3D3D;
    --warm-gray: #4A4A4A;
    --bronze: #8B7355;
    --garnet: #8B4513;
    --amber: #C4943A;
    --dusk-paper: #D4C8B4;
    --mid-dusk: #E8DED0;
    --paper-lightness: 96%;
    --font-display: 'Crimson Pro', Georgia, serif;
    --font-body: 'Shippori Mincho', serif;
    --font-accent: 'Zen Kaku Gothic New', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--paper);
    color: var(--warm-gray);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 2.0;
    overflow-x: hidden;
    position: relative;
}

/* SVG Filters - Hidden */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Paper Grain Overlay */
.paper-grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.08;
    filter: url(#paper-grain);
    background: var(--paper);
    mix-blend-mode: multiply;
}

/* =============================================
   Chapter Base Styles
   ============================================= */

.chapter {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
}

/* =============================================
   Dawn Section
   ============================================= */

.dawn-chapter {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dawn-content {
    position: absolute;
    top: 40%;
    left: 35%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.kanji-label {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--bronze);
    margin-bottom: 16px;
    opacity: 0;
    transition: opacity 600ms ease;
    letter-spacing: 0.15em;
}

.sapphire-line {
    width: 30vw;
    height: 2px;
    margin-bottom: 16px;
    overflow: visible;
}

.sapphire-line line {
    stroke: var(--sapphire);
    stroke-width: 1;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.sapphire-line.animate line {
    stroke-dashoffset: 0;
}

.site-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 600;
    color: var(--sapphire);
    line-height: 1.3;
    opacity: 0;
    transition: opacity 800ms ease;
    letter-spacing: 0.02em;
    text-shadow: 2px 2px 6px rgba(43, 79, 129, 0.08);
}

/* =============================================
   Chapter Markers
   ============================================= */

.chapter-marker {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--garnet);
    position: absolute;
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 300ms ease;
    z-index: 10;
    cursor: default;
}

.chapter-marker.zoom {
    transform: scale(2);
    background-color: var(--amber);
}

.chapter-marker.pulse {
    animation: markerPulse 400ms ease;
}

@keyframes markerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Chapter marker positions - asymmetric */
#chapter-1 .chapter-marker {
    top: 15%;
    left: 12%;
}

#chapter-2 .chapter-marker {
    top: 20%;
    right: 18%;
    left: auto;
}

#chapter-3 .chapter-marker {
    top: 12%;
    left: 10%;
}

#chapter-4 .chapter-marker {
    top: 25%;
    right: 15%;
    left: auto;
}

#chapter-5 .chapter-marker {
    top: 18%;
    left: 14%;
}

#twilight .chapter-marker {
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
}

/* =============================================
   Chapter Headings
   ============================================= */

.chapter-heading {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.35;
    color: var(--dark-charcoal);
    text-shadow: 2px 2px 6px rgba(43, 79, 129, 0.08);
    max-width: 480px;
}

.chapter-heading-left {
    position: absolute;
    top: 25%;
    left: 15%;
}

.chapter-heading-right {
    position: absolute;
    top: 22%;
    right: 15%;
    text-align: right;
}

.chapter-heading-center {
    position: relative;
    text-align: center;
    margin: 0 auto;
}

/* =============================================
   Chapter Text
   ============================================= */

.chapter-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 2.0;
    color: var(--warm-gray);
    max-width: 480px;
}

.chapter-text-left {
    position: absolute;
    top: 38%;
    left: 15%;
}

.chapter-text-right {
    position: absolute;
    top: 35%;
    right: 15%;
    text-align: right;
}

.chapter-text-bottom {
    position: absolute;
    bottom: 12%;
    left: 15%;
}

.chapter-text-center {
    position: relative;
    text-align: center;
    margin: 0 auto;
    max-width: 540px;
}

/* =============================================
   Futuristic Accent Lines
   ============================================= */

.accent-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, rgba(43, 79, 129, 0.2), rgba(43, 79, 129, 0));
    z-index: 2;
}

.accent-line-dawn {
    top: 42%;
    right: 0;
    left: 65%;
}

.accent-line-right {
    top: 30%;
    left: 60%;
    right: 0;
}

.accent-line-left {
    top: 30%;
    left: 0;
    right: 60%;
    background: linear-gradient(90deg, rgba(43, 79, 129, 0), rgba(43, 79, 129, 0.2));
}

.terminal-node {
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--sapphire);
    opacity: 0.3;
    position: absolute;
    top: -1px;
}

.accent-line-right .terminal-node,
.accent-line-dawn .terminal-node {
    right: 0;
}

.accent-line-left .terminal-node {
    left: 0;
}

/* =============================================
   Calligraphic Dividers
   ============================================= */

.divider-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 40px 0;
    position: relative;
}

.calligraphic-divider {
    width: 200px;
    height: 20px;
    overflow: visible;
}

.divider-stroke {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.5s ease-in-out;
}

.divider-stroke.animate {
    stroke-dashoffset: 0;
}

/* =============================================
   Twilight Section
   ============================================= */

.twilight-chapter {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--paper);
    transition: background-color 0.1s linear;
}

.twilight-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 0 32px;
}

/* =============================================
   Era Year Indicator
   ============================================= */

.era-year-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    opacity: 0;
    transition: opacity 400ms ease;
}

.era-year-text {
    font-family: var(--font-accent);
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: 0.1em;
    color: var(--bronze);
}

/* =============================================
   Responsive (Mobile < 768px)
   ============================================= */

@media (max-width: 768px) {
    .dawn-content {
        left: 32px;
        top: 40%;
    }

    .sapphire-line {
        width: 50vw;
    }

    .site-title {
        font-size: 28px;
    }

    .chapter-heading {
        font-size: 22px;
    }

    .chapter-heading-left,
    .chapter-heading-right {
        position: absolute;
        left: 32px;
        right: 32px;
        text-align: left;
        top: 20%;
    }

    .chapter-text {
        font-size: 15px;
        max-width: none;
    }

    .chapter-text-left,
    .chapter-text-right,
    .chapter-text-bottom {
        position: absolute;
        left: 32px;
        right: 32px;
        text-align: left;
        top: auto;
        bottom: auto;
    }

    .chapter-text-left {
        top: 35%;
    }

    .chapter-text-right {
        top: 35%;
    }

    .chapter-text-bottom {
        bottom: 15%;
    }

    .chapter-text-center {
        padding: 0 32px;
    }

    /* Chapter markers - consistent left position */
    .chapter-marker {
        left: 32px !important;
        right: auto !important;
    }

    .accent-line {
        display: none;
    }

    .era-year-indicator {
        bottom: 16px;
        right: 16px;
    }
}
