﻿@font-face {
    font-family: "Logo-font";
    src: url("../stylization/font/GreatVibes-Regular.ttf") format("truetype");
    font-display: swap;
}

:root {
    --ink: #2a1911;
    --brown: #3b2418;
    --brown-soft: #604433;
    --cream: #fbf3e6;
    --paper: #fff9ef;
    --vellum: #ead7bc;
    --copper: #b87845;
    --gold: #d5a85c;
    --ember: #f0c178;
    --line: rgba(91, 61, 43, 0.22);
    --shadow: 0 22px 60px rgba(37, 21, 13, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 22% 12%, rgba(240, 193, 120, 0.28), transparent 32%),
        linear-gradient(rgba(251, 243, 230, 0.94), rgba(251, 243, 230, 0.98)),
        url("../stylization/NewBackground.png") center / cover fixed;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.65;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(213, 168, 92, 0.58);
    outline-offset: 4px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(18px, 4vw, 56px);
    background: rgba(251, 243, 230, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
    color: var(--brown);
    font-family: "Logo-font", Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.brand-mark {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 10px 28px rgba(42, 25, 17, 0.16);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.main-nav a {
    padding: 8px 10px;
    border-bottom: 2px solid transparent;
    color: var(--brown-soft);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--ink);
    border-color: var(--copper);
}

.door-hero {
    min-height: calc(100vh - 74px);
    display: grid;
    place-items: center;
    padding: clamp(70px, 10vw, 124px) clamp(20px, 5vw, 72px);
    color: var(--cream);
    background:
        radial-gradient(circle at 50% 42%, rgba(240, 193, 120, 0.34), transparent 19%),
        linear-gradient(90deg, rgba(32, 18, 12, 0.88), rgba(51, 31, 20, 0.68)),
        url("../stylization/Space.png") center / cover;
}

.door-panel {
    width: min(880px, 100%);
    padding: clamp(34px, 6vw, 72px);
    text-align: center;
    background: linear-gradient(rgba(42, 25, 17, 0.74), rgba(42, 25, 17, 0.52));
    border: 1px solid rgba(213, 168, 92, 0.36);
    border-radius: 8px;
    box-shadow: 0 0 90px rgba(240, 193, 120, 0.18);
}

.eyebrow,
.section-kicker,
.shelf-number {
    margin: 0 0 12px;
    color: var(--copper);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.door-hero .eyebrow,
.page-hero .eyebrow {
    color: var(--ember);
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-family: "Logo-font", Georgia, serif;
    font-size: clamp(4.3rem, 11vw, 8.8rem);
    font-weight: 400;
    line-height: 0.9;
}

.page-hero h1 {
    max-width: 880px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.6rem, 5vw, 4.85rem);
    line-height: 1.04;
}

h2 {
    margin: 0 0 18px;
    font-size: clamp(1.9rem, 3.8vw, 3.1rem);
    line-height: 1.1;
    font-weight: 500;
}

h3 {
    margin: 0 0 12px;
    font-size: 1.55rem;
    line-height: 1.15;
}

p {
    margin: 0 0 18px;
}

.threshold-text {
    margin: 22px auto 18px;
    max-width: 620px;
    color: var(--paper);
    font-size: clamp(1.28rem, 2.6vw, 1.85rem);
    line-height: 1.38;
}

.hero-slogan,
.page-hero p {
    max-width: 720px;
    margin: 0 auto 28px;
    color: rgba(251, 243, 230, 0.86);
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

.page-hero .library-whisper {
    color: var(--ember);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-style: italic;
    line-height: 1.45;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 46px;
    margin-top: auto;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    color: var(--paper);
    background: var(--brown);
    border-color: var(--brown);
}

.button.lantern,
.page-hero .button.lantern {
    color: var(--ink);
    background: linear-gradient(180deg, var(--ember), var(--gold));
    border-color: rgba(255, 235, 184, 0.55);
    box-shadow: 0 0 28px rgba(240, 193, 120, 0.28);
}

.section {
    padding: clamp(64px, 9vw, 118px) clamp(20px, 5vw, 72px);
}

.section-heading {
    max-width: 820px;
    margin: 0 auto 42px;
    text-align: center;
}

.section-heading p,
.text-column p,
.contact-card p,
.library-card p:not(.shelf-number) {
    color: var(--brown-soft);
    font-size: 1.08rem;
}

.library-grid,
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto;
}

.library-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.library-card,
.contact-card,
.note-form {
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: clamp(24px, 3vw, 34px);
    background:
        linear-gradient(180deg, rgba(255, 249, 239, 0.94), rgba(246, 230, 207, 0.92));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.library-card.quiet {
    background:
        linear-gradient(180deg, rgba(248, 235, 214, 0.88), rgba(236, 215, 188, 0.82));
}

.page-hero {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(70px, 10vw, 120px) clamp(20px, 5vw, 72px);
    color: var(--cream);
    background:
        radial-gradient(circle at 18% 28%, rgba(240, 193, 120, 0.26), transparent 24%),
        linear-gradient(90deg, rgba(42, 25, 17, 0.88), rgba(63, 40, 27, 0.64)),
        url("../stylization/Space.png") center / cover;
}

.about-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(28px, 6vw, 72px);
    align-items: center;
}

.hero-symbol {
    width: min(250px, 40vw);
    height: auto;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.text-section {
    background: rgba(251, 243, 230, 0.78);
}

.text-column {
    max-width: 860px;
    margin: 0 auto;
}

.note-section {
    display: grid;
    place-items: center;
}

.note-form {
    width: min(760px, 100%);
    min-height: 0;
}

.note-form label {
    margin: 0 0 8px;
    color: var(--brown);
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
}

.note-form input,
.note-form textarea {
    width: 100%;
    margin: 0 0 20px;
    padding: 14px 16px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.legal-main {
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(52px, 8vw, 92px) clamp(20px, 5vw, 44px);
}

.legal-main h1 {
    margin-bottom: 28px;
    color: var(--brown);
    font-size: clamp(3.4rem, 9vw, 6rem);
}

.legal-main h2 {
    margin-top: 38px;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 24px clamp(20px, 5vw, 72px);
    color: var(--cream);
    background: #1f120c;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-links a {
    color: var(--gold);
}

@media (max-width: 1120px) {
    .library-grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .library-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .about-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .site-header {
        position: static;
    }

    .library-header,
    .room-header {
        gap: 16px;
        padding: 16px 18px 18px;
        background: rgba(19, 11, 7, 0.9);
    }

    .brand {
        font-size: 2.2rem;
    }

    .library-header .brand,
    .room-header .brand {
        font-size: 2rem;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .main-nav {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 2px;
    }

    .main-nav a {
        padding: 9px 0;
    }

    .library-header .main-nav,
    .room-header .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 12px;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .library-header .main-nav a,
    .room-header .main-nav a {
        padding: 7px 0;
        font-size: 0.82rem;
        line-height: 1.25;
        border-bottom: 1px solid rgba(213, 168, 92, 0.16);
    }

    .library-header .main-nav a + a::before,
    .room-header .main-nav a + a::before {
        display: none;
    }

    .door-hero,
    .page-hero {
        min-height: 640px;
    }

    .door-panel {
        padding: 28px 20px;
    }

    .button,
    .site-footer {
        width: 100%;
    }

    .site-footer,
    .footer-links {
        flex-direction: column;
    }
}

/* Landing page prototype */
.landing-body {
    min-height: 100vh;
    overflow: hidden;
    background: #110b08;
}

.entry-scene {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 54px);
    color: var(--paper);
    isolation: isolate;
    background:
        radial-gradient(circle at 48% 56%, rgba(240, 193, 120, 0.16), transparent 25%),
        radial-gradient(circle at 16% 74%, rgba(170, 100, 48, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(15, 14, 15, 0.08), rgba(17, 10, 7, 0.72) 64%, rgba(8, 5, 4, 0.94)),
        url("../stylization/Space.png") center / cover;
}

.night-sky,
.forest-line,
.ground-mist,
.cabin-glow,
.dust-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.night-sky {
    z-index: -3;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 244, 211, 0.65) 0 1px, transparent 2px),
        radial-gradient(circle at 76% 14%, rgba(255, 244, 211, 0.45) 0 1px, transparent 2px),
        radial-gradient(circle at 86% 44%, rgba(255, 244, 211, 0.5) 0 1px, transparent 2px);
    opacity: 0.7;
}

.forest-line {
    z-index: -2;
    top: 34%;
    opacity: 0.34;
    background:
        linear-gradient(165deg, transparent 0 42%, rgba(14, 25, 18, 0.52) 42% 46%, transparent 46%),
        linear-gradient(195deg, transparent 0 39%, rgba(13, 23, 17, 0.5) 39% 45%, transparent 45%),
        linear-gradient(175deg, transparent 0 44%, rgba(8, 17, 13, 0.48) 44% 49%, transparent 49%),
        linear-gradient(180deg, transparent 0 47%, rgba(9, 15, 12, 0.58) 47% 100%);
    background-size: 130px 260px, 170px 300px, 210px 320px, 100% 100%;
    background-position: 7% bottom, 52% bottom, 88% bottom, center bottom;
    background-repeat: repeat-x;
    filter: blur(0.4px);
}

.ground-mist {
    z-index: -1;
    top: 48%;
    background:
        radial-gradient(ellipse at 44% 70%, rgba(218, 198, 168, 0.1), transparent 32%),
        radial-gradient(ellipse at 58% 83%, rgba(218, 198, 168, 0.09), transparent 34%),
        linear-gradient(180deg, transparent, rgba(221, 203, 176, 0.08) 62%, transparent);
    filter: blur(9px);
    opacity: 0.72;
    animation: mist-breathe 18s ease-in-out infinite;
}

.cabin-glow {
    z-index: -1;
    background:
        radial-gradient(ellipse at 50% 69%, rgba(240, 193, 120, 0.2), transparent 34%),
        radial-gradient(ellipse at 50% 52%, rgba(124, 65, 28, 0.16), transparent 24%),
        linear-gradient(90deg, rgba(21, 12, 8, 0.48), transparent 36%, transparent 64%, rgba(21, 12, 8, 0.48));
}

.dust-field span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 226, 174, 0.32);
    animation: dust-drift 18s ease-in-out infinite;
}

.dust-field span:nth-child(1) { left: 28%; top: 24%; animation-delay: -1s; }
.dust-field span:nth-child(2) { left: 62%; top: 31%; animation-delay: -5s; }
.dust-field span:nth-child(3) { left: 46%; top: 64%; animation-delay: -8s; }
.dust-field span:nth-child(4) { left: 70%; top: 72%; animation-delay: -2s; }
.dust-field span:nth-child(5) { left: 35%; top: 78%; animation-delay: -6s; }
.dust-field span:nth-child(6) { left: 55%; top: 46%; animation-delay: -10s; }

.door-toggle {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
}

.door-stage {
    position: relative;
    width: min(440px, 82vw);
    height: min(720px, 82vh);
    min-height: 560px;
    display: grid;
    place-items: center;
    perspective: 1400px;
}

.oak-door {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    cursor: pointer;
    transform-origin: left center;
    border: 12px solid #21130d;
    border-radius: 6px 6px 18px 18px;
    background:
        radial-gradient(ellipse at 32% 28%, rgba(255, 220, 151, 0.08), transparent 22%),
        radial-gradient(ellipse at 70% 76%, rgba(0, 0, 0, 0.22), transparent 28%),
        linear-gradient(90deg, rgba(255, 218, 157, 0.08), transparent 18%, rgba(0, 0, 0, 0.28) 74%),
        repeating-linear-gradient(90deg, rgba(255, 236, 190, 0.04) 0 1px, transparent 1px 18px, rgba(0, 0, 0, 0.08) 19px 20px, transparent 20px 46px),
        repeating-linear-gradient(7deg, rgba(255, 236, 190, 0.035) 0 1px, transparent 1px 14px),
        repeating-linear-gradient(172deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 23px),
        linear-gradient(90deg, #52311c, #2a170e 48%, #60371f);
    box-shadow:
        0 34px 80px rgba(0, 0, 0, 0.52),
        inset 0 0 0 1px rgba(255, 226, 174, 0.12),
        inset 18px 0 36px rgba(255, 214, 146, 0.06),
        inset -34px 0 48px rgba(0, 0, 0, 0.38);
    transition: transform 1100ms cubic-bezier(0.2, 0.76, 0.18, 1), filter 800ms ease;
}

.oak-door::before,
.oak-door::after {
    content: "";
    position: absolute;
    inset: 36px 34px;
    border: 1px solid rgba(213, 168, 92, 0.18);
    border-radius: 150px 150px 10px 10px;
    box-shadow:
        inset 0 0 34px rgba(0, 0, 0, 0.32),
        inset 0 0 0 8px rgba(46, 25, 14, 0.22);
}

.oak-door::after {
    inset: auto 44px 38px;
    height: 46%;
    border-radius: 10px;
}

.stained-glass {
    position: absolute;
    top: 48px;
    left: 50%;
    width: 116px;
    height: 92px;
    transform: translateX(-50%);
    border: 6px solid #8f6735;
    border-radius: 58px 58px 10px 10px;
    background:
        radial-gradient(circle at 52% 74%, rgba(255, 230, 165, 0.5), transparent 22%),
        linear-gradient(135deg, rgba(67, 112, 117, 0.34), rgba(222, 167, 90, 0.26)),
        repeating-linear-gradient(90deg, transparent 0 25px, rgba(255, 238, 194, 0.14) 25px 27px),
        repeating-linear-gradient(0deg, transparent 0 28px, rgba(255, 238, 194, 0.1) 28px 30px);
    box-shadow: inset 0 0 30px rgba(240, 193, 120, 0.28), 0 0 34px rgba(240, 193, 120, 0.16);
}

.candle-light {
    position: absolute;
    left: 50%;
    bottom: 12px;
    width: 24px;
    height: 38px;
    transform: translateX(-50%);
    border-radius: 50% 50% 42% 42%;
    background: radial-gradient(circle, #fff5c9 0 18%, #f0c178 42%, rgba(240, 193, 120, 0) 72%);
    animation: flame-breathe 2.8s ease-in-out infinite;
}

.door-plaque {
    position: absolute;
    top: 178px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 210px;
    padding: 8px 18px;
    color: #f8dfac;
    text-align: center;
    font-family: "Logo-font", Georgia, serif;
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    line-height: 1;
    border: 1px solid rgba(213, 168, 92, 0.48);
    border-radius: 8px;
    background: rgba(43, 25, 15, 0.64);
}

.hinge,
.handle,
.knocker {
    position: absolute;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 236, 181, 0.48), transparent 18%),
        linear-gradient(135deg, #735029, #d0a052 44%, #5d3b1e);
    box-shadow:
        inset 0 0 9px rgba(255, 240, 194, 0.22),
        inset 0 -8px 14px rgba(62, 38, 18, 0.28),
        0 5px 14px rgba(0, 0, 0, 0.36);
}

.hinge {
    left: -18px;
    width: 34px;
    height: 84px;
    border-radius: 6px;
}

.hinge-top { top: 96px; }
.hinge-mid { top: 48%; transform: translateY(-50%); }
.hinge-bottom { bottom: 96px; }

.handle {
    right: 58px;
    top: 53%;
    width: 26px;
    height: 96px;
    border-radius: 20px;
}

.knocker {
    left: 50%;
    top: 39%;
    width: 92px;
    height: 92px;
    transform: translateX(-50%);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, transparent 0 34%, #d5a85c 37% 47%, #76502a 50% 62%, transparent 65%),
        radial-gradient(circle at 48% 16%, #d5a85c 0 7%, #6b4522 8% 14%, transparent 15%),
        linear-gradient(135deg, #7b552e, #d5a85c 46%, #5b381c);
}

.lantern {
    position: absolute;
    left: -118px;
    top: 42px;
    width: 92px;
    height: 152px;
    z-index: 3;
    transform-origin: 50% 0;
    filter: drop-shadow(0 0 22px rgba(240, 193, 120, 0.34));
    animation: lantern-sway 7.5s ease-in-out infinite;
}

.lantern-cap,
.lantern-frame {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.lantern-cap {
    top: 0;
    width: 48px;
    height: 20px;
    border: 2px solid #70502c;
    border-radius: 20px 20px 5px 5px;
    background:
        linear-gradient(180deg, #4a321c, #1d120c);
}

.lantern-cap::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -24px;
    width: 32px;
    height: 32px;
    transform: translateX(-50%);
    border: 3px solid #6b4a29;
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
}

.lantern-frame {
    top: 20px;
    width: 66px;
    height: 112px;
    border: 3px solid #6f4d2a;
    border-radius: 24px 24px 14px 14px;
    background:
        linear-gradient(90deg, rgba(255, 245, 209, 0.08), rgba(255, 226, 154, 0.02) 48%, rgba(0, 0, 0, 0.18)),
        radial-gradient(ellipse at 50% 64%, rgba(240, 193, 120, 0.2), transparent 58%);
    box-shadow:
        inset 0 0 18px rgba(240, 193, 120, 0.12),
        inset 10px 0 18px rgba(255, 244, 211, 0.04),
        inset -10px 0 16px rgba(0, 0, 0, 0.22);
}

.lantern-frame::before,
.lantern-frame::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: rgba(126, 88, 47, 0.72);
}

.lantern-frame::before {
    left: 18px;
}

.lantern-frame::after {
    right: 18px;
}

.flame {
    position: absolute;
    left: 50%;
    top: 72px;
    width: 18px;
    height: 32px;
    transform: translateX(-50%);
    border-radius: 50% 50% 42% 42%;
    background: radial-gradient(circle, #fff7d7 0 12%, #f0c178 43%, #b87845 70%, transparent 76%);
    animation: flame-breathe 3.8s ease-in-out infinite;
}

.threshold-message {
    position: relative;
    z-index: 1;
    width: min(820px, 92vw);
    max-width: 820px;
    padding: clamp(46px, 7vw, 92px) clamp(24px, 6vw, 76px);
    text-align: center;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1200ms ease 640ms, transform 1200ms ease 640ms;
}

.threshold-message h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4.6vw, 3.85rem);
    line-height: 1.16;
    font-weight: 400;
    text-wrap: balance;
}

.threshold-message p {
    margin: clamp(24px, 4vw, 38px) auto clamp(34px, 5vw, 54px);
    color: rgba(255, 249, 239, 0.88);
    font-size: clamp(1.12rem, 2.1vw, 1.42rem);
    line-height: 1.58;
}

.entry-button {
    margin-top: 0;
    min-height: 40px;
    padding: 9px 15px;
    font-size: 0.84rem;
    font-weight: 700;
    opacity: 0.88;
}

.door-toggle:checked ~ .door-stage .oak-door {
    transform: rotateY(-82deg);
    filter: brightness(0.8);
}

.door-toggle:checked ~ .door-stage .threshold-message {
    opacity: 1;
    transform: translateY(0);
}

@keyframes flame-breathe {
    0%, 100% {
        transform: translateX(-50%) scale(0.98, 1);
        opacity: 0.82;
    }
    50% {
        transform: translateX(-48%) scale(1.04, 0.96);
        opacity: 0.96;
    }
}

@keyframes dust-drift {
    0%, 100% {
        transform: translate3d(0, 0, 0);
        opacity: 0.08;
    }
    50% {
        transform: translate3d(10px, -16px, 0);
        opacity: 0.24;
    }
}

@keyframes lantern-sway {
    0%, 100% {
        transform: rotate(-0.65deg);
    }
    50% {
        transform: rotate(0.55deg);
    }
}

@keyframes mist-breathe {
    0%, 100% {
        transform: translateX(-6px);
        opacity: 0.55;
    }
    50% {
        transform: translateX(8px);
        opacity: 0.72;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dust-field span,
    .flame,
    .candle-light,
    .lantern,
    .ground-mist {
        animation: none;
    }

    .oak-door,
    .threshold-message {
        transition: none;
    }
}

@media (max-width: 760px) {
    .entry-scene {
        padding: 18px;
    }

    .door-stage {
        width: min(360px, 88vw);
        height: min(620px, 78vh);
        min-height: 520px;
    }

    .lantern {
        left: -2px;
        top: -20px;
        transform: scale(0.78);
        transform-origin: top left;
        animation: none;
    }

    .door-plaque {
        min-width: 180px;
    }

    .threshold-message {
        padding: 34px 14px;
    }
}

/* Library room */
.library-body {
    min-height: 100vh;
    background: #120b07;
}

.library-header {
    background: rgba(24, 14, 9, 0.62);
    border-bottom-color: rgba(213, 168, 92, 0.2);
    color: var(--paper);
}

.library-header .brand,
.library-header .main-nav a {
    color: rgba(255, 249, 239, 0.82);
}

.library-header .main-nav a:hover,
.library-header .main-nav a.active {
    color: var(--paper);
    border-color: rgba(213, 168, 92, 0.62);
}

.library-room {
    position: relative;
    min-height: calc(100vh - 74px);
    padding: clamp(88px, 11vw, 150px) clamp(20px, 5vw, 72px);
    color: var(--paper);
    overflow: hidden;
    isolation: isolate;
}

.library-room-art,
.library-room-shade,
.library-dust {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.library-room-art {
    z-index: -4;
    background:
        linear-gradient(180deg, rgba(18, 11, 7, 0.02), rgba(18, 11, 7, 0.3)),
        url("../stylization/library-interior-v1.jpg") center / cover no-repeat;
    transform: scale(1.012);
    animation: library-room-breathe 36s ease-out forwards;
}

.library-room-shade {
    z-index: -2;
    background:
        radial-gradient(ellipse at 30% 38%, rgba(255, 188, 93, 0.08), transparent 28%),
        radial-gradient(ellipse at 50% 42%, transparent 0 28%, rgba(14, 8, 5, 0.28) 62%, rgba(9, 5, 3, 0.84) 100%),
        linear-gradient(90deg, rgba(8, 5, 3, 0.42), rgba(8, 5, 3, 0.14) 48%, rgba(8, 5, 3, 0.42)),
        linear-gradient(180deg, rgba(10, 6, 4, 0.18), rgba(10, 6, 4, 0.66));
}

.library-dust span {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 219, 155, 0.2);
    box-shadow: 0 0 7px rgba(255, 184, 92, 0.12);
    animation: library-dust-drift 28s ease-in-out infinite;
}

.library-dust span:nth-child(1) { left: 28%; top: 32%; animation-delay: -6s; }
.library-dust span:nth-child(2) { left: 58%; top: 38%; animation-delay: -14s; }
.library-dust span:nth-child(3) { left: 44%; top: 68%; animation-delay: -9s; }
.library-dust span:nth-child(4) { left: 72%; top: 58%; animation-delay: -19s; }

.library-room-intro {
    position: relative;
    z-index: 1;
    width: min(780px, 100%);
    margin-bottom: clamp(70px, 9vw, 112px);
    text-shadow: 0 5px 30px rgba(0, 0, 0, 0.74);
}

.library-room-intro .library-whisper {
    margin: 0 0 32px;
    color: rgba(244, 204, 139, 0.9);
    font-style: italic;
    line-height: 1.7;
}

.library-room-intro h1 {
    max-width: 780px;
    margin: 0 0 24px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 5.2vw, 5rem);
    font-weight: 400;
    line-height: 1.04;
}

.library-room-intro > p:last-child {
    max-width: 680px;
    color: rgba(255, 249, 239, 0.86);
    font-size: clamp(1.05rem, 1.8vw, 1.26rem);
    line-height: 1.78;
}

.library-shelves {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(22px, 3vw, 34px);
    width: min(1120px, 100%);
}

.book-object {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 22px;
    min-height: 260px;
    padding: clamp(26px, 3.4vw, 42px);
    background:
        linear-gradient(90deg, rgba(32, 18, 11, 0.82), rgba(42, 25, 15, 0.58)),
        linear-gradient(180deg, rgba(255, 235, 188, 0.075), rgba(0, 0, 0, 0.12));
    border: 1px solid rgba(213, 168, 92, 0.16);
    border-radius: 8px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34), inset 0 0 34px rgba(255, 226, 174, 0.035);
    backdrop-filter: blur(2px);
}

.book-object h2 {
    margin-bottom: 14px;
    color: rgba(255, 249, 239, 0.94);
    font-size: clamp(1.5rem, 2.8vw, 2.3rem);
}

.book-object p {
    color: rgba(255, 249, 239, 0.8);
    line-height: 1.75;
}

.book-object .shelf-number {
    color: rgba(240, 193, 120, 0.74);
}

.book-line {
    color: rgba(244, 204, 139, 0.92) !important;
    font-style: italic;
}

.book-spine {
    display: block;
    min-height: 190px;
    border-radius: 6px;
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.16), transparent 32%, rgba(0, 0, 0, 0.18)),
        linear-gradient(180deg, #5b241c, #2e1710);
    border: 1px solid rgba(213, 168, 92, 0.28);
    box-shadow: inset 9px 0 18px rgba(255, 226, 174, 0.06), inset -10px 0 18px rgba(0, 0, 0, 0.25);
}

.audio-spine {
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.16), transparent 32%, rgba(0, 0, 0, 0.18)),
        linear-gradient(180deg, #51402a, #21170f);
}

