:root {
    color-scheme: light dark;
    --bg: #f4f6f5;
    --surface: #fbfcfb;
    --surface-strong: #e8eeeb;
    --text: #14201d;
    --muted: #5c6965;
    --line: #cfd8d4;
    --accent: #177a68;
    --accent-strong: #0e5f51;
    --accent-soft: #d9ece7;
    --focus: #0b6f60;
    --max-width: 1180px;
    --radius: 16px;
    --shadow: 0 18px 50px rgba(20, 52, 44, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI Variable", "Aptos", "Segoe UI", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

img {
    display: block;
    max-width: 100%;
}

.shell {
    width: min(calc(100% - 40px), var(--max-width));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    transform: translateY(-160%);
    border-radius: 10px;
    background: var(--text);
    color: var(--bg);
    padding: 10px 14px;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    background: color-mix(in srgb, var(--bg) 91%, transparent);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 0.98rem;
    font-weight: 720;
    letter-spacing: -0.025em;
    text-decoration: none;
}

.brand-mark {
    width: 18px;
    height: 18px;
    border: 5px solid var(--accent);
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--bg);
}

.utility-nav,
.language-switch {
    display: flex;
    align-items: center;
}

.utility-nav {
    gap: 24px;
    font-size: 0.82rem;
    font-weight: 680;
    letter-spacing: 0.045em;
}

.utility-nav > a {
    text-decoration: none;
}

.language-switch {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
}

.language-switch a {
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--muted);
    text-decoration: none;
}

.language-switch a[aria-current="page"] {
    background: var(--text);
    color: var(--bg);
}

