:root {
    color-scheme: light;
    --paper: #f5f1e9;
    --ink: #201d1a;
    --muted: #60574e;
    --line: #d4c9bb;
    --accent: #ff7a38;
    --accent-ink: #9d3514;
    --dark: #201c19;
    font: 16px/1.55 system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--accent-ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #bb481f; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.45rem, 6vw, 4.5rem); letter-spacing: -.065em; }
h2 { font-size: clamp(1.8rem, 4.5vw, 3.2rem); letter-spacing: -.055em; }
h3 { font-size: clamp(1.22rem, 2.8vw, 1.5rem); letter-spacing: -.03em; }

.wrap { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.label { font: 700 .73rem/1.45 ui-monospace, Consolas, monospace; letter-spacing: .09em; text-transform: uppercase; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; inset: 1rem auto auto 1rem; z-index: 3; padding: .65rem 1rem; background: white; }

.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 2rem; min-height: 80px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; width: fit-content; font-size: 1.3rem; font-weight: 800; letter-spacing: -.05em; text-decoration: none; overflow-wrap: anywhere; }
.brand img { flex: 0 0 32px; width: 32px; height: 32px; object-fit: contain; }
.primary-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.7rem; font-weight: 650; }
.primary-nav a { text-decoration: none; }
.primary-nav [aria-current] { color: var(--accent-ink); text-decoration: underline; }
.search-form { display: flex; border: 1px solid var(--line); }
.header-search { justify-self: end; width: min(100%, 235px); }
.search-form input { width: 100%; min-width: 0; padding: .55rem .75rem; border: 0; background: transparent; color: inherit; }
.search-form button { display: grid; place-items: center; min-width: 44px; padding: .45rem .7rem; border: 0; background: transparent; color: inherit; }
.search-form button:hover { background: var(--accent); }

