/* RegContent — dark, dense developer-docs. System fonts only. */
:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-code: #010409;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --faint: #6e7681;
  --border: #30363d;
  --link: #79c0ff;
  --link-hover: #a5d6ff;
  --accent: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --focus: #1f6feb;
  --header-h: 3.25rem;
  --max: 52rem;
  --max-wide: 64rem;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  padding: 0.4rem 0.7rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
}

.skip:focus {
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.55rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}

.brand:hover {
  color: var(--link);
}

.brand span {
  color: var(--accent);
  font-weight: 800;
}

.site-nav {
  display: flex;
  gap: 0.9rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.search-form {
  position: relative;
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 28rem;
}

.search-form input[type="search"] {
  width: 100%;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}

.search-form input[type="search"]::placeholder {
  color: var(--faint);
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-height: min(22rem, 70vh);
  overflow: auto;
  z-index: 50;
}

.search-results[hidden] {
  display: none;
}

.search-results a,
.search-results .empty {
  display: block;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.search-results a:last-child,
.search-results .empty:last-child {
  border-bottom: 0;
}

.search-results a:hover,
.search-results a:focus {
  background: #21262d;
}

.search-results .title {
  font-weight: 600;
  font-size: 0.9rem;
}

.search-results .snippet {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.search-results .empty {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Main */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.4rem 1rem 3rem;
}

main.wide {
  max-width: var(--max-wide);
}

main.home {
  max-width: var(--max-wide);
}

.coming {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.home-columns {
  display: grid;
  gap: 0.35rem 1.5rem;
  margin: 0.25rem 0 1.25rem;
}

.home-columns > section > h2 {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.home-columns .note-list {
  margin-bottom: 0.65rem;
}

@media (min-width: 860px) {
  .home-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
}

h1 {
  font-size: 1.65rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.55rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  font-weight: 650;
}

h3 {
  font-size: 1.02rem;
  margin: 1.2rem 0 0.4rem;
  font-weight: 650;
}

p,
ul,
ol {
  margin: 0 0 0.85rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.28rem;
}

.meta-line {
  color: var(--faint);
  font-size: 0.82rem;
  margin: 0 0 1.1rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.42rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-elev);
  font-weight: 650;
  white-space: nowrap;
}

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

tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.num {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

/* Code */
pre,
code,
kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

code,
kbd {
  font-size: 0.86em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08em 0.32em;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
  margin: 0 0 1.1rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: #c9d1d9;
}

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  background: var(--bg-elev);
  padding: 0.7rem 0.85rem;
  border-radius: 0 6px 6px 0;
  margin: 0 0 1.1rem;
  color: var(--text);
  font-size: 0.92rem;
}

.callout.danger {
  border-left-color: var(--danger);
}

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

/* Home note cards */
.note-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.65rem;
}

.note-list a {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elev);
}

.note-list a:hover {
  border-color: #484f58;
}

.note-list h2 {
  border: 0;
  margin: 0 0 0.2rem;
  padding: 0;
  font-size: 1.02rem;
  color: var(--link);
}

.note-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.related {
  margin-top: 1.5rem;
}

.related ul {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.1rem 1rem 1.6rem;
}

.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
}

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

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.footer-copy p {
  margin: 0;
}

.footer-disclaimer {
  color: var(--faint);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.tagline {
  color: var(--faint);
  font-weight: 500;
  font-size: 0.82rem;
  margin: 0 0 1rem;
}

/* 404 */
.not-found {
  text-align: left;
}

.not-found .code {
  font-size: 0.85rem;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.5rem 0.75rem;
  }

  .search-form {
    flex: 1 1 100%;
    max-width: none;
    order: 3;
  }

  .site-nav {
    margin-left: auto;
  }

  h1 {
    font-size: 1.4rem;
  }

  main {
    padding: 1.1rem 0.75rem 2.5rem;
  }
}

@media (min-width: 900px) {
  main {
    font-size: 0.98rem;
  }
}


/* Formatter tools */
.tool-form {
  margin: 0 0 0.5rem;
}

.tool-label {
  display: block;
  font-weight: 650;
  font-size: 0.88rem;
  margin: 0.85rem 0 0.35rem;
  color: var(--muted);
}

.tool-input {
  display: block;
  width: 100%;
  min-height: 12.5rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-code);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}

.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin: 0.75rem 0 0.25rem;
}

.tool-toolbar button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}

.tool-toolbar button:hover {
  border-color: #484f58;
}

.tool-toolbar button.primary {
  background: #238636;
  border-color: #2ea043;
  color: #fff;
}

.tool-toolbar button.primary:hover {
  background: #2ea043;
}

.tool-status {
  color: var(--muted);
  font-size: 0.82rem;
}

pre.tool-output {
  min-height: 8rem;
  white-space: pre;
}

.kicker {
  margin: 0 0 0.35rem;
  color: var(--faint);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { color: var(--link); }
.series-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.series-list li {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}
.series-list a {
  display: block;
  color: var(--text);
  text-decoration: none;
}
.series-list a:hover { color: var(--link); }
.series-num {
  display: inline-block;
  min-width: 1.5rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  margin-right: 0.5rem;
}
.series-sub {
  display: block;
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.series-soon { color: var(--faint); }

.home h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
  border: 0;
  padding: 0;
}
