/* ====================================================
   munju.im — Retro-Futuristic Scholarly Design
   Palette: Gold-Black-Luxury
   Layout: Split-Screen
   Typography: IBM Plex family (Serif, Sans, Mono)
   ==================================================== */

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

:root {
    --deep-black: #0A0E27;
    --soft-white: #F8F7F4;
    --rich-gold: #D4AF37;
    --muted-gold: #C9A961;
    --dark-charcoal: #2C2C2C;
    --gold-glow: #E8D5A8;
    --cream: #FFFEF0;
}

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

body {
    background: var(--deep-black);
    color: var(--soft-white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Persistent Divider --- */
#divider {
    position: fixed;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100vh;
    background: var(--muted-gold);
    opacity: 0.5;
    z-index: 100;
    transform: translateX(-50%);
    transition: box-shadow 0.5s ease-in-out;
}

#divider.pulse {
    box-shadow: 0 0 8px 2px var(--rich-gold), 0 0 16px 4px rgba(212, 175, 55, 0.3);
    opacity: 0.8;
}

/* --- Navigation --- */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
    padding: 0 4%;
    background: linear-gradient(180deg, rgba(10, 14, 39, 0.9) 0%, rgba(10, 14, 39, 0) 100%);
    pointer-events: none;
}

.nav-left {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--rich-gold);
    pointer-events: auto;
}

.nav-right {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--muted-gold);
    opacity: 0.7;
    pointer-events: auto;
}

/* --- Split-Screen Layout --- */
.split-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
}

.split-left,
.split-right {
    width: 50%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--deep-black) 0%, var(--dark-charcoal) 100%);
}

#hero .split-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    padding: 0 8%;
    text-align: left;
    width: 100%;
}

#hero-title {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: var(--soft-white);
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

#hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(5px);
}

.hero-tagline {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.95rem, 1.6vw, 1.2rem);
    color: var(--muted-gold);
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

#hero .split-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Mesh Containers --- */
.mesh-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.mesh-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Grid Underlay --- */
.grid-underlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(201, 169, 97, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(201, 169, 97, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
}

.grid-underlay-light {
    background-image:
        linear-gradient(to right, rgba(201, 169, 97, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(201, 169, 97, 0.06) 1px, transparent 1px);
}

/* --- Section Styles --- */
.section-dark {
    background: linear-gradient(180deg, var(--deep-black) 0%, var(--dark-charcoal) 100%);
}

.section-light {
    background: var(--soft-white);
    color: var(--dark-charcoal);
}

.section-light .section-label {
    color: var(--muted-gold);
}

.section-light .section-heading {
    color: var(--deep-black);
}

.section-light .body-text {
    color: var(--dark-charcoal);
}

.section-light .margin-note {
    color: var(--muted-gold);
    border-left-color: var(--muted-gold);
}

.section-light .ornament {
    color: var(--muted-gold);
}

/* --- Text Blocks --- */
.text-block {
    padding: 15vh 8% 10vh 8%;
    position: relative;
    z-index: 2;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--muted-gold);
    display: block;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.section-heading {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.06em;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--soft-white);
    margin-bottom: 2rem;
}

.body-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    text-align: justify;
    margin-bottom: 1.5rem;
    color: var(--soft-white);
}

.margin-note {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--gold-glow);
    border-left: 2px solid var(--muted-gold);
    padding-left: 1rem;
    margin: 2rem 0;
    opacity: 0.85;
}

.ornament {
    text-align: center;
    color: var(--muted-gold);
    font-size: 0.6rem;
    letter-spacing: 1em;
    margin-top: 3rem;
    opacity: 0.6;
}

/* --- Fade Reveal --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- Mesh Layers (Progressive Disclosure) --- */
.mesh-layer {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.mesh-layer-1 {
    width: 60%;
    height: 40%;
    top: 20%;
    left: 20%;
    background: radial-gradient(ellipse at 40% 50%, rgba(212, 175, 55, 0.2), rgba(201, 169, 97, 0.1), transparent);
}

.mesh-layer-2 {
    width: 45%;
    height: 35%;
    top: 35%;
    left: 30%;
    background: radial-gradient(ellipse at 60% 40%, rgba(232, 213, 168, 0.15), rgba(201, 169, 97, 0.08), transparent);
}

.mesh-layer-3 {
    width: 30%;
    height: 25%;
    top: 45%;
    left: 40%;
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.25), rgba(44, 44, 44, 0.1), transparent);
}

