:root {
    --color-white: #ffffff;
    --color-off-white: #fafafa;
    --color-paper: #f4f1e8;
    --color-charcoal: #2a2a2a;
    --color-black: #111111;
    --color-accent: #FFD166;
    --color-border: #e2e2e2;
    --color-text-muted: #666666;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 8rem;
    --container-width: 1200px;
    --nav-height: 80px;
    --ticker-height: 40px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--color-charcoal);
    background: var(--color-off-white);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255,255,255,0.86), rgba(255,255,255,0.96)),
        url('https://upload.wikimedia.org/wikipedia/commons/4/4e/Frank_Leslie%27s_Illustrated_Newspaper%2C_May_22%2C_1858%2C_front_page.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

body.room-entered .navbar,
body.room-entered .news-ticker { transform: translateY(0); }


body:not(.room-entered) main > section:not(.gate-experience),
body:not(.room-entered) footer {
    display: none;
}

body:not(.room-entered) .nav-links,
body:not(.room-entered) .nav-cta {
    opacity: 0.42;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-black);
    font-weight: 600;
    line-height: 1.15;
}

a { color: inherit; text-decoration: none; transition: all 0.25s ease; }
button { font: inherit; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 10;
}

.news-ticker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ticker-height);
    background-color: var(--color-accent);
    color: var(--color-black);
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 101;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ticker-content { display: flex; white-space: nowrap; animation: ticker 32s linear infinite; align-items: center; }
.ticker-content:hover { animation-play-state: paused; }
.ticker-dot { margin: 0 var(--space-lg); color: rgba(0,0,0,0.5); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.navbar {
    position: fixed;
    top: var(--ticker-height);
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(255,255,255,0.66);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.brand-logo { display: flex; align-items: center; gap: var(--space-sm); }
.logo-text { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; letter-spacing: -1px; color: var(--color-black); position: relative; }
.logo-text::after { content: ''; position: absolute; bottom: 4px; right: -8px; width: 6px; height: 6px; background: var(--color-accent); border-radius: 50%; }
.logo-full { font-size: 0.9rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; display: none; }
.nav-links { display: none; list-style: none; gap: var(--space-lg); }
.nav-links a { font-size: 0.95rem; font-weight: 600; position: relative; }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px; background: var(--color-black); transition: width 0.25s ease; }
.nav-links a:hover::after { width: 100%; }

.btn-primary, .btn-secondary, .door-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    padding: 0.8rem 1.45rem;
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid var(--color-black);
    cursor: pointer;
}
.btn-primary, .door-button { background: var(--color-black); color: var(--color-white); }
.btn-primary:hover, .door-button:hover { background: var(--color-accent); color: var(--color-black); border-color: var(--color-accent); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--color-black); }
.btn-secondary:hover { background: var(--color-accent); border-color: var(--color-accent); transform: translateY(-2px); }

.gate-experience {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding-top: calc(var(--nav-height) + var(--ticker-height));
    background:
        radial-gradient(circle at 72% 16%, rgba(255,209,102,0.16), transparent 24%),
        linear-gradient(180deg, #eee8d7 0%, #f4efe3 58%, #e5dcc8 100%);
}

#capitol-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: default;
}

.gate-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle at 67% 44%, transparent 0%, transparent 56%, rgba(238,232,215,0.12) 86%),
        linear-gradient(90deg, rgba(238,232,215,0.5) 0%, rgba(238,232,215,0.08) 30%, rgba(238,232,215,0) 66%, rgba(238,232,215,0.18) 100%);
}

.gate-experience::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(238,232,215,0.58));
}

.gate-copy {
    position: relative;
    z-index: 3;
    width: min(330px, calc(100% - 2rem));
    margin-left: max(1rem, calc((100vw - var(--container-width)) / 2 + 0.75rem));
    margin-top: 2.5rem;
    padding: 1.05rem 1.15rem;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 14px 38px rgba(0,0,0,0.14);
}

