/* === daitoua.com styles === */
/* Colors: #0E1428, #121828, #1A1820, #1A2040, #2A2030, #2A3A5A, #4A5A8A, #6A5A40, #6A7A9A, #8A3030, #8A9AC0, #A08A5A, #D0D4E0 */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: #0E1428;
    color: #D0D4E0;
    font-family: 'Noto Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* === Navigation === */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(14, 20, 40, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(74, 90, 138, 0.2);
}

.nav-periods {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-family: 'Noto Serif', serif;
    font-size: 13px;
    color: #8A9AC0;
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #8A9AC0;
    animation: navPulse 2s ease-in-out infinite;
}

@keyframes navPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.nav-link:hover { color: #D0D4E0; }

/* === Hero / Archive Gate === */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0E1428;
}

.metallic-sheen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 20%, rgba(26, 32, 64, 0.05) 50%, transparent 80%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-rule {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 32px;
    gap: 0;
}

.rule-left, .rule-right {
    width: 40vw;
    height: 1px;
    background: rgba(74, 90, 138, 0.4);
    transform: scaleX(0);
    transition: transform 0.8s ease;
}

.rule-left {
    transform-origin: right;
}

.rule-right {
    transform-origin: left;
}

.rule-left.visible, .rule-right.visible {
    transform: scaleX(1);
}

.hero-kanji {
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    font-size: clamp(3rem, 7vw, 5rem);
    color: #D0D4E0;
    opacity: 0;
    transition: opacity 1s ease;
    margin-bottom: 12px;
}

.hero-kanji.visible {
    opacity: 1;
}

.hero-latin {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #8A9AC0;
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 1s ease;
    margin-bottom: 24px;
}

.hero-latin.visible { opacity: 1; }

.hero-tagline {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #6A7A9A;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-tagline.visible { opacity: 1; }

/* Map overlay */
.map-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.hero-map {
    right: 5%;
    top: 10%;
    width: 300px;
    height: 450px;
    opacity: 0.5;
}

/* === Timeline === */
#timeline {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 32px 96px;
}

.timeline-spine {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(74, 90, 138, 0.3);
    transform: translateX(-50%);
}

/* Timeline Era */
.timeline-era {
    position: relative;
    padding: 32px 0;
}

/* Period Markers */
.period-marker {
    position: relative;
    width: 16px;
    height: 16px;
    border: 2px solid #4A5A8A;
    border-radius: 50%;
    background: #0E1428;
    margin: 0 auto 24px;
    z-index: 10;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.period-marker.active {
    background: #8A9AC0;
    animation: markerPulse 3s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(138, 154, 192, 0.1);
    }
    50% {
        box-shadow: 0 0 16px rgba(138, 154, 192, 0.3);
    }
}

.marker-year {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #6A7A9A;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Timeline Blocks */
.timeline-block {
    position: relative;
    width: calc(50% - 40px);
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-block.left {
    margin-right: auto;
    margin-left: 0;
    padding-right: 20px;
}

.timeline-block.right {
    margin-left: auto;
    margin-right: 0;
    padding-left: 20px;
}

/* Connection bars */
.connection-bar {
    position: absolute;
    top: 30px;
    width: 40px;
    height: 1px;
    background: #4A5A8A;
    transform: scaleX(0);
    transition: transform 0.4s ease 0.2s;
}

.timeline-block.left .connection-bar {
    right: -40px;
    transform-origin: left;
}

.timeline-block.right .connection-bar {
    left: -40px;
    transform-origin: right;
}

.timeline-block.visible .connection-bar {
    transform: scaleX(1);
}

/* Archive Panels */
.archive-panel {
    background: #121828;
    border: 1px solid #2A3A5A;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.archive-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent 30%, rgba(138, 154, 192, 0.05) 50%, transparent 70%);
    transition: left 0.8s ease;
    pointer-events: none;
}

.archive-panel:hover::after {
    left: 100%;
}

.archive-panel:hover {
    border-color: rgba(74, 90, 138, 0.5);
}

/* Leather panels */
.leather-panel {
    background: #1A1820;
    border-top: 3px solid #A08A5A;
    position: relative;
}

.leather-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 40%, rgba(42, 32, 48, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* Conflict indicator */
.conflict-indicator {
    border-left: 2px solid #8A3030;
}

.panel-ref {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #6A7A9A;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.archive-panel h2 {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: #D0D4E0;
    margin-bottom: 16px;
}

.archive-panel p {
    color: #D0D4E0;
    margin-bottom: 12px;
}

.archive-panel p:last-child {
    margin-bottom: 0;
}

/* Depth shadows on headings */
.archive-panel h2 {
    text-shadow: 2px 3px 6px rgba(14, 20, 40, 0.4);
}

/* === Footer === */
#footer {
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    border-top: 1px solid rgba(74, 90, 138, 0.2);
}

.footer-brand {
    font-family: 'Noto Serif JP', serif;
    font-size: 14px;
    font-weight: 700;
    color: #8A9AC0;
}

.footer-kanji {
    font-family: 'Noto Serif JP', serif;
    font-size: 16px;
    color: #6A7A9A;
}

.footer-meta {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #6A7A9A;
    letter-spacing: 0.04em;
}

/* === Responsive === */
@media (max-width: 768px) {
    .timeline-block {
        width: calc(100% - 32px);
        margin-left: 32px !important;
        margin-right: 0 !important;
        padding-left: 20px !important;
        padding-right: 0 !important;
    }

    .timeline-spine {
        left: 16px;
    }

    .connection-bar {
        left: -20px !important;
        right: auto !important;
        transform-origin: right !important;
    }

    .marker-year {
        left: 24px;
    }

    .period-marker {
        margin: 0 0 24px 8px;
    }

    #footer {
        flex-direction: column;
        gap: 8px;
    }

    .hero-map {
        display: none;
    }

    .nav-periods {
        gap: 12px;
    }

    .nav-link {
        font-size: 11px;
    }
}
