:root {
    --bg: #f5f0e8;
    --surface: #fffdf8;
    --surface-strong: #112b3c;
    --ink: #1d2430;
    --muted: #58606d;
    --line: rgba(17, 43, 60, 0.12);
    --accent: #b0582d;
    --accent-soft: #f1d4c2;
    --accent-dark: #7a3516;
    --shadow: 0 20px 60px rgba(17, 43, 60, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(176, 88, 45, 0.16), transparent 24%),
        linear-gradient(180deg, #f8f4ed 0%, #f3eee4 100%);
    font-family: "Source Sans 3", "Trebuchet MS", sans-serif;
}

h1,
h2,
h3,
h4 {
    font-family: "Libre Baskerville", Georgia, serif;
    line-height: 1.2;
}

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

p {
    color: var(--muted);
    line-height: 1.75;
}

.page-frame {
    min-height: calc(100vh - 220px);
}

.site-shell {
    padding-bottom: 4rem;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: rgba(17, 43, 60, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav .container {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.navbar-brand {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: #fff;
}

.brand-mark {
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 1.2rem;
    letter-spacing: 0.12em;
}

.brand-copy {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.72);
}

.site-nav .nav-link,
.site-nav .dropdown-toggle {
    color: rgba(255, 255, 255, 0.76);
    font-weight: 600;
}

.site-nav .nav-link.active,
.site-nav .nav-link:hover,
.site-nav .dropdown-toggle:hover {
    color: #fff;
}

.dropdown-menu {
    border: 1px solid rgba(17, 43, 60, 0.08);
    border-radius: 1rem;
    padding: 0.75rem;
    box-shadow: var(--shadow);
}

.hero-panel,
.page-hero {
    padding: 5rem 0 2rem;
}

.hero-grid,
.split-section,
.footer-grid {
    display: grid;
    gap: 1.5rem;
}

.hero-grid {
    grid-template-columns: 1.8fr 1fr;
    align-items: center;
}

.hero-panel h1,
.page-hero h1 {
    max-width: 14ch;
    font-size: clamp(2.6rem, 5vw, 4.6rem);
    margin: 0.4rem 0 1rem;
}

.hero-copy,
.page-hero p {
    max-width: 60ch;
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.95rem 1.4rem;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: 0 12px 30px rgba(176, 88, 45, 0.24);
}

.btn-secondary {
    color: var(--surface-strong);
    background: rgba(17, 43, 60, 0.08);
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
}

.hero-aside {
    display: grid;
    gap: 1rem;
}

.feature-block,
.portal-card {
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    background: rgba(255, 253, 248, 0.92);
    box-shadow: var(--shadow);
}

.feature-block {
    padding: 1.4rem;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-block span,
.eyebrow,
.article-kicker,
.card-badge,
.timeline-step {
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 700;
}

.section-pad {
    padding: 1.4rem 0 2rem;
}

.section-head {
    margin-bottom: 1.4rem;
}

.section-head h2 {
    margin-top: 0.4rem;
}

.grid-cards,
.journal-directory,
.article-stream,
.timeline-grid {
    display: grid;
    gap: 1.25rem;
}

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

.grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.journal-directory,
.article-stream {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.portal-card {
    padding: 1.5rem;
}

.will-animate {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 260ms ease, transform 260ms ease;
}

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

.portal-card h3 {
    margin: 0.5rem 0 0.8rem;
    font-size: 1.2rem;
}

.stat-card strong {
    display: block;
    margin-top: 0.6rem;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 2.4rem;
}

.stat-label {
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.meta-row,
.mini-list,
.inline-note,
.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.meta-row span,
.mini-list div,
.inline-note span,
.metric-row span {
    color: var(--muted);
    font-size: 0.92rem;
}

.mini-list {
    margin-top: 1rem;
    flex-direction: column;
    gap: 0.45rem;
}

.split-section,
.footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-hero {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 1.5rem;
    align-items: start;
}

.detail-summary div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.detail-summary div:last-child {
    border-bottom: 0;
}

.prose-card p,
.metric-card p {
    white-space: normal;
}

.metric-row {
    justify-content: space-between;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--line);
}

.metric-row strong {
    font-size: 1.8rem;
    font-family: "Libre Baskerville", Georgia, serif;
}

.portal-form {
    display: grid;
    gap: 1.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid label {
    display: grid;
    gap: 0.45rem;
    color: var(--ink);
    font-weight: 600;
}

.full-span {
    grid-column: 1 / -1;
}

.portal-form input,
.portal-form select,
.portal-form textarea {
    width: 100%;
    border: 1px solid rgba(17, 43, 60, 0.14);
    border-radius: 1rem;
    background: #fff;
    padding: 0.9rem 1rem;
    color: var(--ink);
}

.portal-form textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.confirmation-card,
.inline-note {
    background: linear-gradient(135deg, rgba(176, 88, 45, 0.12), rgba(17, 43, 60, 0.06));
}

.fee-table-wrap {
    overflow-x: auto;
}

.fee-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 253, 248, 0.94);
    border-radius: 1.4rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.fee-table th,
.fee-table td {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.fee-table th {
    background: rgba(17, 43, 60, 0.06);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-footer {
    padding: 3rem 0 2rem;
    color: rgba(255, 255, 255, 0.82);
    background: linear-gradient(180deg, rgba(17, 43, 60, 0.98) 0%, rgba(10, 24, 34, 1) 100%);
}

.site-footer h3,
.site-footer h4,
.site-footer a,
.site-footer .eyebrow {
    color: #fff;
}

.site-footer a,
.site-footer span {
    display: block;
    margin-bottom: 0.55rem;
    color: rgba(255, 255, 255, 0.76);
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.empty-state {
    padding: 2rem;
    border-radius: 1.2rem;
    background: rgba(255, 253, 248, 0.9);
    border: 1px dashed var(--line);
    color: var(--muted);
}

.flashmessage {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
}

@media (max-width: 991px) {
    .hero-grid,
    .split-section,
    .detail-hero,
    .footer-grid,
    .compact-grid,
    .grid-cards,
    .journal-directory,
    .article-stream,
    .timeline-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel h1,
    .page-hero h1 {
        max-width: none;
    }

    .footer-meta,
    .form-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