.article-spine {
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.16), transparent 32%, rgba(0, 0, 0, 0.18)),
        linear-gradient(180deg, #7a3a22, #24130e);
}

.thought-spine {
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.16), transparent 32%, rgba(0, 0, 0, 0.18)),
        linear-gradient(180deg, #6b4c2f, #22150f);
}

.reading-spine {
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.14), transparent 32%, rgba(0, 0, 0, 0.2)),
        linear-gradient(180deg, #5d4635, #241711);
}


.notes-spine {
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.13), transparent 32%, rgba(0, 0, 0, 0.2)),
        linear-gradient(180deg, #73523c, #2b1a12);
}
.future-spine {
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.1), transparent 32%, rgba(0, 0, 0, 0.2)),
        linear-gradient(180deg, #3e3527, #1c1510);
}

.future-spine.muted {
    background:
        linear-gradient(90deg, rgba(255, 235, 188, 0.08), transparent 32%, rgba(0, 0, 0, 0.2)),
        linear-gradient(180deg, #342b22, #18120e);
}

.book-quiet {
    opacity: 0.78;
}

.book-link {
    display: inline-flex;
    width: fit-content;
    margin-top: 14px;
    color: rgba(240, 193, 120, 0.84);
    border-bottom: 1px solid rgba(240, 193, 120, 0.22);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.book-link:hover {
    color: var(--paper);
    border-color: rgba(240, 193, 120, 0.66);
}

.library-footer {
    background: #100905;
}

@keyframes library-room-breathe {
    from {
        transform: scale(1.012) translate3d(0, 0, 0);
    }
    to {
        transform: scale(1.028) translate3d(-2px, 1px, 0);
    }
}

@keyframes library-dust-drift {
    0%, 100% {
        opacity: 0.035;
        transform: translate3d(0, 0, 0);
    }
    50% {
        opacity: 0.15;
        transform: translate3d(8px, -14px, 0);
    }
}

@media (max-width: 900px) {
    .library-shelves {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .library-room {
        padding: 66px 18px;
    }

    .book-object {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 16px;
    }
}

/* Shared house rooms */
.room-body {
    min-height: 100vh;
    background: #120b07;
}

.library-body::after,
.room-body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    background: #100905;
    opacity: 0;
    transition: opacity 520ms ease;
}

.library-body.room-leaving::after,
.room-body.room-leaving::after {
    opacity: 0.72;
}

.room-header {
    background: rgba(24, 14, 9, 0.62);
    border-bottom-color: rgba(213, 168, 92, 0.2);
    color: var(--paper);
}

.room-header .brand,
.room-header .main-nav a {
    color: rgba(255, 249, 239, 0.82);
}

.room-header .main-nav a:hover,
.room-header .main-nav a.active {
    color: var(--paper);
    border-color: rgba(213, 168, 92, 0.62);
}

.library-header .main-nav,
.room-header .main-nav {
    position: relative;
    gap: 0;
    padding: 4px 10px;
    background:
        linear-gradient(180deg, rgba(55, 34, 20, 0.34), rgba(21, 12, 8, 0.28));
    border: 1px solid rgba(213, 168, 92, 0.16);
    border-radius: 999px;
    box-shadow: inset 0 0 18px rgba(255, 226, 174, 0.04);
}

.library-header .main-nav a,
.room-header .main-nav a {
    position: relative;
    padding: 7px 12px;
    border-bottom: 0;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.library-header .main-nav a + a::before,
.room-header .main-nav a + a::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 50%;
    width: 3px;
    height: 3px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(213, 168, 92, 0.36);
}

.library-header .main-nav a.active,
.room-header .main-nav a.active {
    color: rgba(255, 249, 239, 0.96);
    text-shadow: 0 0 16px rgba(240, 193, 120, 0.18);
}

.room-page {
    position: relative;
    min-height: calc(100vh - 74px);
    padding: clamp(88px, 11vw, 150px) clamp(20px, 5vw, 72px);
    color: var(--paper);
    overflow: hidden;
    isolation: isolate;
}

.room-art,
.room-shade,
.room-dust,
.room-light-ray,
.room-ember {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.room-art {
    z-index: -4;
    background:
        linear-gradient(180deg, rgba(18, 11, 7, 0.08), rgba(18, 11, 7, 0.34)),
        url("../stylization/library-interior-v1.jpg") center / cover no-repeat;
    transform: scale(1.018);
}

.reading-room-page .room-art {
    background:
        linear-gradient(180deg, rgba(18, 11, 7, 0.08), rgba(18, 11, 7, 0.34)),
        url("../stylization/reading-room-v1.jpg") center / cover no-repeat;
}

.notes-room-page .room-art {
    background:
        linear-gradient(180deg, rgba(18, 11, 7, 0.08), rgba(18, 11, 7, 0.34)),
        url("../stylization/traveler-notes-v1.jpg") center / cover no-repeat;
}

.about-room-page .room-art {
    background:
        linear-gradient(180deg, rgba(18, 11, 7, 0.08), rgba(18, 11, 7, 0.34)),
        url("../stylization/about-study-v1.jpg") center / cover no-repeat;
}

.contact-room-page .room-art {
    background:
        linear-gradient(180deg, rgba(18, 11, 7, 0.08), rgba(18, 11, 7, 0.34)),
        url("../stylization/contact-desk-v1.jpg") center / cover no-repeat;
}

.room-shade {
    z-index: -2;
    background:
        radial-gradient(ellipse at 30% 38%, rgba(255, 188, 93, 0.075), transparent 30%),
        radial-gradient(ellipse at 52% 44%, transparent 0 25%, rgba(14, 8, 5, 0.36) 66%, rgba(9, 5, 3, 0.88) 100%),
        linear-gradient(90deg, rgba(8, 5, 3, 0.46), rgba(8, 5, 3, 0.16) 48%, rgba(8, 5, 3, 0.44)),
        linear-gradient(180deg, rgba(10, 6, 4, 0.18), rgba(10, 6, 4, 0.7));
}

.room-dust span {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 219, 155, 0.18);
    box-shadow: 0 0 7px rgba(255, 184, 92, 0.1);
    animation: library-dust-drift 30s ease-in-out infinite;
}

.room-dust span:nth-child(1) { left: 30%; top: 36%; animation-delay: -7s; }
.room-dust span:nth-child(2) { left: 54%; top: 46%; animation-delay: -16s; }
.room-dust span:nth-child(3) { left: 70%; top: 62%; animation-delay: -22s; }

.room-light-ray {
    z-index: -1;
    background:
        linear-gradient(112deg, transparent 0 18%, rgba(255, 214, 148, 0.07) 32%, transparent 50%),
        linear-gradient(78deg, transparent 0 52%, rgba(255, 214, 148, 0.045) 65%, transparent 80%);
    opacity: 0.52;
    animation: room-light-breathe 24s ease-in-out infinite;
}

.room-ember {
    z-index: -1;
    background:
        radial-gradient(ellipse at 24% 72%, rgba(239, 132, 48, 0.15), transparent 24%),
        radial-gradient(ellipse at 68% 78%, rgba(240, 193, 120, 0.075), transparent 26%);
    mix-blend-mode: screen;
    opacity: 0.58;
    animation: hearth-flicker 10s ease-in-out infinite;
}

.room-intro {
    position: relative;
    z-index: 1;
    width: min(780px, 100%);
    margin-bottom: clamp(64px, 8.5vw, 104px);
    text-shadow: 0 5px 30px rgba(0, 0, 0, 0.74);
}

.room-intro h1 {
    max-width: 820px;
    margin: 0 0 24px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.45rem, 5vw, 4.8rem);
    font-weight: 400;
    line-height: 1.05;
}

.room-quote {
    max-width: 690px;
    color: rgba(255, 249, 239, 0.86);
    font-size: clamp(1.08rem, 2vw, 1.34rem);
    font-style: italic;
    line-height: 1.78;
}

.room-panel {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    padding: clamp(30px, 4.6vw, 54px);
    background:
        linear-gradient(90deg, rgba(32, 18, 11, 0.82), rgba(42, 25, 15, 0.56)),
        linear-gradient(180deg, rgba(255, 235, 188, 0.07), rgba(0, 0, 0, 0.12));
    border: 1px solid rgba(213, 168, 92, 0.16);
    border-radius: 8px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.34), inset 0 0 34px rgba(255, 226, 174, 0.035);
    backdrop-filter: blur(2px);
}

