/* daitoua.com - Archival Exhibition / Dark Academia */

:root {
    --parchment: #F5ECD7;
    --walnut: #2C2416;
    --ink: #3D2B1D;
    --taupe: #8B7D6B;
    --seal-red: #8B2500;
    --brass: #B8943E;
    --sepia: #5C4A32;
    --inverted-text: #D4C5A9;
    --subtle-wash: #E8E0D0;
    --terracotta: #943C2B;
    --washed-bg: #F0EBE0;
    --washed-text: #6B6358;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--parchment);
    color: var(--ink);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Paper texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* === HEADER === */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--parchment);
    border-bottom: 1px solid rgba(139,125,107,0.2);
    padding: 12px 60px 12px 60px;
    transform: translateY(-100%);
    transition: transform 0.6s ease;
}

.site-header.visible {
    transform: translateY(0);
}

.title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-title-jp {
    font-family: 'Noto Serif JP', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
}

.site-title-en {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 300;
    color: var(--taupe);
}

.title-seal {
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.title-seal.visible {
    opacity: 1;
    transform: scale(1);
}

/* === OPENING SEQUENCE === */
.opening-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--parchment);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

.opening-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* === ARCHIVE INDEX SIDEBAR === */
.archive-index {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 48px;
    background: var(--parchment);
    border-right: 1px solid rgba(139,125,107,0.2);
    z-index: 90;
    overflow: hidden;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
}

.archive-index:hover {
    width: 240px;
}

.index-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.index-card:hover {
    background: #EDE4CC;
    border-color: var(--taupe);
}

.index-card.active .seal-dot {
    background: var(--seal-red);
}

.seal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--seal-red);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.index-card:hover .seal-dot {
    transform: scale(1.3);
}

.index-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: var(--taupe);
}

.index-topic {
    font-family: 'Source Serif 4', serif;
    font-size: 14px;
    color: var(--ink);
}

/* === SCROLL INDICATOR === */
.scroll-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 90;
}

.wax-seal {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--seal-red);
    cursor: pointer;
    transition: all 0.3s ease;
}

.wax-seal.active {
    background: var(--seal-red);
}

/* === MAIN CONTENT === */
.archive-content {
    margin-left: 48px;
    padding-right: 40px;
}

/* === SECTION STYLES === */
.chamber {
    scroll-margin-top: 80px;
    padding: 80px 40px;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 8px;
}

.section-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 300;
    color: var(--taupe);
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 40px;
}

.section-seal {
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.section-seal.visible {
    opacity: 1;
}

.section-body p,
.broken-grid p,
.war-content p,
.aftermath-content p {
    margin-bottom: 24px;
    max-width: 680px;
}

.drop-cap {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 72px;
    float: left;
    line-height: 0.8;
    padding-right: 8px;
    padding-top: 6px;
    color: var(--ink);
}

/* === PROLOGUE SPLIT === */
.chamber-split {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.map-panel {
    flex: 0 0 40%;
    position: relative;
}

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

.map-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease-out;
}

.map-svg.animate .map-path {
    stroke-dashoffset: 0;
}

.text-panel {
    flex: 1;
}

/* === HORIZONTAL GALLERY === */
.horizontal-gallery {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 40px 0;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--brass) transparent;
}

.horizontal-gallery::-webkit-scrollbar {
    height: 4px;
}

.horizontal-gallery::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-gallery::-webkit-scrollbar-thumb {
    background: var(--brass);
    border-radius: 2px;
}

.archival-plate {
    min-width: 60vw;
    max-width: 80vw;
    flex-shrink: 0;
    background: var(--parchment);
    border: 1px solid var(--taupe);
    box-shadow: 2px 3px 8px rgba(60,43,29,0.15), 0 1px 2px rgba(60,43,29,0.1);
    padding: 40px;
    scroll-snap-align: center;
    transition: transform 0.3s ease;
    will-change: transform;
}

.archival-plate:hover {
    transform: rotate(0.5deg);
}

.plate-content {
    margin-bottom: 20px;
}

.plate-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--ink);
}

.plate-caption {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    color: var(--taupe);
    border-top: 1px solid rgba(139,125,107,0.3);
    padding-top: 12px;
}

