:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.6;
  scroll-padding-top: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  --bg: #f8fafc;
  --ink: #172a43;
  --subtle: #435673;
  --accent: #1749a0;
  --action-ink: #ffffff;
  --line: #cfd9e8;
  --panel: #e7efff;
  --panel-ink: #152e56;
  --panel-line: #a6bade;
  --heading-font: system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.theme-gaming {
  color-scheme: dark;
  --bg: #212024;
  --ink: #fff2e8;
  --subtle: #e0cbbf;
  --accent: #ffc783;
  --action-ink: #281e21;
  --line: #63535b;
  --panel: #362d33;
  --panel-ink: #fff2e8;
  --panel-line: #8f737b;
}

.theme-mail {
  --bg: #f6f9f7;
  --ink: #18362d;
  --subtle: #36584c;
  --accent: #23604f;
  --line: #b5c9c1;
  --panel: #e3eeea;
  --panel-ink: #18382d;
  --panel-line: #9cb8ad;
}

.theme-dota {
  --bg: #f9eee1;
  --ink: #311c18;
  --subtle: #63473b;
  --accent: #84352c;
  --line: #cfb5a0;
  --panel: #432c29;
  --panel-ink: #fff1d9;
  --panel-line: #c1a18b;
  --heading-font: Georgia, "Times New Roman", serif;
}

::selection { background: var(--accent); color: var(--action-ink); }

main { flex: 1; }

a {
  color: var(--accent);
  text-decoration-thickness: .08em;
  text-underline-offset: .24em;
  overflow-wrap: anywhere;
}

a:hover { text-decoration-thickness: .16em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: .3rem; }

.skip-link {
  position: fixed;
  inset: 1rem auto auto 1rem;
  z-index: 1;
  transform: translateY(-180%);
  background: var(--bg);
  padding: .6rem 1rem;
}

.skip-link:focus { transform: none; }

.wrap {
  width: min(100% - clamp(2rem, 8vw, 8rem), 74rem);
  margin-inline: auto;
}

.site-header, .site-footer { border-block-end: 1px solid var(--line); }

.header-inner, .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem 1.75rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  max-width: min(100%, 30rem);
  min-width: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 750;
  text-decoration: none;
}

.brand img { flex: 0 0 auto; }

nav ul, .library ul { list-style: none; padding: 0; margin: 0; }

.site-header nav ul { display: flex; flex-wrap: wrap; gap: .15rem clamp(.75rem, 2vw, 1.5rem); }

.site-header nav a {
  display: inline-block;
  padding-block: .5rem;
  color: var(--subtle);
  font-size: .925rem;
  text-decoration: none;
}

.site-header nav a:hover, .site-header nav [aria-current] {
  color: var(--accent);
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--heading-font);
  line-height: 1.12;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 { font-size: clamp(2.4rem, 5.7vw, 5.2rem); letter-spacing: -.04em; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.45rem); letter-spacing: -.025em; }
h3 { font-size: clamp(1.17rem, 1.8vw, 1.45rem); }
p { margin: .9rem 0 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(1.75rem, 6vw, 6.5rem);
  padding-block: clamp(2.5rem, 8vw, 7rem);
}

.hero-copy p, .article-title p, .error-page p {
  max-width: 57ch;
  color: var(--subtle);
  font-size: clamp(1.07rem, 2vw, 1.32rem);
}

.action {
  display: inline-block;
  margin-top: 1.65rem;
  padding: .72rem 1.2rem;
  border-radius: .45rem;
  background: var(--accent);
  color: var(--action-ink);
  font-weight: 700;
  text-decoration: none;
}

.action:hover { text-decoration: underline; }

.hero-panel {
  padding: clamp(1.2rem, 3vw, 2.55rem);
  background: var(--panel);
  color: var(--panel-ink);
  border: 1px solid var(--panel-line);
  border-radius: 1rem;
}

.hero-panel h2 { font-size: clamp(1.3rem, 2.1vw, 1.8rem); }
.hero-panel ol { margin: 1.25rem 0 0; padding: 0; list-style-position: inside; }
.hero-panel li { padding-block: .75rem; border-top: 1px solid var(--panel-line); }
.hero-panel li::marker { font-weight: 700; }

.theme-gaming .hero {
  border-bottom: 2px solid var(--accent);
  align-items: end;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.theme-gaming .hero-panel { border-radius: .25rem; }
.theme-gaming h1 { max-width: 13ch; }
.theme-gaming .hero-panel li { font-variant-numeric: tabular-nums; }
.theme-mail .hero { grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); }
.theme-mail .hero-copy { text-align: center; }
.theme-mail .hero-copy p { margin-inline: auto; }
.theme-mail .hero-panel { border-radius: .75rem .75rem 2.25rem .75rem; }
.theme-mail .hero-panel ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.theme-dota .hero { border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr); }
.theme-dota .hero-copy { grid-area: 1 / 2; }
.theme-dota .hero-panel { grid-area: 1 / 1; }
.theme-dota .hero-panel { border-radius: .4rem; }
.theme-dota .hero-panel h2 { font-style: italic; }

.library { padding-block: clamp(1.4rem, 4vw, 3.4rem) clamp(3rem, 7vw, 6rem); }

.library ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem clamp(1.5rem, 5vw, 5rem);
  margin-top: 1.5rem;
}

.library li { padding-block: 1.2rem; border-top: 1px solid var(--line); }
.library p { max-width: 62ch; color: var(--subtle); }
.theme-mail .library ul { grid-template-columns: minmax(0, 48rem); }
.theme-dota .library li h3 { font-size: clamp(1.3rem, 2.1vw, 1.8rem); }

.article-title, .error-page { padding-block: clamp(2.75rem, 6vw, 5.25rem); }
.article-title h1 { max-width: 21ch; font-size: clamp(2.25rem, 5vw, 4.4rem); }

.article-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(0, 3fr);
  gap: 2.25rem clamp(1.75rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
  padding-block: 2rem 5rem;
}

.contents { align-self: start; }
.contents h2 { margin-bottom: .75rem; font-size: 1.1rem; }
.contents li + li { margin-top: .5rem; }
.contents a { display: inline-block; padding-block: .2rem; }
.reading { max-width: 69ch; }
.reading section + section { margin-top: 2.35rem; }
.reading li + li { margin-top: .5rem; }
.reading ol, .reading ul { padding-inline-start: 1.35rem; }

.site-footer {
  border-block-start: 1px solid var(--line);
  border-block-end: 0;
  color: var(--subtle);
  font-size: .925rem;
  overflow-wrap: anywhere;
}

@media (max-width: 48rem) {
  .hero, .theme-gaming .hero, .theme-dota .hero, .article-layout, .library ul {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-inner { align-items: flex-start; flex-direction: column; }
  .hero { gap: 2rem; }
  .theme-gaming h1 { max-width: none; }
  .theme-mail .hero-copy { text-align: left; }
  .theme-mail .hero-panel ol { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .theme-dota .hero-copy, .theme-dota .hero-panel { grid-area: auto; }
  .article-layout { padding-block-end: 3.5rem; }
}

@media print {
  body { color-scheme: light; background: white; color: black; }
  .site-header, .site-footer, .contents, .skip-link { display: none; }
  .article-layout { display: block; }
  .article-title { padding-block: 1rem; }
}