.room-panel h2 {
    color: rgba(255, 249, 239, 0.94);
}

.room-panel p {
    color: rgba(255, 249, 239, 0.81);
    line-height: 1.76;
}

.room-link {
    display: inline-flex;
    width: fit-content;
    margin-top: 18px;
    color: rgba(240, 193, 120, 0.84);
    border: 0;
    border-bottom: 1px solid rgba(240, 193, 120, 0.22);
    background: transparent;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.room-link:hover {
    color: var(--paper);
    border-color: rgba(240, 193, 120, 0.66);
}

.room-note-form {
    width: 100%;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.room-note-form input,
.room-note-form textarea {
    color: var(--paper);
    background: rgba(20, 12, 8, 0.66);
    border-color: rgba(213, 168, 92, 0.28);
}

.room-note-form input::placeholder,
.room-note-form textarea::placeholder {
    color: rgba(255, 249, 239, 0.42);
}

.note-submit {
    padding: 0;
}

.note-form-status {
    min-height: 1.5em;
    margin: 12px 0 0;
    color: rgba(238, 205, 145, 0.9);
    font-size: 0.95rem;
}

.note-submit:disabled {
    cursor: wait;
    opacity: 0.62;
}

.public-notes-panel {
    margin-top: clamp(28px, 5vw, 54px);
}

.public-notes-panel h2 {
    margin-top: 0;
    color: var(--paper);
    font-size: clamp(1.7rem, 4vw, 2.7rem);
    font-weight: 400;
}

.public-notes-list {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.public-note {
    padding: 18px 0;
    border-top: 1px solid rgba(213, 168, 92, 0.18);
}

.public-note p {
    margin: 0;
    color: rgba(255, 249, 239, 0.78);
    font-size: clamp(1.02rem, 2vw, 1.16rem);
    line-height: 1.72;
    font-style: italic;
}

.public-note footer {
    margin-top: 12px;
    color: rgba(238, 205, 145, 0.72);
    font-size: 0.86rem;
}

.muted-note {
    color: rgba(255, 249, 239, 0.56);
    font-style: italic;
}

.reflection-note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(213, 168, 92, 0.18);
}

.reflection-note h3 {
    margin: 0 0 8px;
    color: rgba(238, 205, 145, 0.9);
    font-size: 0.84rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reflection-note p {
    margin: 0;
    font-style: italic;
}

.newsletter-panel {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
    gap: clamp(28px, 6vw, 72px);
    width: min(1080px, calc(100% - 36px));
    margin: clamp(10px, 4vw, 36px) auto clamp(64px, 8vw, 112px);
    padding: clamp(24px, 5vw, 46px);
    background:
        linear-gradient(135deg, rgba(50, 30, 17, 0.72), rgba(18, 10, 6, 0.84));
    border: 1px solid rgba(213, 168, 92, 0.22);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.newsletter-panel h2 {
    margin: 0 0 18px;
    color: var(--paper);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 400;
    line-height: 1.14;
}

.newsletter-panel p {
    color: rgba(255, 249, 239, 0.74);
}

.newsletter-form {
    display: grid;
    gap: 12px;
}

.newsletter-form label {
    color: rgba(255, 244, 223, 0.84);
    font-size: 0.92rem;
}

.newsletter-form label span {
    color: rgba(255, 244, 223, 0.5);
}

.newsletter-form input {
    width: 100%;
    padding: 12px 14px;
    color: var(--paper);
    background: rgba(20, 12, 8, 0.66);
    border: 1px solid rgba(213, 168, 92, 0.28);
    font: inherit;
}

.newsletter-consent {
    margin: 4px 0 8px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.newsletter-status {
    min-height: 1.5em;
    margin: 0;
    color: rgba(238, 205, 145, 0.9);
    font-size: 0.95rem;
}

.newsletter-submit:disabled {
    cursor: wait;
    opacity: 0.62;
}

.article-newsletter {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    max-width: 68ch;
    margin: clamp(38px, 7vw, 68px) auto 0;
    padding: clamp(22px, 5vw, 38px);
    background: linear-gradient(135deg, rgba(54, 32, 18, 0.58), rgba(18, 10, 6, 0.72));
}

.article-newsletter h2 {
    font-size: clamp(1.55rem, 4vw, 2.35rem);
}

.article-body {
    background: #120b07;
}

.article-page {
    align-items: start;
    padding: clamp(72px, 10vw, 128px) 18px clamp(72px, 10vw, 120px);
}

.article-room-art {
    background:
        linear-gradient(rgba(18, 10, 6, 0.44), rgba(18, 10, 6, 0.9)),
        url("../stylization/library-interior-v1.jpg") center / cover no-repeat;
}

.article-paper {
    position: relative;
    z-index: 2;
    width: min(820px, 100%);
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px);
    color: rgba(255, 249, 239, 0.82);
    background: linear-gradient(135deg, rgba(48, 30, 18, 0.84), rgba(18, 10, 6, 0.9));
    border: 1px solid rgba(213, 168, 92, 0.24);
    box-shadow: 0 28px 110px rgba(0, 0, 0, 0.42);
}

.article-paper h1 {
    margin: 0 0 clamp(28px, 5vw, 46px);
    color: var(--paper);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1.05;
}

.article-paper p {
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    line-height: 1.82;
}

.article-paper strong {
    color: rgba(255, 244, 223, 0.96);
    font-weight: 600;
}

.article-reflection {
    max-width: 68ch;
    margin: clamp(34px, 6vw, 58px) auto 0;
    padding-top: clamp(24px, 4vw, 36px);
    border-top: 1px solid rgba(213, 168, 92, 0.24);
}

.article-reflection h2 {
    margin-bottom: 18px;
    color: rgba(238, 205, 145, 0.92);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.article-reflection ul {
    margin: 0;
    padding-left: 1.2rem;
}

.article-reflection li {
    margin-bottom: 14px;
    color: rgba(255, 249, 239, 0.78);
    font-size: clamp(1.02rem, 2vw, 1.16rem);
    line-height: 1.72;
}

.article-next-door {
    margin-top: clamp(34px, 6vw, 54px);
    text-align: center;
}

.articles-list {
    display: grid;
    gap: clamp(24px, 4vw, 38px);
    margin-top: clamp(34px, 6vw, 56px);
}

.article-list-item {
    padding-top: clamp(22px, 4vw, 34px);
    border-top: 1px solid rgba(213, 168, 92, 0.18);
}

.article-list-item h2,
.article-detail h2 {
    margin: 0 0 16px;
    color: rgba(255, 249, 239, 0.94);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.12;
}

.article-list-item p,
.article-detail .article-intro {
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 249, 239, 0.78);
    font-size: clamp(1.05rem, 2vw, 1.18rem);
    line-height: 1.78;
}

.article-list-item .room-link {
    display: flex;
    width: fit-content;
    margin: 18px auto 0;
}

.article-detail {
    margin-top: clamp(34px, 6vw, 56px);
}

.article-generated-body {
    margin-top: clamp(30px, 5vw, 48px);
}

.article-generated-body p {
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 249, 239, 0.82);
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    line-height: 1.82;
}

.thought-grain-room-art {
    background:
        linear-gradient(rgba(18, 10, 6, 0.44), rgba(18, 10, 6, 0.9)),
        url("../stylization/library-interior-v1.jpg") center / cover no-repeat;
}

.thought-grain-manuscript {
    position: relative;
    z-index: 2;
    width: min(820px, 100%);
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px);
    color: rgba(255, 249, 239, 0.82);
    background: linear-gradient(135deg, rgba(48, 30, 18, 0.84), rgba(18, 10, 6, 0.9));
    border: 1px solid rgba(213, 168, 92, 0.24);
    border-radius: 0;
    box-shadow: 0 28px 110px rgba(0, 0, 0, 0.42);
}

.thought-grain-manuscript::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(213, 168, 92, 0.12);
    pointer-events: none;
}

.thought-grain-manuscript .eyebrow {
    color: rgba(240, 193, 120, 0.74);
}

.thought-grain-manuscript h1 {
    margin: 0 0 12px;
    color: rgba(255, 249, 239, 0.96);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 6vw, 4.8rem);
    line-height: 1.04;
}

