:root {
  color-scheme: light dark;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1a1d23;
  --muted: #5a6270;
  --line: #dfe3e9;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --chip: #eaeef5;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #181b21;
    --text: #e8eaee;
    --muted: #a3abb8;
    --line: #2a2f38;
    --accent: #6ea2ff;
    --accent-text: #0b1220;
    --chip: #232832;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--font);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--s3); overflow-wrap: anywhere; }
h1 { font-size: clamp(1.625rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem); }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 var(--s4); }
ul { margin: 0 0 var(--s4); padding-left: var(--s6); }
.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--s4); }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s6); padding-block: var(--s2); }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav { display: flex; flex-wrap: wrap; gap: var(--s1); list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.9375rem; }
.nav a:hover { background: var(--chip); }
.nav a[aria-current="page"] { background: var(--chip); font-weight: 700; }
main { flex: 1; padding-block: var(--s8) var(--s12); }
.section { margin-top: var(--s12); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s6); margin-bottom: var(--s4); }
.section-head h2 { margin: 0; }
.crumbs { font-size: 0.875rem; color: var(--muted); margin-bottom: var(--s4); }
.hero { display: grid; gap: var(--s6); align-items: start; }
.hero-lead { font-size: 1.0625rem; color: var(--muted); max-width: 62ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s6); }
.panel > :last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); margin: 0; }
.stats div { min-width: 0; }
.stats dt { color: var(--muted); font-size: 0.875rem; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.chips a:hover { border-color: var(--accent); }
.chips span { color: var(--muted); margin-left: var(--s2); font-size: 0.875rem; }
.cards { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); list-style: none; margin: 0; padding: 0; }
.card { position: relative; display: flex; gap: var(--s3); align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); min-width: 0; }
.card:hover { border-color: var(--accent); }
.card-body { min-width: 0; }
.card h3 { margin: 0 0 var(--s1); }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card p { margin: 0 0 var(--s2); color: var(--muted); font-size: 0.9375rem; }
.avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: hsl(var(--h) 55% 42%); color: #fff; font-weight: 800; font-size: 1.375rem; }
.avatar.big { width: 80px; height: 80px; border-radius: 20px; font-size: 2.25rem; }
.app-icon { flex: none; display: block; width: 48px; height: 48px; max-width: none; border-radius: 12px; object-fit: contain; background: var(--chip); }
.app-icon.big { width: 80px; height: 80px; border-radius: 20px; }
.badges { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); list-style: none; margin: 0; padding: 0; }
.badge { display: inline-block; padding: 2px var(--s2); border-radius: 6px; background: var(--chip); color: var(--text); font-size: 0.8125rem; line-height: 1.5; }
.app-head { display: flex; gap: var(--s4); align-items: center; margin-bottom: var(--s6); }
.app-head h1 { margin: 0 0 var(--s1); }
.app-head p { margin: 0 0 var(--s2); color: var(--muted); font-size: 1.0625rem; }
.app-grid { display: grid; gap: var(--s6); align-items: start; }
.facts { margin: 0 0 var(--s6); }
.facts div { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: var(--s2) var(--s4); border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 700; text-decoration: none; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.side-note { margin: var(--s3) 0 0; font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }
.prose p { max-width: 68ch; }
.weeks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.weeks li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); min-width: 0; }
.weeks h2 { font-size: 1.125rem; margin-bottom: var(--s1); }
.weeks p { margin: 0 0 var(--s2); color: var(--muted); font-size: 0.9375rem; }
.weeks .meta { font-size: 0.875rem; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); margin-top: var(--s8); }
.pager a { display: inline-flex; align-items: center; min-height: 44px; }
.center { text-align: center; padding-block: var(--s12); }
.center .btn { display: inline-flex; margin-top: var(--s4); }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.875rem; padding-block: var(--s6); }
.site-footer p { margin: 0 0 var(--s1); }
@media (min-width: 48rem) {
  .hero { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s8); }
  .app-grid { grid-template-columns: minmax(0, 1fr) 21rem; gap: var(--s8); }
  .app-aside { position: sticky; top: var(--s4); }
  main { padding-block: var(--s12) 64px; }
}
@media (max-width: 30rem) {
  .nav { gap: 0; margin-inline: calc(var(--s2) * -1); }
  .nav a { padding: 0 var(--s2); font-size: 0.875rem; }
}