.eyebrow {
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    position: relative;
    display: inline-block;
}
.eyebrow::before { content: ''; position: absolute; left: -28px; top: 50%; width: 18px; height: 1px; background: var(--color-accent); }
.hero-title { font-size: clamp(2.5rem, 4.2vw, 4.05rem); margin-bottom: 1.15rem; letter-spacing: -1.5px; }
.hero-subtitle { font-size: 0.92rem; font-weight: 600; max-width: 285px; color: #565656; margin-bottom: 1.25rem; }
.gate-hint { margin-top: 0.8rem; font-size: 0.78rem; color: var(--color-text-muted); }
.gate-experience.entering .gate-copy { opacity: 0; transform: translateY(-18px) scale(0.98); transition: opacity 0.65s ease, transform 0.65s ease; }

section { padding: var(--space-2xl) 0; position: relative; z-index: 10; }
.section-header { margin-bottom: var(--space-xl); }
.section-header h2, .room-intro h2 { font-size: clamp(2.4rem, 5vw, 4rem); margin-bottom: var(--space-md); text-shadow: 0 1px 2px rgba(255,255,255,0.8); }
.divider { width: 72px; height: 3px; background: var(--color-accent); box-shadow: 0 2px 4px rgba(255,209,102,0.4); }

.reading-room {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(255,209,102,0.18), transparent 36%),
        linear-gradient(180deg, rgba(39,35,27,0.58) 0%, rgba(92,84,66,0.38) 24%, rgba(250,250,250,0.98) 68%);
    overflow: hidden;
}
.reading-room::before {
    content: '';
    position: absolute;
    inset: 4rem 1rem auto;
    height: 500px;
    background:
        radial-gradient(circle at 50% 15%, rgba(255,209,102,0.12), transparent 38%),
        linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent),
        repeating-linear-gradient(90deg, transparent 0 7%, rgba(255,255,255,0.10) 7.3% 7.55%, transparent 8% 14%);
    border-radius: 50% 50% 0 0;
    opacity: 0.58;
    pointer-events: none;
}
.room-container { position: relative; }
.room-intro { max-width: 760px; margin-bottom: var(--space-xl); color: var(--color-white); }
.room-intro h2 { color: var(--color-white); text-shadow: 0 10px 30px rgba(0,0,0,0.32); }
.room-intro .eyebrow { color: rgba(255,255,255,0.72); }
.room-intro p:last-child { color: rgba(255,255,255,0.74); font-size: 1.08rem; }
.room-stage {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: var(--space-lg);
    perspective: 1100px;
}
.pedestal-card {
    min-height: 360px;
    padding: var(--space-lg);
    border-radius: 6px 6px 2px 2px;
    position: relative;
    overflow: hidden;
    transform: rotateX(5deg) translateZ(0);
}
.pedestal-card::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 0;
    height: 16px;
    background: linear-gradient(90deg, transparent, rgba(255,209,102,0.7), transparent);
}
.main-pedestal { min-height: 460px; transform: translateY(-34px) rotateX(4deg); }
.pedestal-number { font-family: var(--font-heading); font-size: 5rem; line-height: 0.8; color: rgba(17,17,17,0.08); position: absolute; right: 1.25rem; top: 1rem; }
.read-link { display: inline-flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-lg); font-family: var(--font-heading); font-style: italic; font-size: 1.2rem; }
.read-link span { transition: transform 0.25s ease; }
.read-link:hover span { transform: translateX(5px); }

.sharp-3d {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 18px 46px rgba(0,0,0,0.14), 0 1px 2px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.92);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(246,241,228,0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.sharp-3d:hover { transform: translateY(-7px); box-shadow: 0 24px 50px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05); }
.main-pedestal.sharp-3d:hover { transform: translateY(-42px); }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s ease, transform 0.65s ease, box-shadow 0.3s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.main-pedestal.reveal.in-view { transform: translateY(-34px) rotateX(4deg); }