.thought-grain-manuscript time {
    display: block;
    margin-bottom: clamp(28px, 5vw, 48px);
    color: rgba(240, 193, 120, 0.62);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.daily-thought {
    max-width: 780px;
    margin: 0 auto clamp(30px, 5vw, 52px);
    padding: clamp(18px, 4vw, 32px) 0;
    color: rgba(244, 204, 139, 0.94);
    border-top: 1px solid rgba(213, 168, 92, 0.22);
    border-bottom: 1px solid rgba(213, 168, 92, 0.22);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 3.2vw, 2.35rem);
    line-height: 1.28;
}

.thought-grain-content p,
.thought-grain-reflection p {
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 249, 239, 0.8);
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    line-height: 1.86;
}

.thought-grain-reflection {
    border-top-color: rgba(213, 168, 92, 0.24);
}

.thought-grain-reflection h2 {
    color: rgba(238, 205, 145, 0.92);
}

.thought-note-button {
    display: flex;
    width: fit-content;
    margin: clamp(20px, 4vw, 30px) auto 0;
    color: rgba(240, 193, 120, 0.84);
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(240, 193, 120, 0.22);
    cursor: default;
}

@media (max-width: 620px) {
    .thought-grain-manuscript {
        padding: 34px 22px;
    }
}

.about-room-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(28px, 6vw, 72px);
    align-items: center;
}