.mesh-layer.revealed {
    opacity: 1;
}

/* --- Mesh Forms (Section Nature) --- */
.mesh-form {
    position: absolute;
    border-radius: 50%;
    transition: transform 0.1s linear;
}

.mesh-form-a {
    width: 55%;
    height: 45%;
    top: 10%;
    left: 10%;
    background: radial-gradient(ellipse at 35% 45%, rgba(212, 175, 55, 0.25), rgba(10, 14, 39, 0.15), transparent);
}

.mesh-form-b {
    width: 40%;
    height: 30%;
    top: 40%;
    left: 35%;
    background: radial-gradient(ellipse at 50% 50%, rgba(201, 169, 97, 0.2), rgba(44, 44, 44, 0.1), transparent);
}

.mesh-form-c {
    width: 30%;
    height: 35%;
    top: 55%;
    left: 15%;
    background: radial-gradient(ellipse at 60% 40%, rgba(232, 213, 168, 0.18), rgba(10, 14, 39, 0.1), transparent);
}

/* --- Mesh Shimmer (Section Future) --- */
.mesh-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.08), transparent 70%);
    animation: shimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* --- Interstitial Section --- */
#interstitial {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--soft-white) 0%, var(--cream) 100%);
    position: relative;
    overflow: hidden;
}

.interstitial-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.typo-background {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    color: var(--dark-charcoal);
    opacity: 0.12;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
}

.interstitial-ornament {
    margin-top: 2rem;
    opacity: 0.6;
}

/* --- Closing Section --- */
.section-closing {
    background: linear-gradient(180deg, var(--dark-charcoal) 0%, var(--deep-black) 100%);
    min-height: 80vh;
}

.section-closing .split-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-text {
    padding: 10vh 10%;
}

.closing-quote {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.6;
    color: var(--muted-gold);
    border: none;
    margin-bottom: 2rem;
}

.closing-attribution {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--rich-gold);
    text-align: right;
}

/* --- Footer --- */
#footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 4%;
    background: var(--deep-black);
    border-top: 1px solid rgba(201, 169, 97, 0.15);
}

.footer-left {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.footer-brand {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--rich-gold);
}

.footer-year {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--muted-gold);
    opacity: 0.6;
}

.footer-right {
    text-align: right;
}

.footer-note {
    font-family: 'IBM Plex Serif', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--muted-gold);
    opacity: 0.6;
}

/* --- Link Hover Effect --- */
a {
    color: var(--rich-gold);
    text-decoration: none;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--rich-gold);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* --- Responsive: Tablet --- */
@media (max-width: 1023px) {
    .split-section {
        flex-direction: column;
    }

    .split-left,
    .split-right {
        width: 100%;
        min-height: 50vh;
    }

    #divider {
        display: none;
    }

    .text-block {
        padding: 8vh 6%;
    }

    .hero-content {
        padding: 0 6%;
        text-align: center;
    }

    .section-heading {
        font-size: clamp(1.6rem, 4vw, 2.5rem);
    }

    .closing-text {
        text-align: center;
    }

    .closing-attribution {
        text-align: center;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 767px) {
    body {
        font-size: 16px;
    }

    .split-left,
    .split-right {
        min-height: auto;
    }

    #hero .split-left {
        min-height: 60vh;
    }

    #hero .split-right {
        min-height: 40vh;
    }

    .text-block {
        padding: 6vh 5%;
    }

    .hero-content {
        padding: 0 5%;
    }

    .nav-right {
        display: none;
    }

    .section-heading {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .body-text {
        text-align: left;
        font-size: 16px;
    }

    .typo-background {
        font-size: clamp(1.8rem, 10vw, 4rem);
    }

    #footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-left {
        justify-content: center;
    }

    .footer-right {
        text-align: center;
    }

    .grid-underlay {
        background-size: 40px 40px;
    }
}
