:root {
  color-scheme: light dark;
  --page: #0d1117;
  --panel: #151b23;
  --panel-raised: #1b2430;
  --text: #e6edf3;
  --muted: #9da7b3;
  --line: #303946;
  --accent: #ff6b35;
  --accent-soft: #ffb49a;
  --link: #79c0ff;
  --good: #70d89b;
  --warning: #ffcc66;
  --code: #0a0e14;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgb(255 107 53 / 10%), transparent 30rem),
    var(--page);
  color: var(--text);
  font-size: 17px;
  line-height: 1.72;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #b6dcff;
}

a:focus-visible {
  border-radius: 0.2rem;
  outline: 3px solid var(--warning);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.55rem 0.8rem;
  border-radius: 0.4rem;
  background: var(--text);
  color: var(--page);
  transform: translateY(-200%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgb(13 17 23 / 92%);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
  padding-block: 0.8rem;
  gap: 1rem;
}

.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.mark-icon {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 0.45rem;
  color: var(--accent-soft);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.repo-link {
  font-size: 0.84rem;
  font-weight: 650;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.language-switcher a {
  color: var(--muted);
  text-decoration: none;
}

.language-switcher a:hover {
  color: var(--text);
}

.language-switcher a[aria-current="page"] {
  color: var(--accent-soft);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.14rem;
  text-underline-offset: 0.28rem;
}

.article-shell {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
  padding-block: clamp(2rem, 7vw, 5rem);
}

.article-content {
  max-width: 820px;
}

h1,
h2,
h3 {
  color: #fff;
  line-height: 1.16;
  text-wrap: balance;
}

h1 {
  max-width: 18ch;
  margin: 0 0 1.5rem;
  font-size: clamp(2.35rem, 7vw, 5.25rem);
  letter-spacing: -0.055em;
}

h2 {
  margin-top: 3.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.025em;
}

h3 {
  margin-top: 2.1rem;
  font-size: 1.2rem;
}

p,
li {
  max-width: 76ch;
}

strong {
  color: #fff;
}

blockquote {
  margin: 1.8rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid #6f5522;
  border-left: 0.35rem solid var(--warning);
  border-radius: 0.45rem;
  background: #241e13;
  color: #ffe1a6;
}

blockquote p {
  margin: 0;
}

code {
  border: 1px solid var(--line);
  border-radius: 0.28rem;
  background: var(--code);
  color: #f5b99f;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
  padding: 0.12em 0.35em;
}

pre {
  max-width: 100%;
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--code);
  box-shadow: 0 14px 35px rgb(0 0 0 / 20%);
}

pre code {
  border: 0;
  background: transparent;
  color: #d8dee9;
  overflow-wrap: normal;
  padding: 0;
}

table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 1.6rem 0;
  overflow-x: auto;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--panel);
}

th,
td {
  min-width: 9rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-raised);
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

.site-footer {
  width: min(100% - 2rem, 1120px);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

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

  .header-inner {
    align-items: flex-start;
  }

  .header-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 0.35rem;
  }

  .site-mark span:last-child {
    display: none;
  }

  .article-shell {
    width: min(100% - 1.25rem, 1120px);
    padding-top: 2.25rem;
  }

  h1 {
    font-size: clamp(2.2rem, 13vw, 3.4rem);
  }

  pre {
    margin-inline: -0.2rem;
    padding: 0.9rem;
  }
}

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