.room-symbol {
    width: min(190px, 32vw);
    opacity: 0.88;
}

.desk-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 44px);
    width: min(1120px, 100%);
}

.desk-links article {
    min-width: 0;
    padding: 18px 0 4px;
    background: transparent;
    border-top: 1px solid rgba(213, 168, 92, 0.18);
    border-radius: 0;
}

.desk-links h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.room-footer {
    background: #100905;
}

.room-object {
    position: absolute;
    z-index: 1;
    right: clamp(22px, 5vw, 76px);
    bottom: clamp(34px, 6vw, 86px);
    width: 178px;
    height: 118px;
    pointer-events: none;
    opacity: 0.46;
    filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.28));
}

.library-object {
    right: clamp(24px, 7vw, 110px);
    bottom: clamp(42px, 8vw, 116px);
}

.reading-object {
    right: clamp(26px, 8vw, 130px);
    bottom: clamp(48px, 9vw, 128px);
}

.notes-object,
.contact-object {
    right: clamp(22px, 6vw, 92px);
    bottom: clamp(36px, 7vw, 104px);
}

.study-object {
    right: clamp(24px, 7vw, 118px);
    bottom: clamp(44px, 8vw, 120px);
}

.room-object span {
    position: absolute;
    display: block;
}

.object-map,
.object-notes,
.object-envelope {
    left: 20px;
    top: 32px;
    width: 116px;
    height: 58px;
    border-radius: 5px;
    background:
        linear-gradient(135deg, rgba(126, 80, 38, 0.1), transparent 45%),
        linear-gradient(180deg, #d7bd86, #a8753e);
    border: 1px solid rgba(86, 48, 22, 0.42);
    transform: rotate(-5deg);
    box-shadow: inset 0 0 18px rgba(255, 236, 190, 0.15);
}

.object-map::before,
.object-notes::before {
    content: "";
    position: absolute;
    inset: 12px 14px;
    border-top: 1px solid rgba(72, 42, 22, 0.28);
    border-bottom: 1px solid rgba(72, 42, 22, 0.18);
}

.object-glasses {
    left: 56px;
    top: 18px;
    width: 64px;
    height: 28px;
    border: 2px solid rgba(39, 24, 15, 0.72);
    border-left-width: 8px;
    border-right-width: 8px;
    border-radius: 40px;
    transform: rotate(8deg);
}

.object-glasses::before {
    content: "";
    position: absolute;
    left: 27px;
    top: 10px;
    width: 12px;
    border-top: 2px solid rgba(39, 24, 15, 0.72);
}

.object-pen,
.object-quill,
.object-pencil,
.object-knife {
    left: 36px;
    top: 74px;
    width: 118px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2b1a12, #c89a51 78%, #fff0c5);
    transform: rotate(-18deg);
}

.object-cup {
    left: 48px;
    top: 46px;
    width: 62px;
    height: 38px;
    border-radius: 8px 8px 20px 20px;
    background: linear-gradient(180deg, #d9c2a0, #7b5436);
    border: 1px solid rgba(255, 236, 190, 0.22);
}

.object-cup::after {
    content: "";
    position: absolute;
    right: -16px;
    top: 8px;
    width: 18px;
    height: 18px;
    border: 4px solid rgba(183, 133, 78, 0.7);
    border-left: 0;
    border-radius: 0 18px 18px 0;
}

.object-steam {
    left: 60px;
    top: 4px;
    width: 46px;
    height: 48px;
    opacity: 0.32;
    background:
        radial-gradient(ellipse at 25% 70%, rgba(255, 249, 239, 0.45), transparent 34%),
        radial-gradient(ellipse at 58% 44%, rgba(255, 249, 239, 0.34), transparent 36%);
    filter: blur(8px);
    animation: tea-steam 9s ease-in-out infinite;
}

.object-book-small {
    left: 14px;
    top: 82px;
    width: 112px;
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(90deg, #40241a, #a36e3f 52%, #2a1710);
    transform: rotate(3deg);
}

.object-ink,
.object-inkwell {
    left: 26px;
    top: 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px 12px 16px 16px;
    background: linear-gradient(180deg, #211711, #070504);
    border: 2px solid rgba(183, 133, 78, 0.48);
}

.object-seal {
    left: 88px;
    top: 72px;
    width: 34px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle, #8d2018, #3d0e0b);
    transform: rotate(-7deg);
}

.object-envelope::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(28deg, transparent 49%, rgba(91, 55, 27, 0.28) 50%, transparent 51%),
        linear-gradient(152deg, transparent 49%, rgba(91, 55, 27, 0.22) 50%, transparent 51%);
}

.object-compass {
    left: 92px;
    top: 54px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 236, 190, 0.45), transparent 28%),
        radial-gradient(circle, #b98745, #2b1a12 68%);
    border: 1px solid rgba(255, 236, 190, 0.18);
}

@keyframes room-light-breathe {
    0%, 100% {
        opacity: 0.42;
        transform: translateX(-4px);
    }
    50% {
        opacity: 0.62;
        transform: translateX(5px);
    }
}

@keyframes hearth-flicker {
    0%, 100% {
        opacity: 0.52;
    }
    45% {
        opacity: 0.68;
    }
    60% {
        opacity: 0.58;
    }
}

@keyframes tea-steam {
    0%, 100% {
        opacity: 0.18;
        transform: translateY(4px);
    }
    50% {
        opacity: 0.34;
        transform: translateY(-8px);
    }
}

@media (max-width: 900px) {
    .desk-links {
        grid-template-columns: 1fr;
    }

    .about-room-intro {
        grid-template-columns: 1fr;
    }

    .room-object {
        opacity: 0.24;
        right: 18px;
        bottom: 18px;
        transform: scale(0.82);
        transform-origin: right bottom;
    }
}

@media (max-width: 620px) {
    .room-page {
        padding: 66px 18px;
    }
}

/* Cinematic entrance refinement */
.cinematic-entry {
    overflow: hidden;
    isolation: isolate;
    padding: 0;
    background: #100a07;
}

.entry-art,
.entry-vignette,
.lantern-breath,
.door-welcome-glow,
.entry-fade,
.cinematic-dust {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.entry-art {
    z-index: -4;
    background:
        linear-gradient(180deg, rgba(13, 9, 8, 0.02), rgba(13, 9, 8, 0.2)),
        url("../stylization/entry-concept-v1.jpg") center / cover no-repeat;
    transform: scale(1.01);
    animation: camera-approach 42s ease-out forwards;
}

.entry-vignette {
    z-index: -1;
    background:
        radial-gradient(ellipse at 46% 50%, transparent 0 38%, rgba(11, 7, 5, 0.28) 72%, rgba(8, 5, 4, 0.68) 100%),
        linear-gradient(90deg, rgba(8, 5, 4, 0.44), transparent 32%, transparent 70%, rgba(8, 5, 4, 0.42));
}

.lantern-breath {
    z-index: -2;
    background:
        radial-gradient(circle at 28% 47%, rgba(255, 188, 88, 0.23), transparent 12%),
        radial-gradient(ellipse at 36% 62%, rgba(228, 132, 48, 0.12), transparent 28%);
    mix-blend-mode: screen;
    opacity: 0.58;
    animation: lantern-light-breathe 6.8s ease-in-out infinite;
}

.door-welcome-glow {
    z-index: -2;
    background:
        linear-gradient(90deg, transparent 0 44%, rgba(255, 162, 62, 0.16) 49%, rgba(255, 197, 108, 0.18) 54%, transparent 61%),
        radial-gradient(ellipse at 52% 61%, rgba(255, 176, 74, 0.16), transparent 18%);
    mix-blend-mode: screen;
    opacity: 0.72;
    animation: door-soft-movement 13s ease-in-out infinite;
}

.entry-fade {
    z-index: 4;
    background: #100a07;
    opacity: 0;
    transition: opacity 900ms ease;
}

.cinematic-dust span {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 214, 148, 0.24);
    box-shadow: 0 0 7px rgba(255, 190, 102, 0.14);
    animation: cinematic-dust-drift 30s ease-in-out infinite;
}

.cinematic-dust span:nth-child(1) { left: 25%; top: 44%; animation-delay: -4s; }
.cinematic-dust span:nth-child(2) { left: 31%; top: 52%; animation-delay: -11s; }
.cinematic-dust span:nth-child(3) { left: 40%; top: 60%; animation-delay: -17s; }
.cinematic-dust span:nth-child(4) { left: 55%; top: 49%; animation-delay: -7s; }
.cinematic-dust span:nth-child(5) { left: 62%; top: 66%; animation-delay: -14s; }

.entry-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(720px, 92vw);
    margin: auto;
    padding: clamp(58px, 9vw, 112px) clamp(24px, 6vw, 76px) clamp(28px, 5vw, 58px);
    text-align: center;
    color: rgba(255, 249, 239, 0.84);
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.48);
    transform: translateY(11vh);
}

