:root {
    --bg: #f2ede2;
    --bg-alt: #e8e0d1;
    --surface: rgba(249, 245, 236, 0.88);
    --surface-strong: #f8f3e8;
    --ink: #1e2630;
    --ink-soft: #4d5966;
    --navy: #1a2b3f;
    --navy-strong: #101b29;
    --bronze: #9b6b2f;
    --bronze-soft: #d9bf8c;
    --forest: #405346;
    --white: #fffdf8;
    --shadow: 0 24px 60px rgba(17, 29, 43, 0.14);
    --shadow-soft: 0 16px 34px rgba(17, 29, 43, 0.09);
    --radius-lg: 28px;
    --radius-md: 20px;
    --font-display: "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --font-body: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
    --font-accent: "Bahnschrift", "Gill Sans", "Trebuchet MS", sans-serif;
    --max-width: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(217, 191, 140, 0.42), transparent 36%),
        radial-gradient(circle at top right, rgba(64, 83, 70, 0.12), transparent 30%),
        linear-gradient(180deg, #f4efe4 0%, #ece5d6 60%, #f3ede0 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04)),
        repeating-linear-gradient(135deg, rgba(26, 43, 63, 0.018) 0, rgba(26, 43, 63, 0.018) 2px, transparent 2px, transparent 11px);
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 50;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    background: var(--navy);
    color: var(--white);
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus { top: 1rem; }

.header-ribbon,
.hero-panel,
.footer-panel { color: var(--white); }

.header-ribbon-inner,
.nav-inner,
.hero-inner,
.section-inner,
.footer-inner {
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(248, 243, 232, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(39, 52, 66, 0.08);
}

.header-ribbon {
    background: linear-gradient(90deg, rgba(16, 27, 41, 0.98), rgba(26, 43, 63, 0.98));
    font-family: var(--font-accent);
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.header-ribbon-inner { padding: 0.7rem 0 0.66rem; color: rgba(255, 253, 248, 0.86); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.nav-shell { position: relative; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
    text-decoration: none;
    min-width: 0;
}

.brand-mark {
    width: 3.7rem;
    height: 3.7rem;
    border-radius: 50%;
    padding: 0.35rem;
    background: linear-gradient(145deg, rgba(155, 107, 47, 0.12), rgba(16, 27, 41, 0.18));
    border: 1px solid rgba(155, 107, 47, 0.26);
    box-shadow: inset 0 0 0 1px rgba(255, 253, 248, 0.45);
}

.brand-copy { display: flex; flex-direction: column; gap: 0.16rem; min-width: 0; }
.brand-kicker, .section-kicker, .eyebrow, .hero-card-title, .decree-meta, .timeline-meta, .feature-link, .eyebrow-block, .stat-label, .footer-link, .nav-link, .button {
    font-family: var(--font-accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.brand-kicker { font-size: 0.72rem; color: var(--bronze); }
.brand-title, .hero-title, .section-title, .footer-title, .info-card-title, .decree-title, .feature-card-title, .timeline-title, .branch-title, .chain-title, .callout-title, .hero-card-value, .quote-text, .stat-value {
    font-family: var(--font-display);
    text-transform: uppercase;
}

.brand-title { font-size: 1.15rem; letter-spacing: 0.08em; }
.brand-subtitle { color: var(--ink-soft); font-size: 0.84rem; }

.nav-toggle {
    display: none;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(39, 52, 66, 0.12);
    border-radius: 50%;
    background: rgba(255, 253, 248, 0.8);
    color: var(--navy);
    cursor: pointer;
}

.nav-links { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem; }

.nav-link,
.button,
.footer-link,
.pill {
    border-radius: 999px;
    text-decoration: none;
}

.nav-link {
    padding: 0.8rem 1rem;
    font-size: 0.82rem;
    color: var(--ink-soft);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible { background: rgba(26, 43, 63, 0.08); color: var(--navy); transform: translateY(-1px); }
.nav-link[aria-current="page"] { background: linear-gradient(135deg, rgba(155, 107, 47, 0.15), rgba(26, 43, 63, 0.08)); color: var(--navy); box-shadow: inset 0 0 0 1px rgba(155, 107, 47, 0.22); }

.page-main { position: relative; z-index: 1; }
.site-footer { position: relative; z-index: 1; padding: 0 0 2.6rem; }
.page-hero { padding: 4.25rem 0 2.4rem; }
.hero-panel,
.quote-band,
.footer-panel {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius-lg) + 8px);
    box-shadow: var(--shadow);
}

.hero-panel {
    background:
        linear-gradient(135deg, rgba(16, 27, 41, 0.98), rgba(35, 53, 77, 0.94));
    background-size: cover;
    background-position: center;
}

.hero-panel::before,
.quote-band::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 191, 140, 0.22), transparent 68%);
}
.hero-panel::before { right: -6rem; bottom: -8rem; width: 21rem; height: 21rem; }
.quote-band::after { right: -2rem; bottom: -2rem; width: 10rem; height: 10rem; }

.hero-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 13, 20, 0.18), rgba(8, 13, 20, 0.62)),
        linear-gradient(90deg, rgba(14, 22, 32, 0.72), rgba(14, 22, 32, 0.38) 45%, rgba(101, 61, 25, 0.24));
    pointer-events: none;
}

