:root {
    --bg: #f2ede1;
    --surface: #fffdf7;
    --surface-soft: #f7f1e4;
    --surface-strong: #efe4cb;
    --ink: #211d18;
    --muted: #5f5647;
    --brand: #55613a;
    --brand-strong: #404a2b;
    --brand-soft: #d7ceb0;
    --accent: #8f7f56;
    --accent-soft: rgba(143, 127, 86, 0.14);
    --danger: #8d3b31;
    --danger-strong: #742f27;
    --header-bg: rgba(229, 209, 163, 0.96);
    --border-soft: rgba(85, 72, 45, 0.16);
    --border-strong: rgba(64, 53, 33, 0.28);
    --shadow-soft: 0 16px 36px rgba(46, 37, 24, 0.09);
    --shadow-card: 0 10px 24px rgba(42, 34, 22, 0.08);
    --display-font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --body-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    background-image: radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 36%), linear-gradient(180deg, #f4efe4 0%, #eee5d1 100%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--display-font);
    color: var(--ink);
    line-height: 1.18;
    letter-spacing: -0.02em;
}

p,
li {
    max-width: 75ch;
}

a {
    color: var(--brand-strong);
}

.main-header {
    background: var(--header-bg);
    color: #111;
    padding: 0;
    box-shadow: 0 8px 20px rgba(48, 38, 23, 0.07);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(122, 101, 61, 0.12);
}

.header-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 20px;
    min-height: 84px;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-section > a {
    display: block;
    line-height: 0;
}

.logo-image {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-text-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.site-text-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.site-title {
    color: var(--ink);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.1;
}

.site-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 30ch;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: space-between;
    min-width: 0;
}

.user-info {
    background: rgba(255, 251, 243, 0.9);
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.92rem;
    color: var(--ink);
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 18px rgba(40, 31, 18, 0.06);
}

.user-email {
    opacity: 0.8;
    line-height: 1.4;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    min-width: 0;
}

.nav-links a,
.user-logout-link,
.header-signin-button,
.button-primary,
.button-secondary,
.collection-link,
.text-link {
    color: #040507;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 10px 12px;
    border-radius: 999px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-links a:hover,
.user-logout-link:hover,
.button-secondary:hover,
.text-link:hover {
    color: var(--brand-strong);
    background: rgba(85, 97, 58, 0.08);
    border-color: rgba(85, 97, 58, 0.12);
}

.user-logout-link {
    margin-top: 8px;
    background: rgba(85, 97, 58, 0.08);
    border-color: rgba(85, 97, 58, 0.14);
}

.logout-btn {
    background: var(--danger);
    color: var(--surface);
    border: 2px solid var(--danger);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--danger-strong);
    border-color: var(--danger-strong);
    transform: translateY(-1px);
}

.header-signin-button,
.button-primary {
    background: var(--brand);
    color: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 10px 24px rgba(64, 74, 43, 0.2);
}

.header-signin-button:hover,
.button-primary:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    color: var(--surface);
    transform: translateY(-1px);
}

.button-secondary {
    color: var(--surface);
    border-color: rgba(255, 255, 255, 0.64);
    background: rgba(15, 14, 12, 0.12);
}

.button-secondary:hover {
    color: var(--surface);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.92);
}

.menu-toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.menu-toggle:active {
    transform: scale(0.98);
}

.container {
    max-width: 1280px;
    margin: 24px auto;
    background: var(--surface);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow-soft);
}

.page-section {
    background: rgba(255, 253, 247, 0.94);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: var(--shadow-card);
    padding: 32px;
}

.section-heading-group {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.about-project-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
}

.about-project-copy {
    display: grid;
    gap: 10px;
}

.about-project-logo {
    width: clamp(120px, 15vw, 180px);
    height: auto;
    justify-self: end;
    align-self: start;
}

.section-kicker {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
}

.section-title {
    font-size: clamp(1.9rem, 3vw, 2.75rem);
}

.section-intro {
    color: var(--muted);
    font-size: 1.08rem;
}

