:root {
  --bg: #f5f6f8; --card: #ffffff; --fg: #1d2129; --muted: #667085; --line: #e4e7ec;
  --accent: #2563eb; --accent-soft: #e0e9ff; --code-bg: #f1f2f4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #171a20; --fg: #e6e8eb; --muted: #9aa3ad; --line: #2a2f37;
    --accent: #7aa7ff; --accent-soft: #1d2a45; --code-bg: #1f232b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

header.top { position: relative; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; color: var(--fg); }

/* header menu: a few top-level entries; Categories and Rankings open a panel (<details>, works without JS) */
nav.main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
nav.main > a, nav.main summary { display: block; padding: 5px 11px; border-radius: 7px; color: var(--muted); font-size: 14px;
                                  white-space: nowrap; cursor: pointer; }
nav.main > a:hover, nav.main summary:hover { background: var(--bg); color: var(--fg); text-decoration: none; }
nav.main > a.here, nav.main details.here > summary { background: var(--accent-soft); color: var(--accent); }
nav.main details { position: relative; margin: 0; font-size: inherit; }  /* not the page's details style */
nav.main summary { list-style: none; user-select: none; }
nav.main summary::-webkit-details-marker { display: none; }
nav.main summary::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 7px;
                          border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
                          transform: translateY(-3px) rotate(45deg); }
nav.main details[open] > summary::after { transform: translateY(0) rotate(-135deg); }
nav.main details[open] > summary { background: var(--bg); color: var(--fg); }
nav.main .panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; display: flex; gap: 4px 16px; padding: 8px;
                  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
                  box-shadow: 0 10px 30px rgb(0 0 0 / 0.14); }
nav.main .group { display: flex; flex-direction: column; min-width: 160px; }
nav.main .heading { padding: 4px 10px 4px; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase;
                    letter-spacing: .05em; white-space: nowrap; }
nav.main .panel a { padding: 6px 10px; border-radius: 6px; color: var(--fg); font-size: 14px; white-space: nowrap; }
nav.main .panel a:hover { background: var(--bg); text-decoration: none; }
nav.main .panel a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) {
  nav.main { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  nav.main > a, nav.main summary { text-align: center; }
  nav.main details:last-of-type .panel { left: auto; right: 0; }
  nav.main .panel { flex-direction: column; }
}
.stamp { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

main.wrap { padding-top: 22px; padding-bottom: 32px; }
h1 { font-size: 24px; line-height: 1.3; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; max-width: 80ch; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 10px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi .v { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .k { color: var(--muted); font-size: 12.5px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
.card.wide { grid-column: 1 / -1; }
.card h2 { font-size: 15px; margin: 0 0 8px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.card h2 a { font-size: 13px; font-weight: 500; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
caption { text-align: left; color: var(--muted); font-size: 12.5px; padding-bottom: 6px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td { overflow-wrap: anywhere; }
table.papers td:first-child { white-space: nowrap; color: var(--muted); }
table.papers td:nth-child(2) { min-width: 18em; }
.bar { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--accent); opacity: .7; min-width: 2px; }

svg.spark { width: 110px; height: 26px; display: block; }
svg.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.card h3 { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
svg.daily { width: 100%; height: 140px; display: block; }
svg.daily rect { fill: var(--accent); opacity: .8; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 2px; }
details { margin-top: 8px; font-size: 13px; }
summary { cursor: pointer; color: var(--muted); }

.findings ul { margin: 0; padding-left: 1.2em; }
.findings li { margin: 4px 0; max-width: 110ch; }
.faq dl { margin: 0; }
.faq dt { font-weight: 600; margin-top: 12px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 2px 0 0; color: var(--muted); max-width: 110ch; }
.big { font-size: 28px; font-weight: 700; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.big span { font-size: 13px; font-weight: 500; color: var(--muted); }
.card .meta b { color: var(--fg); font-weight: 600; }

/* research ideas */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; align-items: start; }
.tile { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--status, var(--accent));
        border-radius: 12px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tile.featured { grid-column: span 2; }
@media (max-width: 640px) { .tile.featured { grid-column: auto; } }
.tile h2 { font-size: 17px; line-height: 1.35; margin: 0; }
.tile h2 a { color: var(--fg); }
.tile .sum { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 5;
             -webkit-box-orient: vertical; overflow: hidden; }
.tile.featured .sum { -webkit-line-clamp: 8; }
.tile-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted);
            font-variant-numeric: tabular-nums; }
.status { font-weight: 650; color: var(--status, var(--accent)); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.status-seed { --status: #16a34a; } .status-exploring { --status: #2563eb; } .status-in-progress { --status: #d97706; }
.status-parked { --status: #6b7280; } .status-done { --status: #9333ea; }
.tracks { margin: 0; font-size: 12.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.cloud { margin: 0 0 18px; }
.chip { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.chip span { color: var(--fg); font-weight: 600; margin-left: 2px; }
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
article.idea { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--status, var(--accent));
               border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
article.idea h1 { margin-top: 8px; }
article.idea .prose { margin-top: 14px; }
.pager { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.alt { color: var(--muted); font-size: 13px; }
.prose blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--line); color: var(--muted); }
.prose pre { background: var(--code-bg); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }

/* equations: MathML rendered by the browser */
math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", math; font-size: 1.08em; }
.formula { display: inline-block; white-space: nowrap; }
.formula-block { overflow-x: auto; padding: 6px 0 10px; font-size: 1.3em; }
.tex { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }

.prose { max-width: 75ch; }
.prose h2 { font-size: 17px; margin: 26px 0 6px; }
code { font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }

footer.foot { color: var(--muted); font-size: 13px; padding-top: 18px; padding-bottom: 36px; border-top: 1px solid var(--line); }
footer.foot p { margin: 4px 0; }
