/* Shared by every page under /notes/. Tokens mirror index.html (see DESIGN.md). */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}
:root {
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad: clamp(1.25rem, 4vw, 3rem);
}
[data-theme="light"] {
  --bg: #f6f6f3;
  --ink: #111113;
  --ink-2: #55555b;
  --ink-3: #6b6b72;
  --line: #e0e0db;
  --accent: #3659db;
  --accent-ink: #3659db;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0c0c0d;
  --ink: #ededeb;
  --ink-2: #a1a1a7;
  --ink-3: #8a8a91;
  --line: #242427;
  --accent: #3659db;
  --accent-ink: #8fa2ff;
  color-scheme: dark;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.7 var(--sans);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--accent);
  color: #fff;
}
.wrap {
  width: 100%;
  max-width: 80rem;
  padding-inline: var(--pad);
  margin-inline: auto;
}

/* ---------- header ---------- */
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.crumb {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
}
.crumb:hover,
.crumb[aria-current="page"] {
  color: var(--ink);
}

/* ---------- article ---------- */
main {
  flex: 1;
  padding-block: clamp(2rem, 6vw, 4.5rem) 5rem;
}
article,
.intro {
  max-width: 44rem;
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.it {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.06em;
  letter-spacing: -0.01em;
}
.meta {
  margin-top: 1rem;
  color: var(--ink-3);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.meta a {
  color: inherit;
}
.lead {
  margin-top: 1.75rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}
h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
h3 {
  margin-top: 1.75rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
p,
ul,
ol,
pre,
table {
  margin-top: 0.85rem;
}
article p,
article li {
  color: var(--ink-2);
  text-wrap: pretty;
}
ul,
ol {
  padding-left: 1.2rem;
}
li + li {
  margin-top: 0.4rem;
}
strong {
  color: var(--ink);
  font-weight: 500;
}
a {
  color: var(--accent-ink);
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
code {
  font: 0.86em/1 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}
pre {
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  font: 0.8125rem/1.6 var(--mono);
  tab-size: 2;
}
pre code {
  font: inherit;
  overflow-wrap: normal;
}
.src {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-3);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  font-weight: 500;
}
td {
  color: var(--ink-2);
}
.table {
  overflow-x: auto;
}
.next {
  margin-top: 3rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.next p {
  margin: 0;
  color: var(--ink);
}

/* ---------- notes index ---------- */
.note-list {
  list-style: none;
  padding: 0;
  margin-top: 3rem;
  max-width: 52rem;
  border-top: 1px solid var(--line);
}
.note-list li + li {
  margin-top: 0;
}
.note-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  column-gap: 1.25rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.note-row time {
  padding-top: 0.2rem;
  font-size: 0.875rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.note-row h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: clamp(1.2rem, 1.9vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  transition: color 0.2s;
}
.note-row:hover h2 {
  color: var(--accent-ink);
}
.note-row p {
  margin-top: 0.45rem;
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* ---------- footer ---------- */
footer .footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-block: 1.25rem 1.75rem;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.825rem;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.5rem;
}
footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}
footer a:hover {
  color: var(--ink);
}
footer span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 4px;
  border-radius: 4px;
}
@media (max-width: 760px) {
  .note-row {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
  }
  .note-row time {
    padding-top: 0;
  }
}