.cover { background: var(--dark); color: #faf2e7; }
.cover-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(2.5rem, 6vw, 5rem); }
.cover-label { display: flex; align-items: center; gap: .7rem; color: #f3ba99; }
.cover-label span { width: .55rem; height: .55rem; background: var(--accent); }
.cover h1 { margin-block: .25em; font-size: clamp(3.65rem, 8.15vw, 7.6rem); line-height: .89; letter-spacing: -.085em; }
.cover h1 em { color: var(--accent); font-style: normal; }
.intro { max-width: 36ch; margin-block: 1.65rem 1.8rem; color: #e0d1c5; font-size: clamp(1rem, 2vw, 1.22rem); }
.button { display: inline-flex; align-items: center; gap: 1.2rem; padding: .75rem 1rem; background: var(--accent); color: var(--dark); font-weight: 800; text-decoration: none; }
.button:hover { background: #ff9a67; color: var(--dark); }
.cover :focus-visible { outline-color: #ffae88; }
.cover-figure { min-width: 0; margin: 0; }
.cover-figure img { width: 100%; border: 1px solid #654536; }
.cover-figure figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding-top: .75rem; color: #dfc2b0; }

.section { margin-block: clamp(2rem, 5vw, 4.4rem); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .5rem 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.15rem; }
.section-head .label, .result-count { color: var(--accent-ink); margin-bottom: .35rem; }
.section-head a { font-size: .93rem; font-weight: 650; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); gap: 1.25rem; }
.story-card { min-width: 0; border: 1px solid var(--line); background: #fcf9f4; }
.story-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.story-copy { padding: 1.05rem; }
.story-copy time { color: var(--accent-ink); }
.story-copy h3 { margin-block: .5rem; }
.story-copy h3 a { text-decoration: none; }
.story-copy h3 a:hover { text-decoration: underline; }
.story-copy p { color: var(--muted); overflow-wrap: anywhere; }
.ranking { padding: 0; margin: 0; list-style: none; }
.ranking a { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .8rem 0; border-bottom: 1px solid var(--line); text-decoration: none; overflow-wrap: anywhere; }
.ranking .label { color: var(--accent-ink); }
.empty { border-left: 3px solid var(--accent); padding: 1rem; background: #fcf9f4; color: var(--muted); }

.inner { padding-block: 2rem 4rem; }
.inner h1 { margin-bottom: 1.25rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin-bottom: 1.5rem; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.inner-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 225px); gap: clamp(1.8rem, 5vw, 4rem); }
.inner-main:only-child { grid-column: 1 / -1; }
.topic-index { align-self: start; border-top: 2px solid var(--ink); padding-top: 1rem; }
.topic-index h2 { font-size: 1.35rem; }
.topic-index a { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); text-decoration: none; overflow-wrap: anywhere; }
.topic-index [aria-current] { color: var(--accent-ink); font-weight: 750; }
.large-search { max-width: 42rem; margin-bottom: 1.25rem; }
.large-search button { padding-inline: 1rem; background: var(--accent); font-weight: 750; }
.chips, .pagination { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: 1rem; }
.chips a, .pagination a, .pagination span { border: 1px solid var(--line); padding: .35rem .7rem; text-decoration: none; overflow-wrap: anywhere; }
.pagination [aria-current] { color: #fff; background: var(--dark); }
.article-meta { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--muted); }
.article-image { width: 100%; margin: 1.25rem 0; }
.prose { max-width: 70ch; font-size: 1.08rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose > * + * { margin-block-start: 1em; }
.prose :is(pre, table) { display: block; max-width: 100%; overflow: auto; }
.prose :is(img, iframe, video) { max-width: 100%; }
.prose dt { font-weight: 750; }
.prose dd { margin: 0 0 .85rem; }
.about .label { color: var(--accent-ink); margin-bottom: .5rem; }

.comments { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.comment, .comment-form, .comment-pagination, .comment-success, .comment-error { margin-block: .9rem; }
.comment { padding: 1rem; background: #fcf9f4; }
.comment-form label { display: block; margin-block: .5rem; }
.comment-form input:not([type="checkbox"]), .comment-form textarea { display: block; width: 100%; padding: .45rem; border: 1px solid var(--line); }
.comment-form button { padding: .55rem .85rem; border: 0; background: var(--accent); color: var(--ink); font-weight: 750; }
.comment-form .comment-trap { display: none; }
.comment-success { color: #225a34; }
.comment-error { color: #922915; }
.comment-pagination { display: flex; flex-wrap: wrap; gap: .6rem; }

.site-footer { border-top: 1px solid var(--line); padding-block: 1.65rem; }
.footer-row, .footer-row nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .6rem 1.25rem; overflow-wrap: anywhere; }
.footer-brand { font-weight: 800; }
.footer-row p { color: var(--muted); font-size: .9rem; }
.cookie-banner { position: fixed; z-index: 2; right: 1.25rem; bottom: 1.25rem; display: flex; align-items: center; gap: 1rem; width: min(635px, calc(100% - 2.5rem)); padding: 1rem; border: 1px solid var(--line); background: #fffaf2; box-shadow: 0 8px 32px #24180924; }
.cookie-banner p { color: var(--muted); font-size: .84rem; }
.cookie-actions { display: flex; gap: .4rem; }
.cookie-actions button { border: 1px solid var(--line); padding: .43rem .55rem; background: transparent; font-size: .85rem; font-weight: 700; }
.cookie-actions [data-cookie="accepted"] { border-color: var(--accent); background: var(--accent); }
.error-view { padding-block: 2rem 4rem; }
.error-code { margin-top: 2rem; color: var(--accent-ink); font-size: clamp(5rem, 18vw, 12rem); font-weight: 850; letter-spacing: -.09em; line-height: .95; }
.error-view h1 { margin-block: .6rem 1.35rem; }

@media (max-width: 820px) {
    .wrap { width: calc(100% - 40px); }
    .header-row { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; padding-block: .8rem; }
    .header-search { grid-column: 1 / -1; justify-self: stretch; width: auto; }
    .cover-grid { gap: 1.5rem; }
    .cover h1 { font-size: clamp(2.7rem, 8.5vw, 5rem); }
    .inner-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 540px) {
    .header-row { grid-template-columns: minmax(0, 1fr); }
    .primary-nav { gap: 1rem; font-size: .9rem; }
    .cover-grid { grid-template-columns: minmax(0, 1fr); }
    .cover h1 { font-size: clamp(3.25rem, 13vw, 4.7rem); }
    .cookie-banner { right: .6rem; bottom: .6rem; width: calc(100% - 1.2rem); flex-direction: column; align-items: start; gap: .55rem; }
}
