/* ==========================================================================
   mujun.day -- Chromatic Academia / Paradox Museum
   Palette: Ivory Quartz, Platinum Mist, Chrome Silver, Burnished Steel,
            Graphite Ink, Obsidian, Paradox Gold, Tarnished Brass
   Fonts: Fraunces (display), Libre Franklin (body), Noto Serif JP (watermark)
   ========================================================================== */

/* --- Reset & Base --- */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #f7f4ef;
    color: #3a3a42;
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Navigation --- */

.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background-color: rgba(192, 192, 196, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #3a3a42;
}

.nav-dropdown {
    position: relative;
}

.nav-rooms-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #7a7a84;
    padding: 0.4rem 0;
    background-image: linear-gradient(#b8a472, #b8a472);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease, color 0.2s ease;
}

.nav-rooms-btn:hover {
    background-size: 100% 1px;
    color: #1e1e24;
}

.nav-rooms-btn:active {
    color: #8e7a52;
}

.nav-rooms-list {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: rgba(247, 244, 239, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(192, 192, 196, 0.4);
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    min-width: 160px;
}

.nav-rooms-list.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-link {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #7a7a84;
    text-decoration: none;
    background-image: linear-gradient(#b8a472, #b8a472);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease, color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background-size: 100% 1px;
    color: #1e1e24;
}

/* --- Gallery Room Base --- */

.gallery-room {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.room-grid {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    grid-template-columns: 1fr minmax(320px, 680px) 1fr;
    min-height: 100vh;
    padding: 4rem 1.5rem;
}

.room-content {
    grid-row: 2;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* --- Watermark --- */

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(15deg);
    font-family: 'Noto Serif JP', serif;
    font-weight: 900;
    font-size: 40vw;
    color: #3a3a42;
    opacity: 0.025;
    pointer-events: none;
    user-select: none;
    line-height: 1;
    white-space: nowrap;
    z-index: 0;
}

.watermark::after {
    content: attr(data-char);
}

.watermark-reversed {
    color: #f7f4ef;
    opacity: 0.04;
}

/* --- Foyer (Section 1) --- */

.foyer {
    background: radial-gradient(ellipse at center, #e8e4df 0%, #c0c0c4 100%);
}

.hero-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6.5rem);
    color: #1e1e24;
    letter-spacing: -0.02em;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-line {
    width: 0;
    height: 1px;
    background-color: #b8a472;
    margin: 1.5rem 0;
    transition: none;
}

.hero-line.is-visible {
    width: 30vw;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-tld {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 4vw, 3.25rem);
    color: #7a7a84;
    letter-spacing: -0.02em;
    opacity: 0;
    transition: none;
}

.hero-tld.is-visible {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-indicator {
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
}

.scroll-indicator.is-visible {
    opacity: 1;
    transition: opacity 0.5s ease;
    animation: pulse-chevron 2s ease-in-out infinite;
}

@keyframes pulse-chevron {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

.chevron-svg {
    display: block;
}

/* --- Section Label & Headings --- */

.section-label {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #7a7a84;
    margin-bottom: 1.5rem;
}

.section-heading {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: #3a3a42;
    letter-spacing: 0.01em;
    line-height: 1.2;
    margin-bottom: 2rem;
}

/* --- Body Text --- */

.body-text {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: #3a3a42;
    max-width: 62ch;
    margin-bottom: 1.5rem;
    text-align: left;
}

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

.body-text em {
    font-style: italic;
    color: #1e1e24;
}

/* --- Room Reveal Animation --- */

.room-reveal .section-label,
.room-reveal .section-heading,
.room-reveal .body-text {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.room-reveal.is-visible .section-label {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

.room-reveal.is-visible .section-heading {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.room-reveal.is-visible .body-text:nth-of-type(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.room-reveal.is-visible .body-text:nth-of-type(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* --- Alternating section backgrounds --- */

#spear {
    background-color: #f7f4ef;
}

#shield {
    background-color: #e8e4df;
}

#paradox {
    background-color: #f7f4ef;
}

#resolution {
    background-color: #e8e4df;
}

/* --- Interstitial SVGs --- */

.interstitial {
    width: 100%;
    height: 80px;
    background-color: #f7f4ef;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.interstitial-svg {
    width: 100%;
    height: 80px;
}

.svg-path {
    transition: stroke-dashoffset 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}

.svg-path.is-drawn {
    stroke-dashoffset: 0 !important;
}

/* --- Chrome Metallic Divider --- */

.chrome-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #c0c0c4 20%, #f7f4ef 50%, #c0c0c4 80%, transparent 100%);
}

/* --- Reading Room (Section 6) --- */

.reading-room {
    background-color: #c0c0c4;
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reading-room.is-visible {
    clip-path: inset(0 0 0 0);
}

.reading-room .room-content {
    align-items: center;
}

.paradox-knot {
    margin-bottom: 3rem;
}

.pull-quote {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: #f7f4ef;
    letter-spacing: -0.02em;
    line-height: 1.4;
    max-width: 62ch;
    margin-bottom: 1.5rem;
    border: none;
    padding: 0;
}

.quote-attribution {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #e8e4df;
    font-style: normal;
}

/* --- Paradox Knot SVG --- */

.knot-left,
.knot-right {
    transition: stroke-dashoffset 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}

.knot-left.is-drawn {
    stroke-dashoffset: 0 !important;
}

.knot-right.is-drawn {
    stroke-dashoffset: 0 !important;
    transition-delay: 0.6s;
}

/* --- Footer --- */

.site-footer {
    background-color: #1e1e24;
    padding: 2rem;
    text-align: center;
}

.footer-text {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7a7a84;
}

/* --- Responsive (below 768px) --- */

@media (max-width: 768px) {
    .room-grid {
        grid-template-columns: 1fr minmax(0, 90vw) 1fr;
        padding: 3rem 1rem;
    }

    .watermark {
        font-size: 60vw;
        opacity: 0.03;
    }

    .nav-bar {
        justify-content: center;
    }

    .nav-dropdown {
        display: none;
    }

    .nav-logo {
        text-align: center;
    }

    .hero-line.is-visible {
        width: 60vw;
    }

    .interstitial {
        height: 60px;
    }

    .body-text {
        max-width: 100%;
    }

    .pull-quote {
        max-width: 100%;
    }
}
