/* ============================================
   munju.wiki - Avant-Garde Encyclopedia
   ============================================ */
:root {
    --sapphire: #0D2B52;
    --emerald: #0A4D3C;
    --ruby: #7B1133;
    --amethyst: #3D1560;
    --sapphire-light: #1A3F6B;
    --gold: #D4A843;
    --topaz: #D98A4B;
    --rose-quartz: #D4798A;
    --citrine: #D9CC6A;
    --parchment: #F0EDE8;
    --midnight-ink: #1C1926;

    --section-primary: var(--sapphire);
    --section-accent: var(--gold);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; font-synthesis: none; }
body {
    background: var(--midnight-ink);
    color: var(--parchment);
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* --- Sticky Headline Bar (Zone A) --- */
.headline-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 15vh;
    min-height: 80px;
    max-height: 120px;
    display: flex;
    align-items: center;
    padding: 0 clamp(1.5rem, 4vw, 4rem);
    padding-left: 320px;
    background: rgba(13, 43, 82, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    transition: background-color 600ms ease;
}
.headline-bar__text {
    font-family: 'Alfa Slab One', serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
    transition: color 600ms ease;
}

/* --- Navigation Glyphs (Zone B) --- */
.icon-nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 101;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(28, 25, 38, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.icon-nav__glyph {
    width: 48px;
    height: 48px;
    color: var(--parchment);
    opacity: 0.5;
    transition: opacity 400ms ease, transform 400ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.icon-nav__glyph svg {
    width: 36px;
    height: 36px;
}
.icon-nav__glyph:hover {
    opacity: 0.85;
}
.icon-nav__glyph.active {
    opacity: 1;
    animation: pulseAttention 2.4s ease-in-out infinite;
}
@keyframes pulseAttention {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* --- Volume Base --- */
.volume {
    position: relative;
}

/* --- Title Cards --- */
.title-card {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 4rem);
    padding-left: 320px;
}
.title-card--midnight {
    background: var(--midnight-ink);
}
.title-card__pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    animation: rotatePattern 240s linear infinite;
}
.title-card__pattern::before {
    content: '';
    position: absolute;
    inset: -50%;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 6px, currentColor 6px, currentColor 8px);
}
@keyframes rotatePattern {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.title-card__content {
    text-align: center;
    position: relative;
    z-index: 1;
}
.title-card__heading {
    font-family: 'Alfa Slab One', serif;
    font-weight: 400;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 1.5rem;
    transition: color 600ms ease;
}
.volume--emerald .title-card__heading { color: var(--topaz); }
.volume--ruby .title-card__heading { color: var(--rose-quartz); }
.volume--sapphire-light .title-card__heading { color: var(--gold); }
.volume--amethyst .title-card__heading { color: var(--citrine); }

.title-card__sub {
    font-family: 'Zilla Slab', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--parchment);
    opacity: 0.7;
}

/* Divider */
.divider {
    width: 120px;
    height: 6px;
    margin: 1.5rem auto;
}
.divider svg {
    width: 100%;
    height: 100%;
}

/* --- Knowledge Field (Content Area) --- */
.knowledge-field {
    min-height: 80vh;
    padding: clamp(4rem, 8vw, 8rem) clamp(2rem, 4vw, 4rem);
    padding-left: 320px;
}

/* --- Content Grid (Zone C) --- */
.content-grid {
    max-width: 1100px;
    display: grid;
    grid-template-columns: 38% 34% 28%;
    gap: 20px;
}
.content-grid--wide {
    gap: 32px;
}
.content-grid--dense {
    gap: 12px;
}
.content-grid--dense .body-text {
    line-height: 1.62;
}

.content-block {
    padding: 1.5rem 0;
}
.content-block--bordered {
    border-left: 3px solid var(--gold);
    border-radius: 2px;
    padding-left: 1.5rem;
}

/* --- Typography --- */
.sub-heading {
    font-family: 'Zilla Slab', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    line-height: 1.25;
    color: var(--parchment);
    margin-bottom: 0.75rem;
}
.body-text {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    color: var(--parchment);
    max-width: 62ch;
    margin-bottom: 1rem;
}
.counter {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.6;
    display: block;
    margin-bottom: 0.5rem;
}
.volume--emerald .counter { color: var(--topaz); }
.volume--ruby .counter { color: var(--rose-quartz); }
.volume--sapphire-light .counter { color: var(--gold); }
.volume--amethyst .counter { color: var(--citrine); }

.annotation {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--citrine);
    opacity: 0.6;
    display: block;
    margin-top: 1rem;
}

.pull-quote {
    font-family: 'Zilla Slab', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    line-height: 1.3;
    color: var(--gold);
    padding: 1.5rem 0;
    margin: 1rem 0;
    border-left: 2px solid var(--gold);
    padding-left: 1.5rem;
}
.volume--emerald .pull-quote { color: var(--topaz); border-color: var(--topaz); }
.volume--ruby .pull-quote { color: var(--rose-quartz); border-color: var(--rose-quartz); }
.volume--sapphire-light .pull-quote { color: var(--gold); border-color: var(--gold); }
.pull-quote--citrine {
    color: var(--citrine);
    border-color: var(--citrine);
}
.pull-quote p { margin: 0; }

/* --- Reveal Animation --- */
[data-reveal] {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
[data-reveal].visible {
    opacity: 1;
    transform: translateX(0);
}
.title-card [data-reveal] {
    transform: translateY(20px);
}
.title-card [data-reveal].visible {
    transform: translateY(0);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
    .icon-nav {
        width: 60px;
    }
    .icon-nav__glyph svg {
        width: 28px;
        height: 28px;
    }
    .headline-bar,
    .title-card,
    .knowledge-field {
        padding-left: 80px;
    }
}
@media (max-width: 768px) {
    .icon-nav {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        background: rgba(28, 25, 38, 0.95);
        z-index: 200;
    }
    .icon-nav__glyph {
        width: 44px;
        height: 44px;
    }
    .headline-bar,
    .title-card,
    .knowledge-field {
        padding-left: clamp(1rem, 4vw, 2rem);
    }
    .headline-bar {
        height: 60px;
        min-height: 60px;
    }
    .headline-bar__text {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }
    .content-grid,
    .content-grid--wide,
    .content-grid--dense {
        grid-template-columns: 1fr;
    }
    .title-card__heading {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }
    body {
        padding-bottom: 60px;
    }
}