.category-strip {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.category-strip a {
    color: var(--muted);
    font-size: 0.86rem;
    text-decoration: none;
}

.category-strip a:hover {
    color: var(--accent);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
    min-height: min(610px, calc(100dvh - 112px));
    align-items: center;
    gap: clamp(36px, 6vw, 88px);
    padding-block: clamp(48px, 7vw, 88px);
}

.hero-copy {
    max-width: 570px;
}

.hero-label {
    margin: 0 0 22px;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 760;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero h1,
.listing-hero h1,
.article-header h1,
.error-page h1 {
    margin: 0;
    font-weight: 710;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.hero h1 {
    max-width: 12ch;
    font-size: clamp(2.8rem, 5.2vw, 5rem);
}

.hero-copy > p:last-child {
    max-width: 48ch;
    margin: 30px 0 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 1.5vw, 1.22rem);
}

.hero-visual {
    position: relative;
    overflow: hidden;
    margin: 0;
    aspect-ratio: 0.94;
    border-radius: var(--radius);
    background: #18201f;
    box-shadow: var(--shadow);
}

.hero-visual::after {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: inherit;
    content: "";
    pointer-events: none;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 56% center;
}

.feed-section {
    padding-block: clamp(64px, 9vw, 120px);
}

.home-feed {
    padding-top: clamp(36px, 5vw, 64px);
}

.listing-feed {
    padding-top: clamp(24px, 4vw, 48px);
}

.feed-heading {
    max-width: 650px;
    margin-bottom: 40px;
}

.feed-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 710;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.feed-heading p {
    margin: 14px 0 0;
    color: var(--muted);
}

.article-feed {
    border-top: 1px solid var(--line);
}

.feed-item {
    display: grid;
    grid-template-columns: minmax(150px, 0.25fr) minmax(0, 0.75fr);
    gap: 24px clamp(32px, 6vw, 90px);
    padding-block: clamp(34px, 5vw, 62px);
    border-bottom: 1px solid var(--line);
}

.feed-item > :not(.feed-meta) {
    grid-column: 2;
}

.feed-meta {
    display: flex;
    grid-column: 1;
    grid-row: 1 / span 5;
    flex-direction: column;
    gap: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.feed-item h3 {
    margin: 0;
    font-size: clamp(1.45rem, 2.6vw, 2.2rem);
    font-weight: 690;
    letter-spacing: -0.04em;
    line-height: 1.13;
}

.feed-item h3 a {
    text-decoration: none;
}

.feed-item h3 a:hover {
    color: var(--accent);
}

.taxonomy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.taxonomy-row a {
    font-size: 0.83rem;
    font-weight: 690;
    text-decoration: none;
}

.category-link {
    color: var(--accent);
}

.tag-link {
    color: var(--muted);
}

.tag-link::before {
    content: "#";
}

.feed-excerpt {
    max-width: 68ch;
    margin: 0;
    color: var(--muted);
}

.doi-link {
    width: fit-content;
    color: var(--accent);
    font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.empty-state {
    max-width: 540px;
    padding-block: 70px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.7rem;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.pagination {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
    align-items: center;
    gap: 20px;
    padding-top: 28px;
}

.pagination-edge {
    min-width: 0;
}

.pagination-edge-next {
    display: flex;
    justify-content: flex-end;
}

.pagination-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pagination-link {
    display: inline-flex;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 680;
    line-height: 1;
    text-decoration: none;
}

a.pagination-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

a.pagination-link:active {
    transform: translateY(1px);
}

.pagination-current {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
}

.pagination-direction {
    gap: 8px;
    padding-inline: 14px;
}

.pagination-ellipsis {
    min-width: 28px;
    color: var(--muted);
    text-align: center;
}

.pagination-status {
    display: none;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.listing-hero {
    padding-block: clamp(70px, 10vw, 140px) clamp(18px, 4vw, 44px);
}

.listing-hero h1 {
    margin-top: 30px;
    font-size: clamp(2.75rem, 7.2vw, 6.4rem);
}

.listing-hero p {
    max-width: 58ch;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.back-link {
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 690;
}

.article-page {
    padding-block: clamp(36px, 6vw, 64px);
}

.article-header {
    max-width: 960px;
}

.article-header .feed-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 20px 0 14px;
}

.article-header h1 {
    max-width: 18ch;
    font-size: clamp(2.25rem, 4.5vw, 3.8rem);
}

.article-deck {
    max-width: 66ch;
    margin: 20px 0 18px;
    color: var(--muted);
    font-size: clamp(1.12rem, 2vw, 1.35rem);
    line-height: 1.55;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: clamp(48px, 8vw, 110px);
    margin-top: clamp(32px, 5vw, 56px);
}

.article-body {
    min-width: 0;
    max-width: 740px;
    font-size: 1.08rem;
    line-height: 1.72;
}

.article-body > *:first-child {
    margin-top: 0;
}

.article-body h2,
.article-body h3 {
    margin: 2.2em 0 0.65em;
    letter-spacing: -0.035em;
    line-height: 1.17;
}

.article-body h2 {
    font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.article-body h3 {
    font-size: 1.45rem;
}

.article-body p,
.article-body ul,
.article-body ol {
    margin-block: 1.15em;
}

.article-body a {
    color: var(--accent);
}

.article-body blockquote {
    margin: 2.2em 0;
    border-left: 4px solid var(--accent);
    padding-left: 24px;
    color: var(--muted);
    font-size: 1.2rem;
}

.evidence-block {
    display: grid;
    grid-template-columns: minmax(120px, 0.34fr) minmax(0, 0.66fr);
    gap: 24px;
    margin-block: 36px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    padding: clamp(22px, 4vw, 34px);
}

.evidence-block span {
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.evidence-block strong {
    font-size: 1.08rem;
}

.source-card {
    position: sticky;
    top: 138px;
    border-radius: var(--radius);
    background: var(--surface-strong);
    padding: 28px;
}

.source-card h2 {
    margin: 0 0 18px;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.source-title {
    margin: 0 0 24px;
    font-size: 0.94rem;
    font-weight: 660;
    line-height: 1.45;
}

.source-card dl {
    margin: 0 0 24px;
}

.source-card dl div {
    margin-top: 12px;
}

.source-card dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 690;
    text-transform: uppercase;
}

.source-card dd {
    margin: 2px 0 0;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.source-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    padding: 9px 17px;
    font-size: 0.83rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease;
}

.source-button:hover {
    background: var(--accent-strong);
}

.source-button:active {
    transform: translateY(1px);
}

.site-footer {
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-inner p {
    max-width: 42ch;
    margin: 0;
}

.footer-inner p:last-child {
    text-align: right;
}

.footer-credit {
    text-align: center;
}

.footer-credit a {
    color: var(--accent);
    font-weight: 680;
}

.error-page {
    min-height: 65dvh;
    padding-block: 100px;
}

.error-page > p:first-child {
    color: var(--accent);
    font-family: "Cascadia Mono", monospace;
}

.error-page h1 {
    max-width: 12ch;
    margin-bottom: 30px;
    font-size: clamp(3rem, 8vw, 6rem);
}

@media (min-width: 821px) {
    .header-inner {
        min-height: 60px;
    }

    .category-strip {
        min-height: 40px;
    }

    .feed-section {
        padding-block: clamp(36px, 4vw, 58px);
    }

    .home-feed {
        padding-top: clamp(24px, 2.5vw, 34px);
    }

    .listing-feed {
        padding-top: clamp(16px, 2vw, 28px);
    }

    .feed-heading {
        margin-bottom: 22px;
    }

    .feed-heading h2 {
        font-size: clamp(1.9rem, 3vw, 2.8rem);
    }

    .feed-heading p {
        margin-top: 8px;
    }

    .feed-item {
        gap: 18px clamp(28px, 4vw, 56px);
        padding-block: clamp(24px, 2.5vw, 34px);
    }

    .feed-item h3 {
        font-size: clamp(1.4rem, 2.2vw, 2rem);
    }

    .listing-hero {
        padding-block: clamp(34px, 4vw, 52px) clamp(6px, 1vw, 14px);
    }

    .listing-hero h1 {
        margin-top: 18px;
        font-size: clamp(2.7rem, 5vw, 4.8rem);
    }

    .listing-hero p {
        margin-top: 12px;
    }

    .article-page {
        padding-block: clamp(24px, 3vw, 38px);
    }

    .article-header .feed-meta {
        margin: 14px 0 10px;
    }

    .article-header h1 {
        font-size: clamp(2.4rem, 3.8vw, 3.6rem);
    }

    .article-deck {
        margin: 16px 0 14px;
    }

    .article-layout {
        gap: clamp(36px, 5vw, 72px);
        margin-top: clamp(26px, 3.5vw, 42px);
    }

    .article-body h2,
    .article-body h3 {
        margin-top: 1.65em;
    }

    .article-body p,
    .article-body ul,
    .article-body ol {
        margin-block: 0.9em;
    }

    .article-body blockquote {
        margin-block: 1.65em;
    }

    .evidence-block {
        margin-block: 26px;
    }

    .source-card {
        padding: 24px;
    }

    .source-title,
    .source-card dl {
        margin-bottom: 18px;
    }

    .footer-inner {
        min-height: 92px;
    }
}

@media (max-width: 820px) {
    .shell {
        width: min(calc(100% - 30px), var(--max-width));
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: 0;
        gap: 28px;
        padding-block: 36px 50px;
    }

    .hero-label {
        margin-bottom: 14px;
    }

    .hero-copy > p:last-child {
        margin-top: 20px;
    }

    .hero h1 {
        max-width: 12ch;
        font-size: clamp(2.5rem, 10.5vw, 3.3rem);
    }

    .hero-visual {
        aspect-ratio: 4 / 3;
    }

    .feed-item {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .feed-item > :not(.feed-meta),
    .feed-meta {
        grid-column: 1;
        grid-row: auto;
    }

    .feed-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 16px;
    }

    .article-layout {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-top: 42px;
    }

    .source-card {
        position: static;
    }
}

@media (max-width: 540px) {
    body {
        font-size: 16px;
    }

    .header-inner {
        min-height: 56px;
    }

    .utility-nav {
        gap: 12px;
    }

    .utility-nav > a {
        display: none;
    }

    .category-strip {
        min-height: 40px;
        gap: 17px;
    }

    .hero {
        gap: 24px;
        padding-block: 30px 42px;
    }

    .home-feed {
        padding-block: 24px 18px;
    }

    .feed-heading {
        margin-bottom: 26px;
    }

    .feed-heading p {
        margin-top: 8px;
    }

    .feed-item {
        gap: 10px;
        padding-block: 24px;
    }

    .pagination {
        grid-template-columns: minmax(74px, 1fr) auto minmax(74px, 1fr);
        gap: 10px;
        padding-top: 22px;
    }

    .pagination-pages {
        display: none;
    }

    .pagination-status {
        display: block;
    }

    .pagination-link {
        min-height: 38px;
    }

    .pagination-direction {
        gap: 5px;
        padding-inline: 10px;
    }

    .listing-hero {
        padding-block: 26px 0;
    }

    .listing-hero h1 {
        margin-top: 16px;
    }

    .listing-hero p {
        margin-top: 10px;
    }

    .listing-feed {
        padding-top: 16px;
        padding-bottom: 18px;
    }

    .article-page {
        padding-block: 20px 28px;
    }

    .article-header .feed-meta {
        margin: 14px 0 10px;
    }

    .article-header h1 {
        font-size: clamp(1.95rem, 8vw, 2.4rem);
    }

    .article-deck {
        margin: 16px 0 14px;
        line-height: 1.48;
    }

    .taxonomy-row {
        gap: 6px 12px;
    }

    .article-layout {
        gap: 22px;
        margin-top: 24px;
    }

    .article-body {
        font-size: 1rem;
    }

    .article-body h2,
    .article-body h3 {
        margin: 1.4em 0 0.45em;
    }

    .article-body p,
    .article-body ul,
    .article-body ol {
        margin-block: 0.75em;
    }

    .evidence-block {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-block: 22px;
        padding: 20px;
    }

    .source-card {
        padding: 22px;
    }

    .source-card h2 {
        margin-bottom: 12px;
    }

    .source-title {
        margin-bottom: 16px;
    }

    .source-card dl {
        margin-bottom: 18px;
    }

    .source-card dl div {
        margin-top: 8px;
    }

    .footer-inner {
        min-height: 0;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 14px;
        padding-block: 22px;
    }

    .footer-credit,
    .footer-inner p:last-child {
        text-align: left;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111514;
        --surface: #161c1a;
        --surface-strong: #202a27;
        --text: #edf3f1;
        --muted: #a3b0ac;
        --line: #34413d;
        --accent: #65c8b5;
        --accent-strong: #82d7c6;
        --accent-soft: #17352f;
        --focus: #75d7c4;
        --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
