/* Blog documents. Values mirror src/shared/tokens/tokens.css. No new colors. */

:root {
  --bg: hsl(210 20% 2%);
  --surface: hsl(220 18% 3%);
  --ink: hsl(0 0% 100%);
  --ash: hsl(240 1% 61%);
  --smoke: hsl(210 1% 52%);
  --line: hsl(0 0% 100% / 0.12);
  --edge: hsl(220 3% 22%);
  --mist: hsl(0 0% 90%);
  --iron: hsl(210 1% 28%);
  --key: 0 1px 0 0 rgba(255, 255, 255, 0.05) inset, 0 0 0 1px rgba(255, 255, 255, 0.25), 0 -1px 0 0 rgba(0, 0, 0, 0.2) inset;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  padding-top: 5.25rem;
  background: var(--bg);
  color: var(--ash);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 27px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  transform: translateY(-150%);
  background: var(--mist);
  color: var(--iron);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  z-index: 3;
}

.skip:focus { transform: none; }

.top {
  position: fixed;
  z-index: 2;
  top: 0.75rem;
  right: 0.75rem;
  left: 0.75rem;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  height: 3.5rem;
  margin: 0 auto;
  padding: 0 1rem 0 1.1rem;
  border: 1px solid var(--edge);
  border-radius: 20px;
  background: hsl(210 20% 2% / 0.55);
  backdrop-filter: blur(48px) saturate(140%);
  -webkit-backdrop-filter: blur(48px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-family: "Geist", "Nunito Sans", system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
}

.brand-quiet {
  color: var(--ash);
  font-size: 1rem;
}

.mark {
  width: 0.8em;
  height: 0.8em;
  display: block;
}

.bar-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bar-nav > a:not(.button) {
  color: var(--ash);
  text-decoration: none;
  min-height: 2.25rem;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
}

.bar-nav > a:not(.button):hover,
.bar-nav > a[aria-current="page"] { color: var(--ink); }

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--mist);
  outline-offset: 3px;
}

.sheet {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

h1, h2, h3 {
  font-family: "Geist", "Nunito Sans", system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.22px;
  text-wrap: balance;
}

h1 {
  margin: 0.5rem 0 1rem;
  font-size: 32px;
  line-height: 37px;
}

h2 {
  margin: 2.75rem 0 0.85rem;
  font-size: 20px;
  line-height: 26px;
  letter-spacing: 0.2px;
}

p { margin: 0 0 1rem; }

.lede {
  max-width: 38rem;
  font-size: 17px;
  line-height: 27px;
}

.kicker {
  margin: 0;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker a { color: var(--smoke); text-decoration: none; }

.kicker a:hover { color: var(--ink); }

.meta {
  margin: 0 0 0.35rem;
  color: var(--smoke);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.04em;
}

.sheet a { color: var(--ink); }

.sheet p a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

ol.index {
  list-style: none;
  padding: 0;
  margin: 2.75rem 0 0;
}

ol.index > li {
  border-top: 1px solid var(--line);
}

ol.index article {
  padding: 1.35rem 0 1.5rem;
}

ol.index h2 {
  margin: 0 0 0.4rem;
  font-size: 20px;
  line-height: 26px;
}

ol.index h2 a { text-decoration: none; }

ol.index h2 a:hover { text-decoration: underline; text-underline-offset: 0.16em; }

ol.index p:last-child {
  margin-bottom: 0;
  max-width: 38rem;
  font-size: 15px;
  line-height: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.75rem;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  font-family: "Geist", "Nunito Sans", system-ui, sans-serif;
  color: var(--ink);
  margin-bottom: 0.65rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.85rem 0.75rem 0;
  border-top: 1px solid var(--line);
}

.close {
  position: relative;
  isolation: isolate;
  margin-top: 3rem;
  padding: 1.35rem 1.35rem 1.45rem;
  background: hsl(220 18% 3% / 0.78);
  border: 1px solid var(--edge);
  border-radius: 24px;
  overflow: hidden;
}

.close::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/textures/grain.png");
  background-size: 128px 128px;
  opacity: 0.18;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.close p { margin-bottom: 1rem; color: var(--ink); }

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 2rem;
  border-radius: 999px;
  background: var(--mist);
  color: #000;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  box-shadow: var(--key);
}

a.button:hover { background: hsl(0 0% 84%); color: #000; }

a.button-sm {
  min-height: 2.25rem;
  padding: 0 1rem;
  font-size: 14px;
}

.related { margin-top: 2.5rem; }

.related h2 {
  margin-bottom: 0.25rem;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--smoke);
}

.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related li { border-top: 1px solid var(--line); }

.related a {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
  text-decoration: none;
}

.related a:hover { text-decoration: underline; text-underline-offset: 0.16em; }

.colophon {
  display: grid;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--smoke);
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.colophon p { margin: 0; }

.colophon nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.colophon nav a {
  color: var(--smoke);
  text-decoration: none;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
}

.colophon nav a:hover { color: var(--ash); }

@media (min-width: 720px) {
  .top { top: 1rem; right: 1rem; left: 1rem; }
  .sheet { padding-top: 3.25rem; }
  h1 { font-size: 40px; line-height: 45px; }
  .colophon { grid-template-columns: 1fr auto 1fr; }
  .colophon nav { justify-content: center; }
  .colophon p { justify-self: end; }
}

@media (prefers-reduced-transparency: reduce) {
  .bar,
  .close {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
