/* ==========================================================
   taisho.day - Taisho Era Poster Design
   Colors: #8a2a3a, #c44a28, #d4a040, #f0e4d0, #1a1a1e, #6a3a6a, #4a6a3a
   Fonts: Zilla Slab (headlines), Noto Sans JP (body), Crimson Text (labels)
   ========================================================== */

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

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.8;
    color: #1a1a1e;
    background-color: #f0e4d0;
    overflow-x: hidden;
}

/* --- Shake Animation --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 400ms ease;
}

/* --- Scale Bounce Animation --- */
@keyframes scaleBounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.08); opacity: 1; }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Fade In Animation --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Floral SVG Stroke Draw --- */
@keyframes strokeDraw {
    from { stroke-dashoffset: var(--path-length, 1000); }
    to { stroke-dashoffset: 0; }
}

/* --- Gradient Fade --- */
@keyframes gradientFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Pulse glow for scroll hint --- */
@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* ==========================================================
   HERO SECTION - Taisho-era Poster
   ========================================================== */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8a2a3a 0%, #c44a28 45%, #d4a040 100%);
    opacity: 0;
    animation: gradientFade 1.2s ease-out 0.2s forwards;
}

/* Floral frame overlay */
.floral-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.floral-path,
.blossom,
.petal,
.wisteria,
.chrysanthemum,
.chrysanthemum-petal {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    animation: strokeDraw 2.5s ease-out forwards;
}

.floral-top-left { animation-delay: 0.8s; }
.floral-top-right { animation-delay: 1.0s; }
.floral-top-right-2 { animation-delay: 1.2s; }
.floral-bottom-left { animation-delay: 1.4s; }
.floral-bottom-right { animation-delay: 1.1s; }
.floral-bottom-right-2 { animation-delay: 1.3s; }

.blossom, .wisteria, .chrysanthemum {
    animation-delay: 1.8s;
    animation-duration: 1.5s;
}

.petal, .chrysanthemum-petal {
    animation-delay: 2.2s;
    animation-duration: 1.2s;
}

.b1 { animation-delay: 1.8s; }
.b2 { animation-delay: 2.0s; }
.b3 { animation-delay: 2.2s; }
.w1 { animation-delay: 1.9s; }
.w2 { animation-delay: 2.1s; }
.w3 { animation-delay: 2.0s; }
.w4 { animation-delay: 2.2s; }
.c1 { animation-delay: 2.0s; }
.c1-inner { animation-delay: 2.3s; }
.p1 { animation-delay: 2.4s; }
.p2 { animation-delay: 2.5s; }
.cp1 { animation-delay: 2.4s; }
.cp2 { animation-delay: 2.5s; }

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(72px, 15vw, 200px);
    color: #f0e4d0;
    text-shadow: 3px 3px 0 rgba(26, 26, 30, 0.3), 6px 6px 0 rgba(26, 26, 30, 0.1);
    letter-spacing: 0.05em;
    opacity: 0;
    animation: scaleBounce 1s ease-out 1.5s forwards;
}

.hero-subtitle {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(14px, 2.5vw, 24px);
    color: #f0e4d0;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 0.5rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 2.2s forwards;
}

.hero-tagline {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(16px, 2vw, 22px);
    color: #d4a040;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 2.6s forwards;
}

/* Scroll Hint */
.hero-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    animation: pulseGlow 2s ease-in-out 3.5s infinite, fadeIn 0.5s ease-out 3.2s forwards;
}

/* ==========================================================
   NAVIGATION BAR
   ========================================================== */

.main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1a1e;
    border-bottom: 2px solid #d4a040;
    padding: 0.5rem 0;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0 1rem;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: #d4a040;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-link:hover {
    color: #f0e4d0;
    background-color: rgba(212, 160, 64, 0.15);
}

.nav-link.active {
    color: #f0e4d0;
    background-color: rgba(212, 160, 64, 0.25);
}

.nav-icon {
    width: 28px;
    height: 28px;
}

.nav-label {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

/* ==========================================================
   CONTENT SECTIONS
   ========================================================== */

.content-section {
    position: relative;
    padding: 0 1rem;
}

.section-border-top {
    width: 100%;
    overflow: hidden;
}

.section-divider {
    display: block;
    width: 100%;
    height: 40px;
}

.divider-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0s;
}

.divider-path.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.5s ease-out;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1rem 4rem;
}

