:root {
    color-scheme: light;
    --ink: #211b1b;
    --muted: #655454;
    --paper: #f8f3e9;
    --panel: #fffaf1;
    --line: #e1d1bf;
    --black: #160f11;
    --red: #8b222b;
    --red-hover: #6f1821;
    --gold: #f3cc68;
    --serif: Georgia, 'Times New Roman', serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.55 system-ui, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.65rem, 7vw, 5rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); letter-spacing: -.025em; }
h3 { font-size: 1.35rem; }
a { color: inherit; }
a, button, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #9b3327; outline-offset: 4px; }
.site-header :focus-visible, .hero :focus-visible, .footer :focus-visible { outline-color: var(--gold); }
.menu nav :focus-visible { outline-color: var(--red); outline-offset: -3px; }
.skip { position: absolute; left: 1rem; top: -10rem; z-index: 10; background: var(--panel); padding: .8rem; }
.skip:focus { top: 1rem; }
.shell { width: min(calc(100% - 3rem), 72rem); margin-inline: auto; }
.site-header { background: #151012; color: #fff6e4; border-bottom: 1px solid #743036; position: relative; z-index: 1; }
.header-inner, .footer-inner { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; font-family: var(--serif); line-height: 1.05; }
.brand strong { font-size: 1.22em; }
.brand img { object-fit: contain; flex-shrink: 0; }
.menu { position: relative; }
.menu summary { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border: 1px solid #a4774b; border-radius: .32rem; cursor: pointer; list-style: none; font-weight: 650; }
.menu summary::-webkit-details-marker { display: none; }
.menu .hamburger { color: var(--gold); }
.menu summary:hover { background: #36171d; }
.menu nav { position: absolute; right: 0; top: calc(100% + .55rem); min-width: 12rem; color: var(--ink); border: 1px solid var(--line); background: var(--panel); padding: .3rem; box-shadow: 0 14px 35px #210b1228; border-radius: .35rem; }
.menu nav a { display: block; padding: .65rem .85rem; border-radius: .2rem; text-decoration: none; }
.menu nav a:hover, .menu nav a[aria-current] { background: #f4e6dc; color: var(--red-hover); }
.hero, .banner { color: #fff6e4; background:
        radial-gradient(ellipse at 76% 44%, #5b181f 0%, transparent 62%),
        linear-gradient(115deg, #100c0e 10%, var(--black) 58%, #291014); border-bottom: 3px solid #c59542; }
.hero-inner { min-height: 452px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 2rem; padding-block: 3rem; }
.hero h1 { font-size: clamp(3rem, 7.2vw, 6.15rem); }
.hero h1 em { color: var(--gold); font-weight: inherit; }
.hero-copy > p:not(.eyebrow), .banner p:last-child { margin-block: 1rem 1.5rem; max-width: 33rem; color: #f0ddd4; font-size: 1.06rem; }
.eyebrow { font-size: .74rem; letter-spacing: .17em; text-transform: uppercase; font-weight: 750; margin-bottom: .85rem; }
.hero .eyebrow, .banner .eyebrow { color: #f3d081; }
.eyebrow span { margin-right: .35rem; }
.crest { position: relative; isolation: isolate; display: grid; place-items: center; width: min(100%, 22rem); aspect-ratio: 1; margin-inline: auto; }
.crest::before, .crest::after { content: ''; position: absolute; inset: 10%; z-index: -1; border: 1px solid #e8b95880; border-radius: 50%; box-shadow: inset 0 0 45px #11070b65; }
.crest::after { inset: 4%; border-style: solid; border-color: #e8b95860; box-shadow: none; }
.crest img { width: 67%; height: auto; max-height: 78%; object-fit: contain; filter: drop-shadow(0 12px 16px #100507b0); }
.ornament { color: var(--gold); position: absolute; line-height: 1; font-size: 1.2rem; }
.ornament.top { top: 1%; }
.ornament.bottom { bottom: 1%; }
.banner { padding-block: 2.8rem 2rem; }
.banner p:last-child { margin-bottom: 0; }
.content { padding-block: 2.5rem 3.4rem; }
.narrow { max-width: 36rem; }
.section-heading, .actions, .document-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.section-heading { justify-content: space-between; gap: .9rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--line); }
.text-link { color: var(--red-hover); text-underline-offset: .25em; font-weight: 675; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .6rem .95rem; min-height: 43px; border: 1px solid transparent; border-radius: .28rem; font: 650 .9rem/1.2 system-ui, sans-serif; cursor: pointer; text-decoration: none; }
.button.gold { background: var(--gold); color: #21130f; }
.button.gold:hover { background: #ffde8c; }
.button.primary { background: var(--red); color: white; }
.button.primary:hover { background: var(--red-hover); }
.button.outline { border-color: #d2b9a9; background: var(--panel); }
.button.outline:hover { background: #f4e6dc; }
.button.danger { border-color: #dfbdb5; color: #8a2b20; background: #fff8f5; }
.button.danger:hover { background: #f5ded7; }
.empty, .panel, .document { background: var(--panel); border: 1px solid var(--line); border-radius: .38rem; }
.empty { padding: 1.75rem; margin-top: 1rem; }
.empty p { color: var(--muted); margin-top: .25rem; }
.panel { padding: clamp(1rem, 3vw, 1.65rem); }
.panel h2, .account h1 { margin-bottom: 1rem; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem; margin-bottom: 1.6rem; }
.filters label { flex: 1 1 13rem; min-width: 0; }
label { display: grid; gap: .3rem; font-weight: 650; min-width: 0; }
input:not([type=hidden]), select, textarea { width: 100%; min-width: 0; padding: .62rem; border: 1px solid #c9b3a0; border-radius: .25rem; color: var(--ink); background: #fffdf8; font: 1rem/1.25 system-ui, sans-serif; }
textarea { resize: vertical; }
small, .metadata, .file-detail { color: var(--muted); }
.document-list { display: grid; gap: .65rem; margin-top: 1rem; }
.document { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: .85rem; padding: 1rem; }
.file-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: .28rem; background: #f6e7c8; color: #7b4817; }
.metadata, .file-detail { font-size: .8rem; overflow-wrap: anywhere; }
.metadata { margin-bottom: .25rem; }
.file-detail { margin-top: .3rem; }
.description { white-space: pre-line; overflow-wrap: anywhere; margin-top: .25rem; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-top: 1.3rem; }
.pagination a, .pagination span { display: inline-grid; min-width: 35px; min-height: 38px; align-items: center; justify-items: center; padding: .35rem .7rem; }
.pagination a { border: 1px solid var(--line); border-radius: .25rem; background: var(--panel); text-decoration: none; }
.pagination .current { color: white; background: var(--red); border-radius: .25rem; }
.stack { display: grid; gap: .85rem; }
.stack > button { justify-self: start; }
.account h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.account p + a { margin-top: .8rem; }
.notice { margin-bottom: 1rem; padding: .8rem 1rem; background: #f7ebcf; border-left: 4px solid #946419; color: #573611; }
.notice.error { background: #f8e5df; border-color: #a44c3a; color: #772d22; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.logout { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.admin-list-title { margin-top: 2rem; }
.categories { padding: 0; margin: 1rem 0 0; list-style: none; }
.categories li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .65rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.footer { border-top: 2px solid #a64a42; background: #151012; color: #fff6e4; }
.footer-inner > a:last-child { color: var(--gold); font-size: .88rem; text-underline-offset: .23em; }
@media (max-width: 800px) {
    .hero-inner { min-height: 365px; gap: 1rem; }
    .document-actions { grid-column: 2; }
    .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 550px) {
    .shell { width: calc(100% - 2rem); }
    .header-inner { min-height: 65px; }
    .hero-inner { grid-template-columns: 1fr; padding-block: 2rem; gap: 1.5rem; }
    .hero h1 { font-size: clamp(2.65rem, 11vw, 4.1rem); }
    .crest { width: min(65%, 15rem); }
    .content { padding-block: 1.6rem 2rem; }
    .document { padding: .75rem; gap: .55rem; }
    .footer-inner { flex-wrap: wrap; padding-block: .8rem; }
}