.featured-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-xl); }
.article-meta { display: flex; gap: var(--space-md); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: var(--space-md); }
.topic { color: var(--color-black); font-weight: 800; }
.date { color: var(--color-text-muted); }
.article-title { margin-bottom: var(--space-md); transition: color 0.25s ease; }
.featured-article:hover .article-title, .pedestal-card:hover .article-title { color: #c5941f; }
.article-excerpt { color: var(--color-text-muted); margin-bottom: var(--space-lg); }
.article-author { font-weight: 700; font-size: 0.95rem; }
.featured-article { padding: var(--space-lg); border-radius: 4px; }
.main-feature { display: flex; flex-direction: column; justify-content: center; }
.main-feature .article-title { font-size: 2.5rem; }
.main-feature .article-excerpt { font-size: 1.1rem; }
.side-features { display: flex; flex-direction: column; gap: var(--space-xl); }
.small-feature .article-title { font-size: 1.5rem; }

.list-grid { display: flex; flex-direction: column; }
.list-article { display: grid; grid-template-columns: 1fr; gap: var(--space-md); padding: var(--space-lg); margin-bottom: var(--space-md); border-radius: 4px; }
.list-content .article-title { font-size: 1.5rem; margin-bottom: var(--space-sm); }
.list-content .article-excerpt { margin-bottom: 0; }
.list-author { font-size: 0.9rem; font-weight: 700; }
.list-author .date { display: block; margin-top: 4px; }

.join-publication { background: rgba(250,250,250,0.95); text-align: center; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.join-content { max-width: 650px; margin: 0 auto; }
.join-content h2 { font-size: clamp(2.5rem, 5vw, 4.4rem); margin-bottom: var(--space-md); }
.join-content p { font-size: 1.1rem; color: var(--color-text-muted); margin-bottom: var(--space-lg); }
.btn-group { display: flex; gap: var(--space-md); justify-content: center; flex-wrap: wrap; }

footer { padding: var(--space-2xl) 0 var(--space-md); background: var(--color-white); position: relative; z-index: 10; }
.footer-content { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xl); margin-bottom: var(--space-xl); }
.footer-brand { max-width: 320px; }
.footer-brand .logo-text { display: block; margin-bottom: var(--space-md); }
.footer-links { display: flex; gap: var(--space-2xl); flex-wrap: wrap; }
.link-col { display: flex; flex-direction: column; gap: var(--space-sm); }
.link-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: var(--space-sm); }
.link-col a { font-size: 0.95rem; color: var(--color-text-muted); }
.link-col a:hover { color: var(--color-black); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-border); font-size: 0.85rem; color: var(--color-text-muted); }
.legal-links { display: flex; gap: var(--space-md); }

