:root {
  color-scheme: light;
  --page: #f2f2f2;
  --surface: #ffffff;
  --ink: #222222;
  --muted: #555555;
  --line: #cccccc;
  --line-strong: #888888;
  --soft: #e8e8e8;
  --code-bg: #eeeeee;
  --header: #333333;
  --header-active: #555555;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #2a2a2a;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: #000000;
  text-decoration-thickness: 2px;
}

a:focus-visible,
input:focus-visible {
  outline: 3px solid #777777;
  outline-offset: 3px;
}

code,
pre,
input {
  font-family: Consolas, "Courier New", monospace;
}

code {
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  margin: 1rem 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid #111111;
  background: #2b2b2b;
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.55;
}

.shell {
  width: min(1040px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  z-index: 20;
  padding: 0.55rem 0.8rem;
  transform: translateY(-160%);
  background: #ffffff;
  color: #111111;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid #111111;
  background: var(--header);
  color: #ffffff;
}

.header-inner,
.footer-grid,
.intro-grid,
.lesson-layout {
  display: grid;
}

.header-inner {
  min-height: 64px;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}

.brand {
  color: #ffffff;
  font-size: 1.18rem;
  font-weight: 700;
  text-decoration: none;
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  display: none;
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.top-nav a {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  background: var(--header-active);
  color: #ffffff;
}

.home-hero {
  padding: 3.25rem 0 3rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.hero-copy {
  max-width: 780px;
}

.hero-media,
.seo-band {
  display: none;
}

.kicker {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: #1f1f1f;
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: 2.5rem;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: 1.65rem;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.08rem;
}

p,
ul,
ol,
dl {
  margin-top: 0;
}

.lead {
  max-width: 68ch;
  margin-bottom: 0;
  color: #444444;
  font-size: 1.2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.button {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid #555555;
  background: #ffffff;
  color: #222222;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  border-color: #111111;
  background: #eeeeee;
  color: #000000;
}

.button.primary {
  border-color: #333333;
  background: #333333;
  color: #ffffff;
}

.button.primary:hover {
  background: #111111;
}

.intro-band {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--page);
}

.intro-grid {
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 3rem;
  align-items: start;
}

.intro-grid > div {
  order: -1;
  max-width: 68ch;
}

.tldr,
.lesson-aside {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  background: #ffffff;
}

.tldr h2,
.lesson-aside h2 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  text-transform: uppercase;
}

.tldr ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.directory {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0.25rem 2rem;
  align-items: end;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid #333333;
}

.section-heading .kicker {
  grid-column: 1;
}

.section-heading h2 {
  grid-column: 1;
  margin-bottom: 0;
}

.search-box {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  gap: 0.25rem;
  color: #444444;
  font-size: 0.9rem;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #777777;
  border-radius: 0;
  background: #ffffff;
  color: #222222;
  font-size: 1rem;
}

.tag-grid {
  display: block;
}

.tag-card {
  border-bottom: 1px solid var(--line);
}

.tag-card[hidden] {
  display: none;
}

.tag-card a {
  min-height: 70px;
  padding: 0.75rem 0.6rem;
  display: grid;
  grid-template-columns: 2.5rem 6.5rem 13rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.tag-card a:hover {
  background: #eeeeee;
}

.tag-card a:focus-visible {
  outline-offset: -3px;
}

.count {
  color: #666666;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.tag-card code,
.lesson code,
.mini-grid code {
  padding: 0.08rem 0.25rem;
  background: var(--code-bg);
  color: #222222;
}

.tag-card h3,
.tag-card p {
  margin: 0;
}

.tag-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.lesson-page {
  padding: 1.25rem 0 4rem;
}

.breadcrumbs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.lesson-hero {
  max-width: 760px;
  margin-bottom: 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #333333;
}

.lesson-hero h1 {
  font-size: 2.4rem;
}

.lesson-hero .tldr {
  margin-top: 1.5rem;
  background: var(--page);
}

.lesson-layout {
  grid-template-columns: minmax(0, 720px) 250px;
  gap: 3.5rem;
  align-items: start;
  justify-content: space-between;
}

.lesson-content {
  min-width: 0;
}

.lesson-content section {
  min-width: 0;
  padding: 0 0 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.lesson-content p,
.lesson-content li {
  max-width: 70ch;
  overflow-wrap: anywhere;
}

.lesson-content pre {
  min-width: 0;
}

.lesson-content h2 code {
  font-size: 0.86em;
}

.lesson-aside {
  position: sticky;
  top: 1rem;
  border-width: 0 0 0 3px;
  background: var(--page);
}

.lesson-aside dl {
  margin-bottom: 0;
}

.lesson-aside dt {
  margin-top: 0.8rem;
  font-weight: 700;
}

.lesson-aside dd {
  margin: 0.1rem 0 0;
  color: var(--muted);
}

.check-list,
.warning-list {
  padding-left: 1.3rem;
}

.check-list li,
.warning-list li {
  margin-bottom: 0.45rem;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 2px solid #333333;
}

.pager a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.pager a:last-child {
  justify-content: flex-end;
  text-align: right;
}

.more-lessons {
  margin-top: 3.5rem;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.mini-grid a {
  min-height: 44px;
  padding-top: 0.85rem;
  display: grid;
  gap: 0.45rem;
  border-top: 1px solid #777777;
  color: #333333;
  text-decoration: none;
}

.mini-grid a:hover span {
  text-decoration: underline;
}

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid #bbbbbb;
  background: var(--page);
  color: #444444;
  font-size: 0.9rem;
}

.footer-grid {
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.footer-title {
  margin-bottom: 0.2rem;
  color: #222222;
  font-weight: 700;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 840px) {
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .lesson-aside {
    position: static;
    max-width: 720px;
    border-width: 1px;
  }

  .tag-card a {
    grid-template-columns: 2.5rem 6rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .tag-card p {
    grid-column: 2 / -1;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .shell {
    width: min(100% - 24px, 1040px);
  }

  .header-inner,
  .intro-grid,
  .section-heading,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-inner {
    gap: 0;
    padding-top: 0.8rem;
  }

  .brand {
    padding-bottom: 0.55rem;
  }

  .top-nav {
    justify-content: flex-start;
    margin-inline: -0.5rem;
  }

  .top-nav a {
    padding-inline: 0.5rem;
  }

  .home-hero {
    padding: 2.25rem 0;
  }

  h1,
  .lesson-hero h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .lead {
    font-size: 1.08rem;
  }

  .intro-band {
    padding: 2rem 0;
  }

  .intro-grid {
    gap: 1.5rem;
  }

  .directory {
    padding-top: 2.25rem;
  }

  .section-heading {
    gap: 0.25rem;
  }

  .section-heading .kicker,
  .section-heading h2,
  .search-box {
    grid-column: 1;
    grid-row: auto;
  }

  .search-box {
    margin-top: 0.85rem;
  }

  .tag-card a {
    grid-template-columns: 2.2rem 5.8rem minmax(0, 1fr);
    gap: 0.5rem;
    padding-inline: 0.25rem;
  }

  .tag-card h3 {
    font-size: 1rem;
  }

  .tag-card p {
    grid-column: 2 / -1;
  }

  .lesson-page {
    padding-top: 1rem;
  }

  .lesson-hero {
    margin-bottom: 1.75rem;
  }

  .pager,
  .mini-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager a:last-child {
    justify-content: flex-start;
    text-align: left;
  }
}

@media print {
  body {
    color: #000000;
    background: #ffffff;
    font-size: 11pt;
  }

  .site-header,
  .site-footer,
  .hero-actions,
  .search-box,
  .pager,
  .more-lessons {
    display: none;
  }

  .shell,
  .lesson-hero,
  .lesson-content {
    width: 100%;
    max-width: none;
  }

  .lesson-layout {
    display: block;
  }

  .lesson-aside {
    position: static;
    margin-top: 1rem;
  }

  pre {
    white-space: pre-wrap;
    border-color: #555555;
    background: #ffffff;
    color: #000000;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}