:root {
  --bg: #f6f7f9;
  --topbar: rgba(246, 247, 249, .92);
  --surface: #ffffff;
  --fg: #14161a;
  --muted: #5c636e;
  --line: #e2e5ea;
  --hover: #eef0f3;
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px;
  color-scheme: light;
}

/* Accent colour presets — chosen in data/settings.json ("accent") */
:root, [data-accent="green"]   { --accent: #1d6b4f; --accent-soft: #e3efe9; --accent-ink: #ffffff; }
[data-accent="violet"]          { --accent: #5b3fd0; --accent-soft: #ebe7fa; --accent-ink: #ffffff; }
[data-accent="aubergine"]       { --accent: #6b2d7a; --accent-soft: #f1e6f3; --accent-ink: #ffffff; }
[data-accent="blue"]            { --accent: #2c47a8; --accent-soft: #e5e9f6; --accent-ink: #ffffff; }
[data-accent="red"]             { --accent: #e0362c; --accent-soft: #fbe5e3; --accent-ink: #ffffff; }
[data-accent="yinmn"]           { --accent: #2e5090; --accent-soft: #e9eef7; --accent-ink: #ffffff; }
[data-accent="prussian"]        { --accent: #004e85; --accent-soft: #e6eff7; --accent-ink: #ffffff; }
[data-accent="capri"]           { --accent: #1b5583; --accent-soft: #e9f0f7; --accent-ink: #ffffff; }
[data-accent="sea"]             { --accent: #006994; --accent-soft: #e9f3f7; --accent-ink: #ffffff; }
[data-accent="mono"]            { --bg: #ffffff; --topbar: rgba(255,255,255,.92); --surface: #ffffff; --fg: #000000; --muted: #5f5f5f; --line: #e6e6e6; --hover: #f2f2f2; --accent: #595959; --accent-soft: #f2f2f2; --accent-ink: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f12;
    --topbar: rgba(14, 15, 18, .9);
    --surface: #16181d;
    --fg: #eceef2;
    --muted: #9aa1ad;
    --line: #272a31;
    --hover: #20232a;
    color-scheme: dark;
  }
  :root, [data-accent="green"] { --accent: #4fc591; --accent-soft: #15241e; --accent-ink: #07130d; }
  [data-accent="violet"]        { --accent: #a593ff; --accent-soft: #1d1a2e; --accent-ink: #0e0a1f; }
  [data-accent="aubergine"]     { --accent: #d39be0; --accent-soft: #241a27; --accent-ink: #1a0d1e; }
  [data-accent="blue"]          { --accent: #8ba2ff; --accent-soft: #181d2e; --accent-ink: #0a0f22; }
  [data-accent="red"]           { --accent: #ff5a4e; --accent-soft: #2a1716; --accent-ink: #160605; }
  [data-accent="yinmn"]         { --accent: #8daae2; --accent-soft: #121b2b; --accent-ink: #0a0f22; }
  [data-accent="prussian"]      { --accent: #8dbfe2; --accent-soft: #12212b; --accent-ink: #06121c; }
  [data-accent="capri"]         { --accent: #8dbde2; --accent-soft: #12202b; --accent-ink: #06121c; }
  [data-accent="sea"]           { --accent: #8dcae2; --accent-soft: #12242b; --accent-ink: #06141c; }
  [data-accent="mono"]          { --bg: #000000; --topbar: rgba(0,0,0,.9); --surface: #0a0a0a; --fg: #ffffff; --muted: #a3a3a3; --line: #262626; --hover: #161616; --accent: #b3b3b3; --accent-soft: #141414; --accent-ink: #000000; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { left: 16px; z-index: 100; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; text-decoration: none; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 15px; }
.nav a:hover { background: var(--hover); color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); font-weight: 500; }
/* Tiles theme: small spaced-out capitals */
[data-theme="tiles"] .nav { gap: 28px; }
[data-theme="tiles"] .nav a { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; padding: 6px 0; border-radius: 0; border-bottom: 1px solid transparent; }
[data-theme="tiles"] .nav a:hover { background: none; }
[data-theme="tiles"] .nav a[aria-current="page"] { font-weight: 400; border-bottom-color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu-btn { display: none; background: none; border: 0; padding: 10px 6px; cursor: pointer; color: var(--fg); }
.menu-btn i { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn i + i { margin-top: 5px; }
.menu-btn[aria-expanded="true"] i:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] i:nth-child(3) { opacity: 0; }
.menu-btn[aria-expanded="true"] i:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 720px) {
  .js .menu-btn { display: block; }
  .js .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .js .nav.open { display: flex; }
  .js .nav a { font-size: 15px; padding: 14px 0; border-radius: 0; border-bottom: 1px solid var(--line); }
  .js .nav a:last-child { border-bottom: 0; }
  .nav { gap: 16px; }
}

main { padding: 56px 0 80px; }

/* Home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: end; margin-bottom: 72px; }
.hero-index { border-left: 1px solid var(--line); padding-left: 24px; }
.hero-index h2 { font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: 10px; }
.hero-index ol { margin: 0; padding: 0; list-style: none; counter-reset: h; }
.hero-index li { counter-increment: h; display: grid; grid-template-columns: 1.6em 1fr; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.hero-index li:first-child { border-top: 0; }
.hero-index li::before { content: counter(h); color: var(--accent); font-weight: 600; }
.hero-index a { text-decoration: none; }
.hero-index a:hover { color: var(--accent); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 32px; } .hero-index { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; } }
.stamp { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.stamp .dot { width: 8px; height: 8px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); max-width: 22ch; letter-spacing: -.02em; }
.hero h1 a { text-decoration: none; }
.hero h1 a:hover { color: var(--accent); }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin-top: 20px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 28px;
  background: var(--fg); color: var(--bg); text-decoration: none;
  padding: 11px 18px; border-radius: 999px; font-weight: 500; font-size: 15px;
}
.button:hover { background: var(--accent); color: var(--accent-ink); }

.grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.panel-head h2 { font-size: 1.3rem; }
.panel-head a { color: var(--muted); font-size: 14px; }

.rows { list-style: none; margin: 0; padding: 0 0 8px; }
.row { padding: 16px 22px; border-top: 1px solid var(--line); }
.rows .row:first-child { border-top: 0; }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.row h3 { font-size: 1.05rem; font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { color: var(--accent); }
.row p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.tag { flex: none; font-size: 13px; color: var(--muted); background: var(--hover); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }

.empty { padding: 8px 22px 24px; color: var(--muted); font-size: 15px; }

.earlier h2 { font-size: 1.3rem; margin-bottom: 12px; }
.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-list li { display: flex; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); align-items: baseline; }
.issue-list time { color: var(--muted); font-size: 14px; flex: none; width: 9.5em; white-space: nowrap; }
.issue-list a { text-decoration: none; font-weight: 500; }
.issue-list a:hover { color: var(--accent); }

/* Ways in this week */
.ways-home { margin-bottom: 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 1.3rem; }
.section-head p { color: var(--muted); font-size: 15px; }
.ways-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) { .ways-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ways-grid { grid-template-columns: 1fr; } }
.way { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.way h3 { font-size: 1rem; }
.way p { font-size: 15px; flex: 1; }
.way a { font-size: 13px; color: var(--muted); }

/* Banners and text blocks placed from settings */
.banner { display: flex; gap: 20px; align-items: center; border-radius: var(--radius); padding: 24px 28px; margin: 0 0 56px; }
.banner-plain { background: var(--surface); border: 1px solid var(--line); }
.banner-accent { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.banner h2 { font-size: 1.25rem; margin-bottom: 6px; }
.banner p { color: var(--muted); max-width: 62ch; }
.banner .button { margin-top: 14px; }
.banner img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
@media (max-width: 560px) { .banner { flex-direction: column; align-items: flex-start; padding: 20px; } }
.textblock { max-width: 680px; margin-bottom: 56px; }
.textblock h2 { font-size: 1.3rem; margin-bottom: 10px; }
.textblock p + p { margin-top: 12px; }
.grid { margin-bottom: 56px; }
.earlier { margin: 0 0 56px; }
.more { display: inline-block; margin-top: 12px; color: var(--muted); font-size: 14px; }

/* Site-wide announcement bar */
.announce { background: var(--accent); color: var(--accent-ink); font-size: 14px; }
.announce .wrap { padding-top: 9px; padding-bottom: 9px; }
.announce a { color: inherit; font-weight: 600; }

/* Page header */
.page-head { max-width: 720px; margin-bottom: 40px; }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.02em; }
.page-head p { color: var(--muted); font-size: 1.08rem; margin-top: 14px; }

/* Briefing issue */
.issue { max-width: 720px; }
.issue .lead { font-size: 1.15rem; color: var(--muted); margin-top: 18px; }
.item { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.item h2 { font-size: 1.5rem; }
.item .summary { margin-top: 12px; }
.why { margin-top: 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); }
.why strong { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 4px; }
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 16px 0 0; }
.ways div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.ways dt { font-weight: 600; font-size: 14px; }
.ways dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.sources { margin-top: 16px; font-size: 14px; color: var(--muted); }
.sources ul { margin: 4px 0 0; padding-left: 18px; }
.disclosure { margin-top: 56px; color: var(--muted); font-size: 14px; }

/* Tools page */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters button {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.filters button:hover { background: var(--hover); }
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tool .gain { color: var(--fg); margin-top: 8px; font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.meta a { color: var(--muted); }

/* Built page */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 1.15rem; font-family: var(--font); font-weight: 600; letter-spacing: 0; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card p { color: var(--muted); font-size: 15px; margin-top: 6px; }

/* Prose (About) */
.prose { max-width: 680px; }
.prose p + p, .prose h2 + p { margin-top: 14px; }
.prose h2 { font-size: 1.3rem; margin-top: 36px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--muted); font-size: 14px; }
.fgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(auto-fit, minmax(140px, 1fr)); gap: 32px; }
.fbrand p { margin-top: 10px; max-width: 36ch; }
.fbrand .brand { color: var(--fg); font-size: 16px; }
.fbrand .copy { font-size: 13px; }
.fcol h2 { font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--fg); letter-spacing: 0; margin-bottom: 10px; }
.fcol ul { list-style: none; margin: 0; padding: 0; }
.fcol li { padding: 3px 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--fg); }
@media (max-width: 720px) { .fgrid { grid-template-columns: 1fr 1fr; } .fbrand { grid-column: 1 / -1; } }

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  main { padding-top: 36px; }
  .brand span { font-size: 16px; }
  .issue-list li { flex-direction: column; gap: 2px; }
  .issue-list time { width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Homepage: statement and tiles (layout H) */
.statement { text-align: center; padding: 40px 0 56px; }
.statement h1 { font-family: var(--font); font-weight: 300; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.12; letter-spacing: -.01em; max-width: 20ch; margin: 0 auto; }
.statement-sub { color: var(--muted); margin: 18px auto 0; max-width: 46ch; font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 72px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 260px; padding: 24px; background: var(--hover); color: var(--fg); text-decoration: none; transition: background .2s; }
.tile:hover { background: color-mix(in srgb, var(--hover) 70%, var(--line)); }
.tile-k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tile-body { display: flex; flex-direction: column; gap: 8px; }
.tile-h { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.tile-t { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-lead { grid-row: span 2; background: var(--accent); color: var(--accent-ink); }
.tile-lead:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.tile-lead .tile-k, .tile-lead .tile-t { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.tile-lead .tile-h { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; }
.tile-lead .tile-t { -webkit-line-clamp: 5; font-size: 15px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } .tile { min-height: 0; } .tile-lead { grid-row: auto; min-height: 320px; } .statement { padding: 16px 0 36px; } }

/* Inner pages: one reading column */
.col { max-width: 720px; margin: 0 auto; }
.col > h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.col > .lead, .issue .lead { font-size: 1.15rem; color: var(--muted); margin-top: 16px; margin-bottom: 36px; }
.col .stamp { margin-bottom: 16px; }
.rows.plain { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows.plain .row { padding: 20px 0; border-top: 0; border-bottom: 1px solid var(--line); }
.rows.plain .row h3 { font-family: var(--font-display); font-size: 1.15rem; }
.col .filters { margin-bottom: 8px; }
.col .issue-list { border-top: 1px solid var(--line); }

/* Classic theme bits */
.hero.solo { display: block; }
.hero.solo .lead { max-width: 62ch; }
.frow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.frow nav { display: flex; gap: 16px; flex-wrap: wrap; }
.frow a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