/* F-Pattern Layout */
.f-pattern {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.f-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.f-row-primary {
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid rgba(26, 26, 30, 0.15);
    padding-bottom: 1rem;
}

.f-row-content {
    display: flex;
    gap: 2.5rem;
}

.f-col-wide {
    flex: 2;
    min-width: 300px;
}

.f-col-narrow {
    flex: 1;
    min-width: 250px;
}

/* Section Headings */
.section-heading {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(32px, 6vw, 72px);
    color: #1a1a1e;
    line-height: 1.1;
}

.section-date-label {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(14px, 1.5vw, 18px);
    color: #8a2a3a;
    white-space: nowrap;
}

/* Body Text */
.body-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.8;
    color: #1a1a1e;
    margin-bottom: 1.5rem;
}

.body-text:last-child {
    margin-bottom: 0;
}

.label-text {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    color: #8a2a3a;
}

/* Sidebar Cards */
.sidebar-card {
    background: #f0e4d0;
    border: 1.5px solid #6a3a6a;
    border-radius: 4px;
    padding: 1.5rem;
    position: relative;
}

.sidebar-card::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid #4a6a3a;
    border-radius: 6px;
    pointer-events: none;
}

.sidebar-heading {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #8a2a3a;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #d4a040;
}

.sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-list li {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1a1a1e;
}

.date-marker {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    color: #c44a28;
    display: inline-block;
    min-width: 3.5em;
    margin-right: 0.5em;
}

.icon-marker {
    margin-right: 0.5em;
}

/* ==========================================================
   SECTION ALTERNATING BACKGROUNDS
   ========================================================== */

.section-history {
    background: #f0e4d0;
}

.section-culture {
    background: linear-gradient(180deg, #f0e4d0 0%, #ebe0cc 100%);
}

.section-art {
    background: #f0e4d0;
}

.section-democracy {
    background: linear-gradient(180deg, #f0e4d0 0%, #e8dcc5 100%);
}

.section-legacy {
    background: #f0e4d0;
}

/* ==========================================================
   ART TAGS
   ========================================================== */

.art-tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.art-tag {
    display: inline-block;
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #f0e4d0;
    background: #8a2a3a;
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    cursor: default;
    transition: background-color 0.3s ease;
    user-select: none;
}

.art-tag:hover {
    background: #c44a28;
}

/* ==========================================================
   DEMOCRACY MILESTONES
   ========================================================== */

.milestone-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.milestone-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.5rem;
    border-left: 3px solid #d4a040;
    cursor: default;
    user-select: none;
    transition: border-color 0.3s ease;
}

.milestone-item:hover {
    border-color: #c44a28;
}

.milestone-year {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #c44a28;
    white-space: nowrap;
}

.milestone-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #1a1a1e;
}

/* ==========================================================
   LEGACY SECTION
   ========================================================== */

.legacy-quote {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.6;
    color: #8a2a3a;
    border-left: 3px solid #d4a040;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.legacy-crest {
    display: flex;
    justify-content: center;
    padding-top: 0.5rem;
}

.legacy-crest svg {
    opacity: 0.7;
}

/* ==========================================================
   FOOTER
   ========================================================== */

.site-footer {
    background: #1a1a1e;
    padding: 3rem 1rem;
    text-align: center;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-kanji {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 2rem;
    color: #d4a040;
}

.footer-dot {
    color: #6a3a6a;
    font-size: 1.5rem;
}

.footer-domain {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #f0e4d0;
    letter-spacing: 0.05em;
}

.footer-text {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #6a3a6a;
    margin-bottom: 1.5rem;
}

.footer-floral {
    opacity: 0.5;
}

.footer-floral svg {
    display: inline-block;
}

/* ==========================================================
   SCROLL REVEAL
   ========================================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 768px) {
    .nav-inner {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.4rem 0.5rem;
    }

    .nav-label {
        font-size: 0.65rem;
    }

    .f-row-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .f-col-wide,
    .f-col-narrow {
        min-width: 100%;
    }

    .hero-title {
        font-size: clamp(60px, 18vw, 150px);
    }

    .section-inner {
        padding: 2rem 0.5rem 3rem;
    }

    .section-heading {
        font-size: clamp(28px, 8vw, 48px);
    }
}

@media (max-width: 480px) {
    .nav-inner {
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        padding: 0.3rem 0.4rem;
    }

    .nav-icon {
        width: 22px;
        height: 22px;
    }

    .hero-title {
        font-size: clamp(48px, 20vw, 120px);
    }
}