@media (min-width: 768px) { .logo-full { display: block; } .list-article { grid-template-columns: 150px 1fr 200px; align-items: center; } }
@media (min-width: 1024px) { .nav-links { display: flex; } .featured-grid { grid-template-columns: 3fr 2fr; } }
@media (max-width: 760px) {
    :root { --nav-height: 70px; --ticker-height: 34px; --space-2xl: 5rem; }
    .nav-cta { display: none; }
    .gate-copy { margin: 0 auto; width: calc(100% - 2rem); padding: 1.25rem; }
    .gate-vignette { background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.32), rgba(255,255,255,0.9)); }
    .hero-title { font-size: clamp(3rem, 18vw, 5rem); }
    .room-stage { grid-template-columns: 1fr; }
    .main-pedestal, .main-pedestal.sharp-3d:hover { min-height: 360px; transform: none; }
    .pedestal-card { min-height: auto; transform: none; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

.reveal.in-view.sharp-3d:hover { transform: translateY(-7px); }
.main-pedestal.reveal.in-view.sharp-3d:hover { transform: translateY(-42px); }


@media (min-width: 1200px) {
    .gate-copy { transform: translateY(1.5rem); }
}

@media (max-width: 900px) {
    .gate-copy {
        width: min(390px, calc(100% - 2rem));
        margin-left: 1rem;
        margin-top: 2rem;
    }
    .hero-title { font-size: clamp(3rem, 10vw, 4.6rem); }
}


.gate-copy .eyebrow { font-size: 0.68rem; margin-bottom: 0.75rem; letter-spacing: 1.8px; }
.gate-copy .door-button { padding: 0.68rem 1rem; font-size: 0.82rem; box-shadow: 0 8px 20px rgba(0,0,0,0.18); }

.room-stage {
    padding: 1.2rem;
    border: 1px solid rgba(255,255,255,0.22);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)),
        rgba(255,255,255,0.08);
    box-shadow: 0 24px 70px rgba(0,0,0,0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pedestal-card {
    border-top: 5px solid var(--color-accent);
}

.pedestal-card::before {
    content: '';
    position: absolute;
    inset: auto 1rem 1rem;
    height: 44px;
    background: repeating-linear-gradient(90deg, rgba(17,17,17,0.08) 0 2px, transparent 2px 14px);
    opacity: 0.45;
    pointer-events: none;
}

@media (min-width: 1200px) {
    .gate-copy { transform: translateY(0.5rem); }
}

@media (max-width: 760px) {
    .gate-experience {
        align-items: flex-end;
        min-height: 100svh;
        padding-top: calc(var(--nav-height) + var(--ticker-height));
        padding-bottom: 1rem;
    }

    #capitol-canvas {
        touch-action: manipulation;
    }

    .gate-vignette {
        background:
            linear-gradient(180deg, rgba(238,232,215,0.16) 0%, rgba(238,232,215,0.02) 42%, rgba(238,232,215,0.72) 100%);
    }

    .gate-copy {
        width: min(92vw, 360px);
        margin: 0 auto;
        padding: 0.95rem 1rem;
        background: rgba(255,255,255,0.78);
        backdrop-filter: blur(7px);
        -webkit-backdrop-filter: blur(7px);
        transform: none;
    }

    .gate-copy .eyebrow {
        font-size: 0.62rem;
        margin-bottom: 0.55rem;
    }

    .gate-copy .eyebrow::before {
        display: none;
    }

    .hero-title {
        font-size: clamp(2.15rem, 13vw, 3.35rem);
        line-height: 0.96;
        margin-bottom: 0.7rem;
    }

    .hero-subtitle {
        font-size: 0.84rem;
        line-height: 1.45;
        max-width: 100%;
        margin-bottom: 0.85rem;
    }

    .gate-copy .door-button {
        width: 100%;
        min-height: 44px;
    }

    .gate-hint {
        margin-top: 0.55rem;
        font-size: 0.72rem;
    }

    body:not(.room-entered) .brand-logo {
        margin: 0 auto;
    }
}

@media (max-width: 420px) {
    .news-ticker {
        font-size: 0.7rem;
    }

    .logo-text {
        font-size: 1.7rem;
    }

    .logo-full {
        display: none;
    }

    .gate-copy {
        width: calc(100vw - 1.5rem);
    }
}

.empty-publication-state {
    max-width: 760px;
    min-height: 320px;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 8px;
    border-top: 5px solid var(--color-accent);
    position: relative;
    overflow: hidden;
}

.empty-publication-state .pedestal-number {
    font-size: clamp(5rem, 18vw, 11rem);
    right: 1.5rem;
    top: 1rem;
}

.empty-publication-state .article-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    max-width: 620px;
}

.category-section {
    background: rgba(250,250,250,0.96);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
}

.category-card {
    min-height: 260px;
    padding: var(--space-lg);
    border-radius: 6px;
    border-top: 4px solid var(--color-accent);
    position: relative;
    overflow: hidden;
}

.category-card span {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 1;
    color: rgba(17,17,17,0.07);
    position: absolute;
    top: 1rem;
    right: 1.25rem;
}

.category-card h3 {
    font-size: clamp(1.6rem, 2.5vw, 2.3rem);
    margin-bottom: var(--space-md);
    max-width: 75%;
}

.category-card p {
    color: var(--color-text-muted);
    max-width: 28rem;
}

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

@media (max-width: 620px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: 210px;
    }
}