.record-count-emphasis {
    display: inline-block;
    padding: 0.08em 0.42em 0.14em;
    border-radius: 0.45em;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #7a1111;
    background: linear-gradient(180deg, rgba(255, 252, 252, 0.98) 0%, rgba(248, 229, 229, 0.95) 100%);
    border: 1px solid rgba(145, 32, 32, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 6px 16px rgba(120, 17, 17, 0.12), 0 0 10px rgba(179, 33, 33, 0.10);
    text-shadow: 0 0 8px rgba(179, 33, 33, 0.12);
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    background: #2b271f;
    color: var(--surface);
    font-size: 0.88rem;
    margin: 24px auto 14px auto;
    max-width: 1400px;
    box-sizing: border-box;
    padding: 16px 20px;
    width: 100%;
    border-radius: 16px;
}

.site-footer-home,
.site-footer-link {
    color: var(--surface);
}

.site-footer-home {
    text-decoration: underline;
}

.site-footer-link {
    text-decoration: none;
}

.site-footer-link + .site-footer-link {
    margin-left: 10px;
}

.site-footer-button,
.inline-link-button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.site-footer-button {
    color: var(--surface);
}

.site-footer-button + .site-footer-button {
    margin-left: 10px;
}

.inline-link-button {
    color: var(--brand-strong);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.16em;
    font-weight: 700;
}

.inline-link-button:hover {
    color: var(--accent);
}

.site-footer-copy {
    text-align: center;
    flex: 1 0 auto;
}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-panel {
    background-color: var(--surface);
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    margin: 0;
    color: var(--ink);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    line-height: 1.6;
    color: #333;
}

.modal-body h3 {
    margin-top: 20px;
}

.modal-actions {
    margin-top: 20px;
    text-align: right;
}

.modal-primary-button {
    background: var(--brand);
    color: var(--surface);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.landing-page .container {
    max-width: 1360px;
    margin: 22px auto 0;
    padding: 0 20px 24px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.landing-page .site-footer {
    margin-top: 8px;
}

.landing-shell {
    display: grid;
    gap: 36px;
}

.landing-shell > .page-section + .page-section {
    margin-top: 8px;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 36px;
    background-size: cover;
    background-position: 18% center;
    box-shadow: 0 26px 54px rgba(36, 29, 18, 0.2);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(16, 14, 11, 0.18) 0%, rgba(16, 14, 11, 0.3) 38%, rgba(16, 14, 11, 0.78) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--surface);
    display: grid;
    gap: 18px;
    max-width: 700px;
    justify-items: start;
}

.hero-kicker {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    font-size: 0.82rem;
    color: rgba(255, 246, 225, 0.85);
}

.hero-title {
    font-size: clamp(2.6rem, 4.4vw, 4.3rem);
    color: var(--surface);
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.hero-copy {
    color: rgba(255, 248, 235, 0.92);
    font-size: 1.18rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-note {
    color: rgba(255, 248, 235, 0.8);
    font-size: 1rem;
}

.hero-support {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.hero-note--below {
    color: var(--muted);
    margin-left: auto;
}

.hero-secondary-action {
    color: var(--brand-strong);
    border-color: rgba(85, 97, 58, 0.18);
    background: rgba(85, 97, 58, 0.08);
}

.hero-secondary-action:hover {
    color: var(--brand-strong);
    background: rgba(85, 97, 58, 0.14);
    border-color: rgba(85, 97, 58, 0.24);
}

.stats-grid,
.collection-grid,
.overview-grid,
.notes-grid,
.info-columns {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.collection-card,
.overview-card,
.note-card {
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
}

.stat-card {
    padding: 22px;
    display: grid;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(246, 239, 223, 0.95));
    position: relative;
    overflow: visible;
}

.stat-value {
    font-family: var(--display-font);
    font-size: 2rem;
    color: var(--brand-strong);
}

.stat-value--date {
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    line-height: 1.12;
}

.stat-label {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
}

.stat-detail {
    color: var(--muted);
}

.stat-card--featured {
    padding-top: 28px;
}

.award-ribbon {
    position: absolute;
    top: -10px;
    right: 8px;
    width: 66px;
    height: 98px;
    background-image: url("/assets/SmallRedRibbonTransparent.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 10px 16px rgba(120, 16, 16, 0.18));
    pointer-events: none;
    z-index: 2;
}


.collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.collection-card,
.overview-card,
.note-card {
    padding: 24px;
    display: grid;
    gap: 14px;
}

.collection-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.collection-icon-wrap {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: var(--accent-soft);
    border: 1px solid rgba(85, 97, 58, 0.12);
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

.collection-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.collection-card h3,
.overview-card h3,
.note-card h3,
.info-column h3,
.access-copy h3 {
    font-size: 1.35rem;
}

.collection-card h3 {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    padding-top: 6px;
}

.collection-card p,
.overview-card p,
.note-card p,
.info-column p,
.access-copy p {
    color: var(--muted);
}

.collection-card p,
.collection-card a {
    grid-column: 1 / -1;
}

.collection-link,
.text-link {
    width: fit-content;
    padding-left: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
    color: var(--brand-strong);
    text-decoration: underline;
    text-underline-offset: 0.16em;
    text-decoration-thickness: 1.5px;
}

.collection-link:hover,
.text-link:hover {
    background: transparent;
}

.overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.overview-column {
    display: grid;
    gap: 18px;
    align-content: start;
}

.notes-grid,
.info-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.access-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 28px;
    align-items: center;
}

.access-copy {
    display: grid;
    gap: 12px;
}

.access-list {
    padding-left: 1.25rem;
    color: var(--ink);
}

.access-list li + li {
    margin-top: 8px;
}

.access-actions {
    display: grid;
    gap: 16px;
    justify-items: center;
    text-align: center;
    padding: 24px;
    background: linear-gradient(180deg, rgba(85, 97, 58, 0.12), rgba(85, 97, 58, 0.05));
    border: 1px solid rgba(85, 97, 58, 0.12);
    border-radius: 20px;
}

.access-actions .button-primary {
    justify-content: center;
    font-size: 0.96rem;
    padding: 14px 20px;
}

.access-legal {
    color: var(--muted);
    font-size: 0.96rem;
}

.info-column {
    background: rgba(255, 253, 247, 0.94);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: grid;
    gap: 14px;
}

.info-column--logo {
    place-items: center;
    align-content: center;
    padding: 18px;
}

.info-logo {
    width: min(100%, 180px);
    height: auto;
    display: block;
}

.legal-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.legal-page-title,
.legal-section-title,
.legal-back-link {
    color: #2a4d7a;
}

.legal-page-title {
    margin-bottom: 1rem;
}

.legal-meta {
    margin-bottom: 2rem;
}

.legal-section-title {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-copy {
    margin-bottom: 1.5rem;
}

.legal-list {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.legal-actions {
    text-align: center;
    margin-top: 2rem;
}

.legal-back-link {
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid #2a4d7a;
    border-radius: 5px;
    display: inline-block;
    transition: all 0.3s ease;
}

.legal-back-link:hover {
    background: rgba(42, 77, 122, 0.08);
}

@media (max-width: 960px) {
    .logo-image {
        height: 64px;
    }

    .header-content {
        gap: 14px;
    }

    .hero {
        min-height: 400px;
        padding: 28px;
        background-position: 24% center;
    }

    .hero-support {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-note--below {
        margin-left: 0;
    }

    .stats-grid,
    .collection-grid,
    .notes-grid,
    .info-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .access-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand menu"
            "nav nav";
    }

    .logo-section {
        grid-area: brand;
    }

    .menu-toggle {
        display: inline-flex;
        grid-area: menu;
    }

    .header-nav {
        grid-area: nav;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        background: rgba(255, 251, 241, 0.96);
        border: 1px solid var(--border-soft);
        border-radius: 18px;
        padding: 12px;
        box-shadow: var(--shadow-card);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        justify-content: flex-start;
        padding: 12px 14px;
        font-size: 0.92rem;
    }

    .user-info {
        display: none;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding: 14px;
        background: rgba(255, 251, 241, 0.96);
        border-radius: 18px;
        margin-top: 0;
    }

    .user-info.open {
        display: flex;
    }

    .logo-image {
        height: 56px;
    }

    .container {
        margin: 12px;
        padding: 16px;
    }

    .page-section {
        padding: 22px;
    }

    .about-project-header {
        grid-template-columns: 1fr;
    }

    .about-project-logo {
        justify-self: start;
        width: clamp(110px, 32vw, 150px);
    }

    .landing-page .container {
        padding: 0 12px 18px;
    }

    .hero {
        min-height: 340px;
        padding: 22px;
        align-items: flex-end;
        justify-content: stretch;
        background-position: 30% center;
    }

    .hero-title {
        font-size: clamp(2.1rem, 9vw, 3.2rem);
    }

    .hero-copy {
        font-size: 1.05rem;
    }

    .hero-support {
        padding: 18px;
    }

    .stats-grid,
    .collection-grid,
    .overview-grid,
    .notes-grid,
    .info-columns {
        grid-template-columns: 1fr;
    }

    .overview-column {
        gap: 18px;
    }

    .modal-panel {
        width: calc(100% - 24px);
        margin: 16px auto;
        padding: 20px;
        max-height: calc(100vh - 32px);
    }
}

@media (max-width: 420px) {
    .site-title {
        font-size: 18px;
    }

    .nav-links a,
    .user-logout-link,
    .button-primary,
    .button-secondary,
    .header-signin-button {
        font-size: 14px;
        padding: 10px 12px;
    }

    .legal-page {
        padding: 1.25rem;
    }

    .hero {
        min-height: 300px;
    }
}