body[data-page="home"] .hero-panel {
    background-image:
        linear-gradient(135deg, rgba(16, 27, 41, 0.18), rgba(155, 107, 47, 0.1)),
        url("../img/home-hero.png");
}

body[data-page="government"] .hero-panel {
    background-image:
        linear-gradient(135deg, rgba(16, 27, 41, 0.16), rgba(155, 107, 47, 0.1)),
        url("../img/government-hero.png");
}

body[data-page="economy"] .hero-panel {
    background-image:
        linear-gradient(135deg, rgba(16, 27, 41, 0.22), rgba(155, 107, 47, 0.12)),
        url("../img/economy-hero.png");
}

body[data-page="defense"] .hero-panel {
    background-image:
        linear-gradient(135deg, rgba(16, 27, 41, 0.26), rgba(127, 47, 44, 0.1)),
        url("../img/defense-hero.png");
}

.hero-emblem-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    padding-top: 2.2rem;
}

.hero-emblem {
    width: min(190px, 32vw);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 1rem;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.26), transparent 36%),
        linear-gradient(145deg, rgba(217, 191, 140, 0.26), rgba(16, 27, 41, 0.28));
    border: 1px solid rgba(217, 191, 140, 0.42);
    box-shadow:
        0 26px 50px rgba(3, 9, 16, 0.32),
        inset 0 0 0 1px rgba(255, 253, 248, 0.32);
}

.hero-emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.72fr); gap: 2rem; padding: 3rem 0; align-items: center; }
.hero-copy {
    padding: clamp(1.1rem, 2vw, 1.6rem);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(11, 18, 27, 0.76), rgba(11, 18, 27, 0.42));
    border: 1px solid rgba(255, 253, 248, 0.08);
    box-shadow: 0 18px 40px rgba(5, 10, 18, 0.22);
    backdrop-filter: blur(8px);
}

.hero-aside { position: relative; z-index: 1; }
.eyebrow, .section-kicker, .decree-meta, .timeline-meta, .feature-link, .eyebrow-block { font-size: 0.74rem; color: var(--bronze); }
.eyebrow { display: inline-flex; padding: 0.45rem 0.85rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: rgba(255, 253, 248, 0.8); margin-bottom: 1rem; }
.hero-title { margin: 0; font-size: clamp(2.5rem, 5vw, 4.85rem); line-height: 0.96; letter-spacing: 0.03em; }
.hero-lead, .hero-card-text, .section-summary, .stat-copy, .info-card-copy, .decree-copy, .feature-card-copy, .timeline-copy, .branch-copy, .chain-copy, .prose p, .prose li, .callout, .footer-copy {
    line-height: 1.72;
}

