/* Layout: hero, news and tiles on a warm ground; soft rounded cards.
   Palette and type: cream ground, stone neutrals, clay accent,
   serif display, geometric sans body, mono for identifiers. */
:root {
  --paper: #f0eee6;          /* ivory ground */
  --card: #faf9f5;           /* raised card */
  --surface: #e8e6dc;        /* inset / figure ground */
  --ink: #141413;
  --ink-2: #5e5d59;
  --rule: #e0ddd3;
  --accent: #d97757;         /* terracotta */
  --accent-ink: #b65b3b;     /* terracotta, darkened for text on ivory */
  --flag: #c8603d;
  --ok: #3b5587;             /* deep slate blue for "checked" marks */
  --sev-low-bg: #e6ebdc; --sev-low-fg: #4a6330;
  --sev-mod-bg: #f6e2c9; --sev-mod-fg: #8a5214;
  --sev-high-bg: #f4d5cc; --sev-high-fg: #93311f;
  --state-merged: #6f5a8f; --state-open: #5e5d59; --state-closed: #8e8c84;
  --shadow: 0 1px 2px rgba(60, 50, 30, 0.05), 0 8px 24px -16px rgba(60, 50, 30, 0.25);
  --r: 14px;

  --f-display: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --f-body: "Instrument Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.8125rem; --step-0: 1.0625rem; --step-1: 1.1875rem;
  --step-2: 1.5rem; --step-3: 2.125rem; --step-4: clamp(2.5rem, 5.4vw, 3.9rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1915; --card: #23221e; --surface: #2d2b26; --ink: #ecebe5; --ink-2: #a4a29a; --rule: #38362f;
    --accent: #e08a67; --accent-ink: #e59c7d; --flag: #e08a67; --ok: #8aa5d6;
    --sev-low-bg: #2a3321; --sev-low-fg: #b3cb9f;
    --sev-mod-bg: #3d2e16; --sev-mod-fg: #ecc07a;
    --sev-high-bg: #42201a; --sev-high-fg: #f1a898;
    --state-merged: #b39ae0; --state-open: #b9b6ad; --state-closed: #8e8b83;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -16px rgba(0,0,0,0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1a1915; --card: #23221e; --surface: #2d2b26; --ink: #ecebe5; --ink-2: #a4a29a; --rule: #38362f;
  --accent: #e08a67; --accent-ink: #e59c7d; --flag: #e08a67; --ok: #8aa5d6;
  --sev-low-bg: #2a3321; --sev-low-fg: #b3cb9f;
  --sev-mod-bg: #3d2e16; --sev-mod-fg: #ecc07a;
  --sev-high-bg: #42201a; --sev-high-fg: #f1a898;
  --state-merged: #b39ae0; --state-open: #b9b6ad; --state-closed: #8e8b83;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -16px rgba(0,0,0,0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: var(--step-0); line-height: 1.65; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1440px; margin-inline: auto; padding-left: max(clamp(24px, 5vw, 80px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(24px, 5vw, 80px), env(safe-area-inset-right, 0px)); }
@media (max-width: 520px) { .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.small { font-size: 0.75rem; }
code { font-family: var(--f-mono); font-size: 0.9em; background: var(--surface); padding: 0.1em 0.4em; border-radius: 5px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 20; border-radius: 8px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 22px 26px; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 16px; }
.header-inner .nav { margin-left: auto; }
.wordmark { color: var(--ink); font-family: var(--f-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; text-decoration: none; }
.wordmark:hover { text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; font-size: 1.0625rem; }
@media (max-width: 640px) {
  .header-inner { flex-wrap: nowrap; padding-block: 12px; gap: 12px; }
  .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; font-size: 0.875rem; margin-right: calc(-1 * max(16px, env(safe-area-inset-right))); padding-right: 16px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
  .nav a.nav-home { display: none; }
  .nav { mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
}
.nav a { color: var(--ink-2); padding: 6px 10px; text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.theme-toggle { flex: none; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--ink); background: var(--surface); }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .ic-sun { display: none; } :root:not([data-theme="light"]) .theme-toggle .ic-moon { display: block; } }

main { padding-block: 56px 96px; }
.kind-home main { padding-top: 24px; }

/* Type */
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; margin: 0; }
.eyebrow { font-size: 0.75rem; color: var(--ink-2); letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 20px; }
.eyebrow a { color: inherit; }
.page-head { max-width: 760px; margin-bottom: 44px; }
.page-head h1 { font-size: clamp(2.25rem, 4.6vw, 3.25rem); }
.intro { margin-top: 18px; font-size: var(--step-1); color: var(--ink-2); line-height: 1.55; max-width: 56ch; }
.intro p { margin: 0 0 0.8em; }
.sub { font-size: var(--step--1); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin-bottom: 14px; }
.stack + .stack { margin-top: 48px; }
.empty { color: var(--ink-2); border: 1px dashed var(--rule); border-radius: 12px; padding: 18px 20px; margin: 0; font-size: 0.9375rem; }
.footnote { margin-top: 24px; font-size: var(--step--1); color: var(--ink-2); }
.footnote a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.todo { color: var(--sev-mod-fg); font-size: 0.9375rem; }
.label { font-family: var(--f-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }

/* Home grid */
.home { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 40px 64px; align-items: start; }
.profile { position: sticky; top: calc(72px + env(safe-area-inset-top, 0px)); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.mark { width: 104px; height: 104px; border-radius: 26px; background: var(--accent); color: #fff; display: flex; align-items: flex-end; padding: 0 0 10px 14px; }
.mark-hex { font-size: 0.6rem; letter-spacing: 0.08em; opacity: 0.85; }
.mark-glyph { font-family: var(--f-display); font-style: italic; font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em; }
.p-name { font-size: 1.6rem; margin-top: 20px; line-height: 1.1; }
.p-role { margin: 6px 0 0; color: var(--ink-2); font-size: 0.9375rem; }
.p-handle { margin: 4px 0 0; font-size: 0.8125rem; color: var(--ink-2); }
.p-links { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; font-size: 0.875rem; }
.p-links .p-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.p-links li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-links li > span { overflow-wrap: anywhere; }
.p-links .copy { margin-left: auto; }
.icon { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
.p-focus { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.p-focus .label { margin: 0 0 8px; }
.p-focus ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.p-focus li { font-size: 0.78rem; background: var(--surface); border-radius: 999px; padding: 3px 11px; color: var(--ink); }

.home-main { min-width: 0; }
.intro-block { padding-bottom: 56px; }
.stats { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.stats li a { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 0.9375rem; }
.stats li a:hover { color: var(--ink); border-color: var(--ink-2); text-decoration: none; }
.stats strong { font-family: var(--f-display); font-size: 1.25rem; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.sig-title { font-size: var(--step-4); line-height: 1.04; max-width: 15ch; letter-spacing: -0.02em; }
.sig-title .hl { font-style: italic; color: var(--accent-ink); }

.h-sec { padding-block: 8px 64px; }
.h-head { font-family: var(--f-display); font-size: var(--step-3); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; color: var(--ink); margin-bottom: 18px; }
.h-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.h-sec > .h-head:first-child { padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.h-head-row .h-head { margin-bottom: 0; }
.more { font-size: var(--step--1); }
.h-about p { max-width: 64ch; margin: 0 0 0.9em; }
.h-about p:last-child { margin-bottom: 0; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 4px 20px; padding-block: 14px; border-bottom: 1px solid var(--rule); }
.news li[hidden] { display: none; }
.news li.news-toggle { display: block; padding-block: 12px 10px; }
.news li.news-toggle .chip { white-space: nowrap; }

.news time { font-size: 0.8125rem; color: var(--ink-2); padding-top: 3px; }
.news p { margin: 0; max-width: 66ch; }
.news-link { margin-left: 4px; color: var(--accent-ink); font-weight: 500; }
@media (max-width: 520px) { .news li { grid-template-columns: minmax(0, 1fr); } }

/* Papers */
.paper { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 24px; align-items: start; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.paper + .paper { margin-top: 16px; }
.paper-featured { grid-template-columns: minmax(0, 1fr); }
.paper-body { min-width: 0; }
.thumb { margin: 0; background: var(--surface); border-radius: 10px; padding: 8px; }
.thumb svg { display: block; width: 100%; height: auto; }
.t-ok { fill: var(--ok); opacity: 1; }
.t-flag { fill: var(--flag); }
.t-flag-o { fill: none; stroke: var(--flag); stroke-width: 1.3; }
.t-ring { fill: none; stroke: var(--flag); stroke-width: 1.4; }
.t-label { fill: var(--ink-2); font-family: var(--f-mono); font-size: 6.6px; }
.paper-meta { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: var(--step--1); color: var(--ink-2); }
.paper-title { font-size: var(--step-2); margin-top: 6px; max-width: 64ch; }
.paper-title a { color: var(--ink); }
.paper-authors { margin: 8px 0 0; font-size: 0.9375rem; }
.paper-summary { margin: 12px 0 0; max-width: 66ch; color: var(--ink-2); }
.paper-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; margin-top: 16px; font-size: var(--step--1); }
.paper-links > a, .bib summary { display: inline-block; border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px; color: var(--ink); background: var(--paper); }
.paper-links > a:hover, .bib summary:hover { border-color: var(--ink-2); text-decoration: none; }
.bib { display: contents; }
.bib summary { cursor: pointer; list-style: none; }
.bib summary::-webkit-details-marker { display: none; }
.bib-box { position: relative; flex-basis: 100%; margin-top: 4px; background: var(--surface); border-radius: 10px; }
.bib-box pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 0.78rem; line-height: 1.55; color: var(--ink); }
.bib-box .copy { position: absolute; top: 8px; right: 8px; }
.coverage-list { list-style: none; margin: 0; padding: 0; }
.coverage-list li { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 4px 20px; padding-block: 14px; border-bottom: 1px solid var(--rule); }

.coverage-list time { font-size: 0.8125rem; color: var(--ink-2); padding-top: 3px; }
.cov-title { color: var(--ink); font-size: 1rem; line-height: 1.45; }
.cov-title:hover { color: var(--accent-ink); }
.cov-title strong { font-weight: 600; }
.cov-about { margin: 3px 0 0; font-size: 0.875rem; color: var(--ink-2); }
@media (max-width: 520px) { .coverage-list li { grid-template-columns: minmax(0, 1fr); } }
.copy { font-family: var(--f-mono); font-size: 0.72rem; background: var(--paper); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--ink-2); }
@media (max-width: 640px) { .paper { grid-template-columns: minmax(0, 1fr); padding: 18px; } .thumb { max-width: 240px; } }

/* Featured figure */
.sig-figure { margin: 0 0 18px; background: var(--surface); border-radius: 10px; padding: 14px 14px 12px; }
#ct-canvas { display: block; width: 100%; height: auto; }
.sig-figure figcaption { margin-top: 12px; font-size: 0.8125rem; color: var(--ink-2); max-width: 72ch; line-height: 1.5; }
.cap-key { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px; font-family: var(--f-mono); font-size: 0.72rem; white-space: nowrap; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.sw-ok { background: var(--ok); }
.sw-flag { border: 1.5px solid var(--flag); margin-left: 6px; }

/* Severity + state */
.sev, .state { display: inline-block; font-family: var(--f-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.sev-low { background: var(--sev-low-bg); color: var(--sev-low-fg); }
.sev-moderate { background: var(--sev-mod-bg); color: var(--sev-mod-fg); }
.sev-high, .sev-critical { background: var(--sev-high-bg); color: var(--sev-high-fg); }
.sev-info { background: var(--surface); color: var(--ink-2); }
.state { border: 1px solid currentColor; background: transparent; }
.state-merged, .state-fixed { color: var(--state-merged); }
.state-open { color: var(--state-open); }
.state-closed { color: var(--state-closed); }

/* CVE lists */
.cve-list { list-style: none; margin: 0; padding: 0; }
.cve-list li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding-block: 13px; border-bottom: 1px solid var(--rule); }

.cve-list a { font-size: 0.875rem; }
@media (max-width: 520px) { .cve-list li { grid-template-columns: minmax(0, 1fr) auto; } .cve-list-title { grid-column: 1 / -1; grid-row: 2; } }

.cve-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 22px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
.cve-summary p { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.cve-lede { font-size: 1rem !important; color: var(--ink) !important; }
.cve-lede strong { font-weight: 600; }
.chip-project { font-weight: 600; }
.filters-sub { flex-basis: 100%; margin-top: 2px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.filters-sub[hidden] { display: none; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--f-mono); font-size: 0.75rem; background: transparent; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 10px; }
.cve-table { width: 100%; min-width: 740px; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.cve-table th { text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); padding: 16px 16px 10px 0; border-bottom: 1px solid var(--rule); }
.cve-table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cve-table tr:last-child td { border-bottom: 0; }
.cve-table td.mono { font-size: 0.8125rem; padding-top: 16px; }
.cve-table tr[hidden] { display: none; }
.cve-table th:first-child, .cve-table td:first-child { padding-left: 12px; }
.cve-table th:last-child, .cve-table td:last-child { padding-right: 12px; }
@media (hover: hover) and (min-width: 641px) { .cve-table tbody tr:not(.year-row):hover { background: color-mix(in srgb, var(--surface) 50%, transparent); } }
.cve-table .year-row th { padding: 22px 12px 8px; font-family: var(--f-display); font-size: 1.25rem; font-weight: 500; text-transform: none; letter-spacing: -0.01em; color: var(--ink); border-bottom: 1px solid var(--rule); }
@media (max-width: 640px) { .cve-table .year-row { display: block; grid-template-columns: none; } .cve-table .year-row th { display: block; } }
.cve-title { min-width: 260px; }
.credit { display: block; font-size: 0.8125rem; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 640px) {
  .table-scroll { padding: 4px 18px; }
  .cve-table { min-width: 0; }
  .cve-table thead { display: none; }
  .cve-table, .cve-table tbody { display: block; }
  .cve-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding-block: 14px; border-bottom: 1px solid var(--rule); }
  .cve-table tr:last-child { border-bottom: 0; }
  .cve-table td, .cve-table td.mono { border: 0; padding: 0; }
  .cve-table td:nth-child(2) { grid-row: 1; grid-column: 1; }
  .cve-table td:nth-child(5) { grid-row: 1; grid-column: 2; }
  .cve-table td:nth-child(3) { grid-row: 2; grid-column: 1 / -1; }
  .cve-table td:nth-child(1) { grid-row: 3; grid-column: 1; color: var(--ink-2); }
  .cve-table td:nth-child(4) { grid-row: 3; grid-column: 2; text-align: right; white-space: normal; }
  .cve-table tr { grid-template-columns: minmax(0, 1fr) minmax(0, auto); }
  .cve-title { min-width: 0; }
}

/* Timeline */
.timeline { margin: 0 0 16px; padding: 12px 10px 4px; }
.timeline svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 640px) {
  .timeline { overflow-x: auto; padding-inline: 0; scrollbar-width: thin; }
  .timeline svg { min-width: 560px; }
}
.tl-axis, .tl-tick { stroke: var(--ink-2); stroke-width: 1; }
.tl-month { fill: var(--ink-2); font-family: var(--f-mono); font-size: 11px; }
.tl-dot { stroke: var(--paper); stroke-width: 2; }
.tl-low { fill: var(--sev-low-fg); }
.tl-moderate { fill: var(--sev-mod-fg); }
.tl-high, .tl-critical { fill: var(--sev-high-fg); }
.tl-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; font-size: 0.72rem; color: var(--ink-2); margin-top: 6px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-note::before { content: "· "; }
.lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 4px; }
.lg-low { background: var(--sev-low-fg); }
.lg-moderate { background: var(--sev-mod-fg); }
.lg-high { background: var(--sev-high-fg); }
.sec-cves .timeline { margin-top: 24px; }

/* Open source */
.disclosures, .gh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.disclosures li { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 24px; max-width: 800px; }
.d-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.d-head a { font-family: var(--f-display); font-size: var(--step-1); color: var(--ink); }
.disclosures p { margin: 6px 0 0; color: var(--ink-2); }
.gh-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 18px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; }
.gh-list .mono { font-size: 0.8125rem; }
.gh-feed .gh-repo { font-size: 0.8125rem; }
.gh-note { display: block; margin-top: 2px; font-size: 0.8125rem; }

/* Open source page: jump links, headed sections, title-first rows */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.jump .chip { font-family: var(--f-body); font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--ink); background: var(--card); border-color: var(--rule); padding: 8px 16px; display: inline-flex; align-items: center; gap: 8px; transition: border-color .15s, color .15s; }
.jump .chip::after { content: "\2193"; color: var(--accent); font-size: 0.875em; transition: transform .15s; }
.jump .chip:hover { color: var(--accent-ink); border-color: var(--accent); }
.jump .chip:hover::after { transform: translateY(2px); }
.os-sec { margin-top: 56px; scroll-margin-top: calc(80px + env(safe-area-inset-top, 0px)); }
.os-sec .h-head-row { margin-bottom: 8px; }
.os-desc { margin: 0 0 14px; color: var(--ink-2); font-size: 0.9375rem; }
.os-list { list-style: none; margin: 0; padding: 0; max-width: 860px; }
.os-list li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 4px 24px; padding-block: 16px; border-bottom: 1px solid var(--rule); }
.os-list time { font-size: 0.8125rem; color: var(--ink-2); padding-top: 3px; white-space: nowrap; }
.os-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.os-title { color: var(--ink); font-size: 1.0625rem; line-height: 1.4; overflow-wrap: anywhere; }
.os-title:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.os-meta { font-size: 0.78rem; color: var(--ink-2); }
.os-credit { font-family: var(--f-display); font-style: italic; font-size: 0.975rem; color: var(--ink-2); }
.os-about { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.5; }
.os-sec .paper + .paper { margin-top: 16px; }
@media (max-width: 520px) { .os-list li { grid-template-columns: minmax(0, 1fr); } }

/* CVE page: project highlight and per-project stats */
.intro-note { max-width: 760px; background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 10px; padding: 14px 20px; color: var(--ink); font-size: 1.0625rem; }
.intro-note p { margin: 0; }
.cve-hl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 28px; align-items: center; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); padding: 26px 30px; max-width: 860px; }
.cve-hl-num { font-family: var(--f-display); font-size: clamp(3.6rem, 7vw, 5rem); line-height: 1; color: var(--accent-ink); letter-spacing: -0.03em; }
.cve-hl-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cve-hl-title { margin: 0; font-family: var(--f-display); font-size: var(--step-2); line-height: 1.2; color: var(--ink); }
.cve-hl-text { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }
.cve-hl-role { margin: 2px 0 0; font-size: 0.9375rem; color: var(--ink); font-weight: 500; }
.cve-stats { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; max-width: 860px; }
.cve-stats li { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); min-width: 9.5rem; }
.cve-stats-name { font-family: var(--f-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.cve-stats-n { font-size: 0.9375rem; color: var(--ink-2); }
.cve-stats-n strong { color: var(--ink); font-weight: 600; }
.cve-summary[hidden] { display: none; }
.filter-now { font-size: 0.9375rem; color: var(--ink-2); margin-right: 6px; }
.filter-now strong { color: var(--ink); font-weight: 600; }
.proj-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.proj-card:hover { border-color: var(--ink-2); }
.proj-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.proj-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.os-list-plain li { grid-template-columns: minmax(0, 1fr); }
.credit.role { color: var(--accent-ink); }
#all .cve-summary { margin-bottom: 4px; }
@media (max-width: 520px) { .cve-hl { grid-template-columns: minmax(0, 1fr); padding: 22px; } }

/* Writing */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 4px 24px; padding-block: 14px; border-bottom: 1px solid var(--rule); }
.post-item:last-child { border-bottom: 0; }
.post-item time { font-size: var(--step--1); padding-top: 3px; }
.post-link { font-family: var(--f-display); font-size: var(--step-1); color: var(--ink); }
.post-item p { margin: 4px 0 0; font-size: 0.9375rem; }
.post-list-full { max-width: 820px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
@media (max-width: 520px) { .post-item { grid-template-columns: minmax(0, 1fr); } }

/* Prose */
.prose-page { max-width: 720px; }
.prose-page .page-head { margin-bottom: 28px; }
.prose { font-size: 1.0625rem; line-height: 1.7; }
.prose > * { max-width: 66ch; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose h2 { font-size: var(--step-2); margin: 1.8em 0 0.6em; }
.prose h3 { font-size: var(--step-1); margin: 1.6em 0 0.5em; }
.prose pre { background: var(--surface); padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 0.85rem; line-height: 1.55; max-width: 100%; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0 0 1.1em; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 6px 14px 6px 0; border-bottom: 1px solid var(--rule); text-align: left; }
.tags { display: flex; gap: 12px; font-size: var(--step--1); color: var(--ink-2); margin-top: 32px; }
.contact { margin: 36px 0 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 24px; }
.contact > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--rule); }
.offwork { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.offwork .h-head, .offwork .os-desc { margin: 0; }
.offwork-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.offwork-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 22px; display: grid; gap: 10px; align-content: start; }
.offwork-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.offwork-card li { display: grid; gap: 1px; font-size: 0.9375rem; line-height: 1.45; }
.offwork-title { color: var(--ink); }
.offwork-title:hover { color: var(--accent-ink); }
.offwork-by { font-size: 0.8125rem; color: var(--ink-2); }
.cite { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.cite .h-head { margin: 0; }
.cite .os-desc { margin: 0; }
.contact > div:last-child { border-bottom: 0; }
.contact dt { font-family: var(--f-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); padding-top: 2px; }
.contact dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .contact > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-block: 28px 40px; font-size: 0.875rem; }
.footer-id { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: var(--step--1); }

@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .profile { position: static; display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 18px; }
  .profile .mark { grid-row: span 3; }
  .p-name { margin-top: 0; }
  .p-links, .p-focus { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Mentions: compact list under the CVE table */
.mentions { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--rule); }
.mention-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9375rem; }
.mention-list a { color: var(--ink); }
.mention-list a:hover { color: var(--accent-ink); }

@media print {
  .site-header, .site-footer, .copy, .filters, .stats li a { box-shadow: none; }
  .site-header, .copy, .filters { display: none; }
  body { background: #fff; color: #000; }
  .card, .paper, .profile { box-shadow: none; border-color: #ccc; }
  a { color: inherit; text-decoration: underline; }
}

/* ===== Home: hero / latest / citations / explore ===== */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px 64px; align-items: center; padding: 8px 0 72px; }
.hero-solo { grid-template-columns: minmax(0, 1fr); padding: 96px 0 128px; }
.hero-title { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -0.025em; max-width: 14ch; }
.hero-title .hl { font-style: italic; color: var(--accent-ink); }
.hero-intro.hero-motto { font-family: var(--f-display); font-style: italic; font-size: clamp(1.35rem, 2.2vw, 1.7rem); line-height: 1.3; color: var(--ink-2); margin-top: 22px; }
.hero-name { display: block; margin-bottom: 18px; font-size: clamp(0.9375rem, 1.2vw, 1.0625rem); font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); line-height: 1.4; }
.hero-intro { margin: 26px 0 0; font-size: var(--step-1); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 30px; }
.hero-mail { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-size: 0.9375rem; font-weight: 500; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); color: #fff; text-decoration: none; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.h-block { padding: 0 0 72px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 12px; padding: 22px; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; color: var(--ink); text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--ink-2); }
.tile-label { font-family: var(--f-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.tile-kind { color: var(--accent-ink); font-weight: 600; }
.tile-date { color: var(--ink-2); font-weight: 400; }
.tile-title { font-family: var(--f-display); font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
.tile-title-sm { font-size: 1.25rem; }
.tile-title strong { font-weight: 600; }
.tile-text { color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; }
.tile-text strong, .os-about strong, .cve-note strong { color: var(--ink); font-weight: 600; }
.tile-cta { margin-top: auto; padding-top: 6px; font-size: 0.875rem; color: var(--accent-ink); font-weight: 500; }
.tile-art { display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 1; background: var(--surface); border-radius: 10px; padding: 10px; overflow: hidden; }
.tile-art > * { width: 100%; }
.tile-art-sm { aspect-ratio: 3 / 1; padding: 6px 10px; }
.tile-art-sm > *, .tile-art-sm .thumb { width: auto; max-width: 100%; height: 100%; }
.tile-art.tile-art-sm svg, .tile-art.tile-art-sm .art { display: block; width: auto; max-width: 100%; height: 100%; }
.tile-art .thumb { margin: 0; background: none; padding: 0; }
.tile-art .art { display: block; width: 100%; height: auto; }
.tile-art-tl .timeline { margin: 0; padding: 0; }
.tile-art-tl svg { width: 100%; height: auto; }
.tile-art-tl .tl-legend { display: none; }
.tile-feature { padding: 26px; }
.tile-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 20px 32px; align-items: center; padding: 26px; }
.tile-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tile-wide .tile-art .art { width: auto; max-width: 100%; height: 100%; }
@media (max-width: 760px) { .tile-wide { grid-template-columns: minmax(0, 1fr); } }
.a-ok { fill: var(--ok); opacity: 0.55; }
.a-flag { fill: var(--flag); }
.a-ink { fill: var(--ink); opacity: 0.8; }
.a-quote { fill: var(--accent); font-family: var(--f-display); font-size: 120px; }
.a-card { fill: var(--card); stroke: var(--rule); stroke-width: 1; }
.a-src { fill: var(--ink-2); font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.04em; }

.statement { padding: 24px 0 88px; }
.statement p { margin: 0; font-family: var(--f-display); font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.25; letter-spacing: -0.015em; max-width: 26ch; text-wrap: balance; }

.news-full { max-width: 820px; }

/* Show more (site.js): folded items stay in the page, hidden until the reader asks */
.is-folded { display: none !important; }
.more-row { margin: 16px 0 0; }
.more-row[hidden] { display: none; }
.news-full time { white-space: nowrap; }
.row-summary { display: block; margin-top: 2px; font-size: 0.875rem; }

/* Linked rows (News, pull requests, issues): the sentence itself is the link */
.row-link { color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* footer columns */
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 32px; padding-block: 44px 24px; }
.footer-brand p { margin: 10px 0 0; font-size: 0.875rem; max-width: 30ch; }
.footer-col h3 { font-family: var(--f-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--ink); font-size: 0.9375rem; padding: 3px 0; }
.footer-col a:hover { color: var(--accent-ink); }
.footer-base { padding-block: 16px 44px; font-size: 0.75rem; border-top: 1px solid var(--rule); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 32px 0 56px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .thumb .t-label { display: none; }
  .tile-art:has(> .art) { aspect-ratio: auto; }
  .tile-art > .art { width: auto; max-width: 100%; height: 120px; margin-inline: auto; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-title { max-width: none; }
}