.entry-copy h1 {
    order: 2;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.75rem, 4vw, 3.35rem);
    font-weight: 400;
    line-height: 1.22;
    opacity: 0;
    transform: translateY(16px);
    animation: copy-arrives 1900ms ease 2000ms forwards;
    text-wrap: balance;
}

.entry-copy p {
    order: 3;
    margin: clamp(28px, 4.4vw, 44px) auto clamp(42px, 6vw, 68px);
    color: rgba(255, 249, 239, 0.76);
    font-size: clamp(1.02rem, 1.9vw, 1.28rem);
    line-height: 1.72;
    opacity: 0;
    transform: translateY(16px);
    animation: copy-arrives 1800ms ease 2700ms forwards;
}

.entry-copy .entry-button {
    order: 1;
    position: relative;
    left: auto;
    top: auto;
    width: fit-content;
    height: auto;
    z-index: 2;
    filter: none;
    transform-origin: center;
    min-height: 42px;
    margin: 0 0 clamp(28px, 4.7vw, 48px);
    padding: 11px 24px;
    color: #fff2d8 !important;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background:
        linear-gradient(180deg, rgba(138, 94, 48, 0.62), rgba(58, 36, 20, 0.72));
    border-color: rgba(255, 214, 135, 0.95);
    border-width: 1.5px;
    box-shadow: inset 0 0 12px rgba(255, 226, 174, 0.18), 0 0 28px rgba(0, 0, 0, 0.32), 0 0 24px rgba(219, 156, 71, 0.14);
    opacity: 0;
    transform: translateY(8px);
    animation: button-arrives 1300ms ease 4000ms forwards;
}

