@font-face {
    font-family: Journal Sans;
    src: url('sans.woff2') format('woff2');
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
}

:root {
    --paper: #f8f8f3;
    --panel: #fff;
    --ink: #171a16;
    --muted: #555b52;
    --line: #dadcd5;
    --accent: #205350;
    --on-accent: #fff;
    --title: 'Journal Sans', sans-serif;
    --body: 'Journal Sans', system-ui, sans-serif;
    --shell: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.58 var(--body); }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .19em; }
img { display: block; height: auto; max-width: 100%; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--title); line-height: 1.04; text-wrap: balance; }
.wrap { width: min(var(--shell), calc(100% - clamp(2rem, 7vw, 7rem))); margin-inline: auto; }
.visually-hidden, .screen-reader-text, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 20; left: 1rem; top: 1rem; color: var(--on-accent); background: var(--accent); padding: .8rem 1rem; }

.masthead { position: relative; z-index: 5; border-bottom: 1px solid var(--line); }
.mast-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(1rem, 3vw, 3rem); min-height: 4.7rem; }
.wordmark { display: inline-flex; align-items: center; gap: .7rem; width: fit-content; font: 750 1.25rem/1 var(--title); text-decoration: none; }
.wordmark img { flex: 0 0 34px; }
.topics-nav { display: flex; justify-content: center; align-items: center; gap: clamp(.8rem, 2.25vw, 2.3rem); }
.topics-nav a, .site-search summary, .page-footer nav a { font-size: .875rem; font-weight: 620; text-decoration: none; white-space: nowrap; }
.topics-nav a:hover, .topics-nav a[aria-current], .page-footer nav a:hover { color: var(--accent); text-decoration: underline; }
.site-search { position: relative; }
.site-search summary { display: flex; align-items: center; gap: .55rem; list-style: none; }
.site-search summary::-webkit-details-marker { display: none; }
.search-mark { display: inline-block; position: relative; width: .83rem; aspect-ratio: 1; border: 1.5px solid currentColor; border-radius: 50%; }
.search-mark::after { position: absolute; inset: 82% auto auto 78%; width: .42rem; height: 1.5px; transform: rotate(45deg); transform-origin: left; background: currentColor; content: ''; }
.search-form { position: absolute; top: 2rem; right: 0; display: flex; width: min(22rem, 83vw); gap: .4rem; padding: .6rem; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 36px #0002; }
.search-form input { min-width: 0; flex: 1; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: .55rem; }
.search-form button { border: 0; background: var(--accent); color: var(--on-accent); padding: .55rem .75rem; }

.button { display: inline-flex; align-items: center; justify-content: center; padding: .74rem 1.1rem; min-height: 2.75rem; background: var(--accent); border: 1px solid transparent; color: var(--on-accent); font-weight: 700; font-size: .9375rem; text-decoration: none; }
.button:hover { filter: brightness(.9); }
.latest { margin-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 6rem); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-block: 1.05rem 1.35rem; }
.section-heading h2 { font-size: clamp(1.65rem, 3.15vw, 2.7rem); }
.section-heading > a { font-size: .875rem; font-weight: 650; }
.story-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.05rem, 2vw, 2rem); }
.story-card { min-width: 0; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.story-cover { display: block; overflow: hidden; background: var(--line); aspect-ratio: 3 / 2; }
.story-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.story-card:hover .story-cover img { transform: scale(1.035); }
.story-body { padding-top: .8rem; }
.story-meta { display: flex; flex-wrap: wrap; gap: .3rem .65rem; align-items: center; font-size: .8125rem; font-weight: 650; color: var(--muted); }
.story-meta span:first-child { color: var(--accent); }
.story-card h3 { margin-top: .45rem; font-size: clamp(1.25rem, 1.8vw, 1.7rem); }
.story-card h3 a { text-decoration: none; }
.story-card h3 a:hover { text-decoration: underline; }
.story-card p { color: var(--muted); margin-top: .55rem; font-size: .9375rem; }
.listing { padding-block: clamp(2.4rem, 7vw, 6rem); min-height: 55vh; }
.listing h1 { font-size: clamp(2.2rem, 6vw, 5.3rem); margin-bottom: 2rem; }
.listing .button { margin-top: 1rem; }
.pagination { margin-top: 2rem; }
.page-numbers { padding: .35rem .65rem; border: 1px solid var(--line); margin-right: .25rem; }
.page-numbers.current { color: var(--on-accent); background: var(--accent); }

.single-article { padding-block: clamp(2.4rem, 5.5vw, 5.2rem); }
.article-heading { max-width: 58rem; margin: 0 auto 1.8rem; }
.article-topic { font-weight: 700; font-size: .9375rem; color: var(--accent); }
.article-heading h1 { font-size: clamp(2.1rem, 6vw, 5.4rem); margin-top: .7rem; letter-spacing: -.03em; }
.article-deck { font-size: clamp(1rem, 2vw, 1.25rem); margin-top: 1rem; color: var(--muted); max-width: 44rem; }
.article-byline { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.1rem; font-size: .875rem; color: var(--muted); }
.article-cover { max-width: 58rem; margin: 0 auto 2rem; }
.article-cover img { width: 100%; aspect-ratio: 2/1; object-fit: cover; }
.article-cover figcaption { font-size: .8125rem; color: var(--muted); margin-top: .5rem; }
.prose { width: min(100%, 43rem); margin-inline: auto; font-size: clamp(1rem, 1.8vw, 1.125rem); line-height: 1.72; }
.prose > * + * { margin-top: 1.12rem; }
.prose h1 { font-size: clamp(2.4rem, 5.8vw, 4.6rem); }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-top: 1.85rem; }
.prose a { color: var(--accent); overflow-wrap: anywhere; }
.prose pre { padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: .3rem; line-height: 1.5; overflow-x: auto; }
.prose code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
.prose blockquote { border-left: 3px solid var(--accent); margin-inline: 0; padding-left: 1rem; }
.standard-page { padding-block: 4rem; min-height: 45vh; }
.more-stories { margin-top: 4rem; }
.page-footer { padding-block: 1.7rem 2.3rem; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1.6rem; }
.footer-inner p { max-width: 35rem; margin-top: .7rem; color: var(--muted); font-size: .9375rem; }
.page-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }

@media (max-width: 950px) {
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mast-inner { grid-template-columns: 1fr auto; gap: .85rem; padding-block: .9rem .75rem; }
    .topics-nav { grid-column: 1 / -1; grid-row: 2; justify-content: start; flex-wrap: wrap; }
}
@media (max-width: 510px) {
    .story-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .mast-inner { min-height: 0; }
    .topics-nav { column-gap: 1rem; row-gap: .35rem; }
    .section-heading { flex-wrap: wrap; gap: .45rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