.hero-lead { margin: 1.3rem 0 0; max-width: 60ch; font-size: 1.08rem; color: rgba(255, 253, 248, 0.82); }
.hero-meta, .hero-actions, .pill-list { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-meta { margin-top: 1.5rem; }
.hero-chip { padding: 0.65rem 0.95rem; font-size: 0.9rem; background: rgba(255, 255, 255, 0.08); color: rgba(255, 253, 248, 0.85); border-radius: 999px; }
.pill {
    padding: 0.65rem 0.95rem;
    font-size: 0.78rem;
    background: rgba(26, 43, 63, 0.07);
    color: var(--navy);
    border-radius: 999px;
}
.hero-actions { margin-top: 1.9rem; gap: 0.9rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.2rem; padding: 0.8rem 1.3rem; font-size: 0.82rem; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.button:hover, .button:focus-visible { transform: translateY(-2px); }
.button-primary { background: linear-gradient(135deg, #c89753, #a66d2e); color: var(--white); box-shadow: 0 16px 30px rgba(155, 107, 47, 0.34); }
.button-secondary { background: rgba(255, 255, 255, 0.08); color: var(--white); border: 1px solid rgba(255, 255, 255, 0.16); }

.hero-card,
.section-card,
.stat-card,
.info-card,
.decree-card,
.feature-card,
.timeline-card,
.branch-card,
.chain-card,
.inset-panel,
.callout {
    background: var(--surface);
    border: 1px solid rgba(39, 52, 66, 0.08);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.hero-card { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); padding: 1.35rem; }
.hero-card + .hero-card { margin-top: 1rem; }
.hero-card-title { margin: 0 0 0.45rem; font-size: 0.78rem; color: rgba(255, 253, 248, 0.7); }
.hero-card-value { margin: 0; font-size: 1.6rem; letter-spacing: 0.05em; }
.hero-card-text { margin: 0.55rem 0 0; color: rgba(255, 253, 248, 0.78); }

.section { padding: 1.45rem 0 4.4rem; }
.section-alt { padding-top: 0; }
.section-card { padding: clamp(1.4rem, 4vw, 2.25rem); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.section-title { margin: 0; font-size: clamp(1.7rem, 3vw, 2.65rem); letter-spacing: 0.05em; }
.section-summary { max-width: 62ch; margin: 0.7rem 0 0; color: var(--ink-soft); }
.section-note { max-width: 24rem; padding: 0.8rem 1rem; border-radius: 14px; background: rgba(217, 191, 140, 0.2); border: 1px solid rgba(155, 107, 47, 0.16); color: var(--ink-soft); }

.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr); gap: 1.35rem; }
.stat-card, .info-card, .decree-card, .feature-card, .timeline-card, .branch-card, .chain-card, .inset-panel, .callout { padding: 1.25rem; }
.stat-label { margin: 0; font-size: 0.74rem; color: var(--bronze); }
.stat-value { margin: 0.5rem 0 0; font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1; }
.stat-copy, .info-card-copy, .decree-copy, .feature-card-copy, .timeline-copy, .branch-copy, .chain-copy, .prose p, .callout, .footer-copy { color: var(--ink-soft); }
.info-card-title, .decree-title, .feature-card-title, .timeline-title, .branch-title, .chain-title { margin: 0; font-size: 1.16rem; letter-spacing: 0.05em; }

.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 1rem 0 0; padding-left: 1.15rem; }
.prose li + li { margin-top: 0.5rem; }
.feature-link { display: inline-flex; margin: 0 0 0.7rem; font-size: 0.74rem; color: var(--bronze); text-decoration: none; }
.feature-card a.feature-link { margin-top: 1rem; }
.feature-card a.feature-link:hover,
.feature-card a.feature-link:focus-visible { color: var(--navy); }

.timeline { position: relative; display: grid; gap: 1rem; }
.timeline::before {
    content: "";
    position: absolute;
    top: 0.7rem;
    bottom: 0.7rem;
    left: 0.95rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(155, 107, 47, 0.55), rgba(26, 43, 63, 0.18));
}

.timeline-card { position: relative; padding-left: 3rem; }
.timeline-card::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 1.3rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #d2a86a, #8d5d24);
    box-shadow: 0 0 0 4px rgba(217, 191, 140, 0.24);
}

.quote-band { background: linear-gradient(135deg, rgba(64, 83, 70, 0.95), rgba(26, 43, 63, 0.94)); padding: 2rem; }
.quote-text { margin: 0; font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.4; letter-spacing: 0.05em; }
.quote-source { margin: 0.9rem 0 0; font-family: var(--font-accent); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 253, 248, 0.72); }

.media-feature {
    overflow: hidden;
    border-radius: calc(var(--radius-lg) + 4px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.62));
    border: 1px solid rgba(39, 52, 66, 0.08);
    box-shadow: var(--shadow-soft);
}

.media-feature img {
    width: 100%;
    max-height: 680px;
    object-fit: cover;
}

.media-feature-copy {
    padding: 1.2rem 1.35rem 1.4rem;
    color: var(--ink-soft);
    line-height: 1.7;
}

.footer-panel { background: linear-gradient(135deg, rgba(16, 27, 41, 0.98), rgba(32, 48, 69, 0.96)); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) auto; gap: 1.3rem; padding: 2rem 0; align-items: center; }
.footer-title { margin: 0; font-size: 1.5rem; letter-spacing: 0.06em; }
.footer-copy { margin: 0.55rem 0 0; color: rgba(255, 253, 248, 0.72); max-width: 56ch; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.55rem; }
.footer-link { padding: 0.7rem 0.9rem; font-size: 0.78rem; background: rgba(255, 255, 255, 0.06); color: rgba(255, 253, 248, 0.8); }

.page-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.page-reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
    .hero-inner, .split, .footer-inner { grid-template-columns: 1fr; }
    .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav-links {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 0.35rem);
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem;
        background: rgba(248, 243, 232, 0.98);
        border: 1px solid rgba(39, 52, 66, 0.08);
        border-radius: 20px;
        box-shadow: var(--shadow-soft);
    }
    .nav-shell[data-open="true"] .nav-links { display: flex; }
    .nav-link { width: 100%; text-align: center; }
    .hero-title { font-size: clamp(2.2rem, 12vw, 3.6rem); }
    .section-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 680px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-hero { padding-top: 2.7rem; }
    .hero-inner { padding: 2rem 0; }
    .hero-emblem-wrap { padding-top: 1.6rem; }
    .hero-emblem { width: min(160px, 44vw); padding: 0.85rem; }
    .footer-nav { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .page-reveal { opacity: 1; transform: none; }
}