.entry-copy .entry-button:hover {
    color: rgba(255, 232, 180, 0.96);
    background:
        linear-gradient(180deg, rgba(116, 78, 40, 0.42), rgba(56, 34, 19, 0.48));
    border-color: rgba(223, 180, 102, 0.5);
}

.entry-copy .entry-button::before {
    content: "";
    width: 3px;
    height: 3px;
    margin-right: 8px;
    border-radius: 50%;
    background: rgba(213, 168, 92, 0.38);
}

.cinematic-entry.entering-library .entry-art {
    animation: enter-camera 1050ms ease-in forwards;
}

.cinematic-entry.entering-library .door-welcome-glow {
    animation: enter-door-glow 1050ms ease-in forwards;
}

.cinematic-entry.entering-library .entry-copy {
    transition: opacity 650ms ease, transform 900ms ease;
    opacity: 0;
    transform: translateY(8vh) scale(0.99);
}

.cinematic-entry.entering-library .entry-fade {
    opacity: 1;
}

@keyframes camera-approach {
    from {
        transform: scale(1.01) translate3d(0, 0, 0);
    }
    to {
        transform: scale(1.035) translate3d(-3px, 1px, 0);
    }
}

@keyframes enter-camera {
    from {
        transform: scale(1.025) translate3d(-1px, 0.5px, 0);
    }
    to {
        transform: scale(1.075) translate3d(-7px, 2px, 0);
    }
}

