@font-face {
    font-family: "Golos Text";
    src: url("/assets/golos-cyr-v1.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Golos Text";
    src: url("/assets/golos-latin-v1.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212;
}

@font-face {
    font-family: "Playfair Display";
    src: url("/assets/playfair-cyr-v1.woff2") format("woff2");
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Playfair Display";
    src: url("/assets/playfair-latin-v1.woff2") format("woff2");
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212;
}

:root {
    color-scheme: light;
    --display: "Playfair Display", Georgia, serif;
    --text: "Golos Text", sans-serif;
    --paper: #f8f2e9;
    --ink: #221915;
    --soft-ink: #62534b;
    --wash: #eddfd0;
    --rule: #b9aa9b;
    --strong-rule: #402e26;
    --accent: #922e17;
    --stamp: #f7aa76;
    --stamp-ink: #30160d;
    --logo: url("/assets/logo-light-v1.webp");
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --paper: #1b1513;
        --ink: #f8eee4;
        --soft-ink: #c2afa3;
        --wash: #3a2b25;
        --rule: #655047;
        --strong-rule: #c9ad9c;
        --accent: #ffab80;
        --stamp: #e99369;
        --stamp-ink: #27150f;
        --logo: url("/assets/logo-dark-v1.webp");
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #1b1513;
    --ink: #f8eee4;
    --soft-ink: #c2afa3;
    --wash: #3a2b25;
    --rule: #655047;
    --strong-rule: #c9ad9c;
    --accent: #ffab80;
    --stamp: #e99369;
    --stamp-ink: #27150f;
    --logo: url("/assets/logo-dark-v1.webp");
}

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

body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(ellipse at 75% 0%, var(--wash), transparent 68%) fixed, var(--paper);
    font: 1rem/1.6 var(--text);
}

a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.page {
    width: min(100% - 2.25rem, 75rem);
    min-height: 100svh;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
}

.page > main { flex: 1; }

.skip-link {
    position: fixed;
    z-index: 2;
    inset: .5rem auto auto .5rem;
    padding: .5rem 1rem;
    background: var(--paper);
    transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.masthead {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: .75rem;
    padding-block: .85rem .75rem;
}

.masthead-logo {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, 13.5rem);
    aspect-ratio: 3;
    background: var(--logo) left center / contain no-repeat;
}

.masthead-caption {
    grid-column: 1 / -1;
    margin: .05rem 0 0;
    color: var(--soft-ink);
    font-size: .875rem;
}

.theme-button {
    grid-column: 2;
    grid-row: 1;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--rule);
    border-radius: 50%;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
}

.theme-button[hidden],
.theme-button[aria-pressed="false"] .theme-sun,
.theme-button[aria-pressed="true"] .theme-moon { display: none; }
.theme-button:hover { border-color: var(--accent); color: var(--accent); }
.theme-button svg { width: 1.25rem; height: 1.25rem; }

.primary-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-block: 1px solid var(--strong-rule);
}

.primary-nav a {
    display: flex;
    min-height: 2.85rem;
    align-items: center;
    padding: .5rem .25rem;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
}

.primary-nav a:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
.primary-nav a:nth-child(even) { padding-left: .75rem; border-left: 1px solid var(--rule); }
.primary-nav a:hover,
.primary-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }

.lead {
    display: grid;
    gap: 1.65rem;
    padding-block: clamp(1.85rem, 4vw, 3.5rem);
}

.eyebrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem .75rem;
    margin: 0 0 1rem;
    color: var(--soft-ink);
    font-size: .75rem;
    font-weight: 600;
}

.stamp {
    padding: .2rem .5rem;
    color: var(--stamp-ink);
    background: var(--stamp);
}

h1, h2, h3 {
    margin: 0;
    font-family: var(--display);
}

h1 {
    font-size: clamp(2.65rem, 8.5vw, 5rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.lead-summary {
    max-width: 34rem;
    margin: 1.1rem 0 0;
    color: var(--soft-ink);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.read-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin-top: .75rem;
    color: var(--accent);
    font-weight: 700;
}

.lead-figure { margin: 0; min-width: 0; }

.lead-figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: var(--wash);
}

.lead-figure figcaption {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .2rem .75rem;
    padding-top: .5rem;
    color: var(--soft-ink);
    font-size: .75rem;
}

.directory {
    border-top: 3px double var(--strong-rule);
    padding-block: .9rem 2rem;
}

.directory h2 { font-size: 1.6rem; }

.directory-grid {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
}

.directory-grid li {
    padding: .9rem 0;
    border-block-start: 1px solid var(--rule);
}

.directory-grid h3 { font-size: 1.35rem; line-height: 1.25; }
.directory-grid h3 a { text-decoration-thickness: 1px; }
.directory-grid p { margin: .35rem 0 0; color: var(--soft-ink); }

.home-link {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    margin-top: 1rem;
    color: var(--accent);
}

.lead-article { padding-top: .75rem; }

.article-body {
    max-width: 42rem;
    font-size: 1.13rem;
    line-height: 1.75;
}

.article-body p:first-child { margin-top: 0; }
.article-body p:last-child { margin-bottom: 0; }

.section-page { padding-bottom: 3rem; }
.section-page h1 { margin-top: 1rem; }
.section-empty { margin-top: 2rem; padding-block: 1rem; border-block: 1px solid var(--rule); }

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .15rem 1.5rem;
    padding-block: .75rem 1rem;
    border-top: 1px solid var(--strong-rule);
    color: var(--soft-ink);
    font-size: .875rem;
}

.footer nav { display: flex; gap: 1rem; }
.footer nav a { display: inline-flex; min-height: 2.75rem; align-items: center; }

@media (min-width: 42rem) {
    .page { width: min(100% - 4rem, 75rem); }
    .masthead { grid-template-columns: 1fr auto 1fr; padding-block: .75rem; }
    .masthead-logo { grid-column: 2; width: 16rem; background-position: center; }
    .masthead-caption { grid-column: 1; grid-row: 1; }
    .theme-button { grid-column: 3; justify-self: end; }
    .primary-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .primary-nav a,
    .primary-nav a:nth-child(even) { justify-content: center; padding-inline: .5rem; border: 0; }
    .primary-nav a:nth-child(n+2) { border-left: 1px solid var(--rule); }
    .primary-nav a:nth-child(-n+2) { border-bottom: 0; }
    .directory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
}

@media (min-width: 56rem) {
    .lead { grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); align-items: center; gap: 2rem clamp(2rem, 5vw, 4.5rem); }
    .lead-copy { padding-bottom: 1.3rem; }
    .lead-copy h1 { max-width: 11ch; }
    .article-body { grid-column: 1 / -1; width: 100%; justify-self: center; }
    .directory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
    .lead { animation: enter .38s ease-out both; }
    @keyframes enter {
        from { transform: translateY(.35rem); }
        to { transform: translateY(0); }
    }
}