/* === BROKEN GRID (Section 3) === */
.sphere {
    background: var(--subtle-wash);
    transition: background 0.5s ease;
}

.broken-grid {
    display: grid;
    grid-template-columns: 25% 45% 30%;
    gap: 0;
    position: relative;
}

.grid-col {
    padding: 30px;
}

.grid-col-narrow {
    padding-right: 50px;
}

.grid-col-wide {
    margin-left: -20px;
    margin-right: -20px;
    position: relative;
    z-index: 2;
}

.grid-col-medium {
    margin-left: -20px;
}

.marginalia {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    color: var(--taupe);
    line-height: 1.5;
    margin-top: 20px;
    padding-left: 12px;
    border-left: 2px solid var(--brass);
}

/* === CONTENT NOTICE === */
.content-notice {
    border-left: 3px solid var(--terracotta);
    background: var(--parchment);
    padding: 12px 20px;
    margin-bottom: 30px;
    max-width: 680px;
}

.content-notice p {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: var(--taupe);
    margin-bottom: 0;
}

.notice-dark {
    background: rgba(44,36,22,0.3);
    border-left-color: var(--terracotta);
}

.notice-dark p {
    color: var(--inverted-text);
}

/* === WAR SECTION === */
.war {
    background: var(--walnut);
    color: var(--inverted-text);
    transition: background 0.5s ease;
}

.war .section-title,
.war-title {
    color: var(--inverted-text);
}

.war .section-subtitle,
.war-subtitle {
    color: var(--taupe);
}

.war-content {
    max-width: 520px;
}

.war-content p {
    max-width: 520px;
    color: var(--inverted-text);
}

.timeline-marker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 16px;
}

.marker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--seal-red);
    display: block;
    flex-shrink: 0;
}

.marker-dot.pulse {
    animation: pulse 0.6s ease-out;
}

.marker-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: var(--brass);
}

/* === AFTERMATH SECTION === */
.aftermath {
    background: var(--washed-bg);
    color: var(--washed-text);
    padding: 120px 40px;
}

.aftermath-content {
    max-width: 600px;
    margin: 0 auto;
}

.aftermath-content p {
    max-width: 600px;
    color: var(--washed-text);
}

.aftermath-title {
    color: var(--washed-text);
}

.aftermath-subtitle {
    color: var(--taupe);
}

.closing-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 300;
    color: var(--taupe);
    text-align: center;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(139,125,107,0.3);
}

/* === TELEGRAPH DIVIDERS === */
.telegraph-divider {
    padding: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.telegraph-line {
    display: block;
    width: 0;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        var(--brass) 0px,
        var(--brass) 20px,
        transparent 20px,
        transparent 28px,
        var(--brass) 28px,
        var(--brass) 36px,
        transparent 36px,
        transparent 44px
    );
    transition: width 1.2s ease-out;
}

.telegraph-divider.animate .telegraph-line {
    width: 80%;
}

.telegraph-dark .telegraph-line {
    background: repeating-linear-gradient(
        to right,
        var(--inverted-text) 0px,
        var(--inverted-text) 20px,
        transparent 20px,
        transparent 28px,
        var(--inverted-text) 28px,
        var(--inverted-text) 36px,
        transparent 36px,
        transparent 44px
    );
}

/* === FOOTER === */
.site-footer {
    padding: 40px 60px;
    background: var(--parchment);
    border-top: 1px solid rgba(139,125,107,0.2);
    text-align: center;
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    color: var(--taupe);
}

/* === ANIMATIONS === */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .archive-index {
        display: none;
    }

    .archive-content {
        margin-left: 0;
        padding-right: 0;
    }

    .chamber {
        padding: 60px 20px;
    }

    .chamber-split {
        flex-direction: column;
    }

    .map-panel {
        flex: none;
        width: 100%;
    }

    .broken-grid {
        grid-template-columns: 1fr;
    }

    .grid-col-wide,
    .grid-col-medium {
        margin-left: 0;
        margin-right: 0;
    }

    .scroll-indicator {
        display: none;
    }

    .archival-plate {
        min-width: 85vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