@keyframes enter-door-glow {
    from {
        opacity: 0.72;
        transform: translateX(0) scaleX(1);
    }
    to {
        opacity: 1;
        transform: translateX(4px) scaleX(1.08);
    }
}

@keyframes lantern-light-breathe {
    0%, 100% {
        opacity: 0.52;
        transform: scale(1);
    }
    50% {
        opacity: 0.68;
        transform: scale(1.01);
    }
}

@keyframes door-soft-movement {
    0%, 100% {
        opacity: 0.66;
        transform: translateX(0);
    }
    50% {
        opacity: 0.78;
        transform: translateX(1px);
    }
}

@keyframes cinematic-dust-drift {
    0%, 100% {
        opacity: 0.035;
        transform: translate3d(0, 0, 0);
    }
    50% {
        opacity: 0.14;
        transform: translate3d(7px, -13px, 0);
    }
}

@keyframes copy-arrives {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes button-arrives {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    70% {
        opacity: 0.72;
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .entry-art,
    .lantern-breath,
    .door-welcome-glow,
    .cinematic-dust span,
    .entry-copy h1,
    .entry-copy p,
    .entry-copy .entry-button {
        animation: none;
    }

    .entry-copy h1,
    .entry-copy p {
        opacity: 1;
        transform: none;
    }

    .entry-copy .entry-button {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 760px) {
    .entry-art {
        background-position: 53% center;
    }

    .entry-copy {
        align-self: center;
        padding: 32px 18px;
    }
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px;
    border: 1px solid rgba(184, 120, 69, 0.24);
    border-radius: 999px;
    background: rgba(255, 249, 239, 0.42);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
}

.language-switch a {
    min-width: 34px;
    padding: 5px 8px;
    border: 0;
    border-radius: 999px;
    color: var(--brown-soft);
    text-align: center;
}

.language-switch a:hover,
.language-switch a.active {
    color: var(--ink);
    background: rgba(213, 168, 92, 0.22);
}

.room-header .language-switch,
.library-header .language-switch {
    border-color: rgba(213, 168, 92, 0.2);
    background: rgba(21, 12, 8, 0.3);
}

.room-header .language-switch a,
.library-header .language-switch a {
    color: rgba(255, 249, 239, 0.78);
}

.room-header .language-switch a:hover,
.room-header .language-switch a.active,
.library-header .language-switch a:hover,
.library-header .language-switch a.active {
    color: var(--paper);
    background: rgba(213, 168, 92, 0.18);
}

.entry-language-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    margin: 0 auto 24px;
    padding: 8px 14px;
    border: 1px solid rgba(240, 193, 120, 0.5);
    border-radius: 999px;
    background: rgba(18, 10, 6, 0.66);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(255, 226, 174, 0.08);
    backdrop-filter: blur(10px);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
}

.entry-language-switch a,
.entry-language-switch .language-divider {
    color: rgba(255, 249, 239, 0.9);
}

.entry-language-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 78px;
    padding: 8px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.entry-language-switch .flag {
    font-size: 0.78rem;
    line-height: 1;
}

.entry-language-switch .language-divider {
    font-size: 0.92rem;
    opacity: 0.62;
}

.entry-language-switch a:hover,
.entry-language-switch a.active {
    color: var(--paper);
    background: rgba(213, 168, 92, 0.28);
}

@media (max-width: 980px) {
    .language-switch {
        margin-left: 0;
    }
}

@media (max-width: 620px) {
    .language-switch {
        width: 100%;
        justify-content: flex-start;
    }

    .entry-language-switch {
        width: fit-content;
        max-width: calc(100vw - 40px);
        justify-content: center;
        margin-bottom: 24px;
    }
}




