/* heisei.day - Sepia Toned History */
/* Palette: #f5ead6 (bg), #3d2b1f (text), #8b6c4a (timeline), #6b4c30 (year), #d4c4a8 (film), #a0522d (accent) */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #f5ead6;
    color: #3d2b1f;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
}

/* ===== GRAIN OVERLAY ===== */
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    z-index: 1;
}

/* ===== DAWN SECTION (Hero) ===== */
.dawn {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5ead6;
    padding: 4rem 2rem 0;
}

.dawn-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

/* Chrysanthemum mark */
.chrysanthemum {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 2rem;
}

.petal {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #a0522d;
    background: transparent;
    top: 50%;
    left: 50%;
}

.p1 { transform: translate(-50%, -50%) translate(0, -14px); }
.p2 { transform: translate(-50%, -50%) translate(10px, -10px); }
.p3 { transform: translate(-50%, -50%) translate(14px, 0); }
.p4 { transform: translate(-50%, -50%) translate(10px, 10px); }
.p5 { transform: translate(-50%, -50%) translate(0, 14px); }
.p6 { transform: translate(-50%, -50%) translate(-10px, 10px); }
.p7 { transform: translate(-50%, -50%) translate(-14px, 0); }
.p8 { transform: translate(-50%, -50%) translate(-10px, -10px); }

.chrysanthemum-center {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a0522d;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rule {
    width: 100%;
    margin: 0 auto;
}

.rule-top {
    height: 3px;
    background: #3d2b1f;
    margin-bottom: 1.2rem;
}

.rule-bottom {
    height: 1px;
    background: #8b6c4a;
    margin-top: 0.8rem;
}

.brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    color: #3d2b1f;
    letter-spacing: 0.06em;
    line-height: 1.1;
}

.era-label {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #6b4c30;
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
}

.dawn-subtitle {
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: #8b6c4a;
    margin-top: 1.5rem;
    letter-spacing: 0.02em;
}

.timeline-start-line {
    width: 2px;
    height: 80px;
    background: #8b6c4a;
    margin-top: 3rem;
    position: relative;
    z-index: 2;
}

/* ===== CHRONICLE SECTION (Timeline) ===== */
.chronicle {
    position: relative;
    background: #f5ead6;
    padding: 0 2rem 4rem;
}

.timeline-track {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #8b6c4a;
    transform: translateX(-1px);
    z-index: 1;
}

/* Timeline entries */
.entry {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 4rem;
    z-index: 2;
}

.entry:last-child {
    margin-bottom: 0;
}

/* Left entry: content on left, marker on center */
.entry-left {
    flex-direction: row;
    justify-content: flex-end;
    padding-right: 50%;
}

.entry-left .entry-content {
    text-align: right;
    padding-right: 1.5rem;
    flex: 1;
}

.entry-left .year-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.entry-left .entry-connector {
    position: absolute;
    right: calc(50% + 16px);
    width: 0;
    height: 0;
    border: none;
    /* Connector is the horizontal line */
}

/* Right entry: marker on center, content on right */
.entry-right {
    flex-direction: row;
    justify-content: flex-start;
    padding-left: 50%;
}

.entry-right .entry-content {
    text-align: left;
    padding-left: 1.5rem;
    flex: 1;
}

.entry-right .year-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Horizontal connector lines */
.entry-connector {
    position: absolute;
    height: 2px;
    background: #8b6c4a;
    top: 50%;
    transform: translateY(-1px);
    z-index: 1;
}

.entry-left .entry-connector {
    right: calc(50% + 16px);
    width: 30px;
}

.entry-right .entry-connector {
    left: calc(50% + 16px);
    width: 30px;
}

/* Year marker circle */
.year-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #8b6c4a;
    background: #f5ead6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 3;
}

.year-number {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 9px;
    color: #6b4c30;
    letter-spacing: 0.02em;
}

.entry-content {
    max-width: 300px;
}

.entry-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: #3d2b1f;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.entry-text {
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: #3d2b1f;
    line-height: 1.8;
    opacity: 0.85;
}

/* ===== ARCHIVE SECTION (Film strip) ===== */
.archive {
    position: relative;
    background: #d4c4a8;
    padding: 3rem 0;
    overflow: hidden;
}

.archive-border-top,
.archive-border-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #8b6c4a;
    z-index: 2;
}

.archive-border-top { top: 0; }
.archive-border-bottom { bottom: 0; }

.film-strip {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

.film-frame {
    width: 140px;
    height: 100px;
    background: #f5ead6;
    border: 2px solid #8b6c4a;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.film-frame:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(61, 43, 31, 0.15);
}

.frame-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 108, 74, 0.08) 0%, rgba(160, 82, 45, 0.06) 100%);
    border-radius: 2px;
}

.frame-label {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #6b4c30;
    opacity: 0.6;
}

/* Sprocket holes */
.sprocket {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d4c4a8;
    border: 1px solid #8b6c4a;
}

.sprocket-tl { top: -4px; left: 10px; }
.sprocket-tr { top: -4px; right: 10px; }
.sprocket-bl { bottom: -4px; left: 10px; }
.sprocket-br { bottom: -4px; right: 10px; }

/* ===== EPILOGUE SECTION ===== */
.epilogue {
    position: relative;
    background: #3d2b1f;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.epilogue .grain-overlay {
    opacity: 0.03;
}

.timeline-end-line {
    width: 2px;
    height: 60px;
    background: #8b6c4a;
    position: relative;
    z-index: 2;
    margin-bottom: 1rem;
}

.timeline-end-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8b6c4a;
    position: relative;
    z-index: 2;
    margin-bottom: 3rem;
}

.epilogue-inner {
    position: relative;
    z-index: 2;
    text-align: center;
}

.epilogue-kanji {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: #f5ead6;
    opacity: 0.15;
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
}

.epilogue-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: #d4c4a8;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.epilogue-years {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #8b6c4a;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.epilogue-brand {
    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    color: #6b4c30;
    letter-spacing: 0.1em;
    display: block;
    margin-top: 1rem;
}

/* ===== FADE-IN ANIMATION ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .timeline-track {
        padding-left: 40px;
    }

    .timeline-line {
        left: 20px;
    }

    .entry-left,
    .entry-right {
        flex-direction: row;
        justify-content: flex-start;
        padding-left: 50px;
        padding-right: 0;
    }

    .entry-left .entry-content,
    .entry-right .entry-content {
        text-align: left;
        padding-left: 1rem;
        padding-right: 0;
    }

    .entry-left .year-marker,
    .entry-right .year-marker {
        position: absolute;
        left: 20px;
        transform: translateX(-50%);
    }

    .entry-left .entry-connector,
    .entry-right .entry-connector {
        left: 36px;
        right: auto;
        width: 14px;
    }

    .entry-content {
        max-width: 100%;
    }

    .film-strip {
        gap: 0.8rem;
    }

    .film-frame {
        width: 100px;
        height: 72px;
    }
}
