@font-face {
  font-family: "Hedvig Letters Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/hedvig-letters-serif.woff2") format("woff2");
}

:root {
  color-scheme: light;
  /* Warm-neutral palette: pure-ish warm-white paper, warm near-black ink. */
  --reading-background: oklch(0.995 0.002 80);
  --page-background: var(--reading-background);
  --page-surface: oklch(0.974 0.004 75);
  --page-ink: oklch(0.21 0.008 60);
  /* Long-form reading ink: softer than --page-ink for a calmer editorial
     body, still well above WCAG AA against the paper background. */
  --reading-ink: oklch(0.32 0.012 60);
  --muted-ink: oklch(0.44 0.015 60);
  --subtle-ink: oklch(0.52 0.013 65);
  --soft-divider: oklch(0.88 0.006 70);
  --quiet-divider: oklch(0.93 0.004 75);
  --focus-ring: oklch(0.5 0.01 60);
  --focus-fill: oklch(0.92 0.006 70);
  --error-ink: oklch(0.39 0.105 25);
  --teaching-surface: oklch(0.968 0.005 70);
  /* Emphasis is carried by ink + weight, not hue: the accent is the darkest ink. */
  --teaching-accent: var(--page-ink);
  --code-surface: oklch(0.965 0.006 75);
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Hedvig Letters Serif", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --measure-page: 44rem;
  --measure-article: 42rem;
  --measure-shell: 76rem;
  --measure-chrome: 60rem;
  --space-shell: 1.5rem;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-background);
  color: var(--page-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a,
button,
summary,
.copy-control,
.article-completion__button {
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    text-decoration-color 140ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  background: var(--focus-fill);
  border-radius: 0.125rem;
  outline: 2px solid var(--focus-ring);
  outline-offset: 0.18rem;
}

.skip-link {
  background: var(--page-background);
  border: 1px solid var(--page-ink);
  color: var(--page-ink);
  font-weight: 650;
  left: var(--space-shell);
  padding: 0.65rem 0.8rem;
  position: fixed;
  text-decoration: none;
  top: var(--space-shell);
  transform: translateY(calc(-100% - var(--space-shell) - 0.5rem));
  z-index: 10;
}

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

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

.site-shell {
  width: min(100%, var(--measure-shell));
  margin: 0 auto;
  padding: var(--space-shell);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  width: 100%;
  max-width: var(--measure-chrome);
  margin-inline: auto;
}

.site-header {
  padding-bottom: 0.5rem;
}

.site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--page-ink);
  text-decoration: none;
  transition: opacity 140ms ease;
}

.site-brand:hover {
  opacity: 0.7;
}

.site-brand__wordmark {
  color: var(--page-ink);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

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

/* The header controls row: the disclosure panel holds the nav links + account.
   Desktop = inline row; mobile = collapsed/overlay (see .site-menu rules). */
.site-menu__panel {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
}

/* Bare panel links (Articles/About) — NOT the account control, which keeps its
   own .site-account__link button styling. */
.site-menu__panel > a,
.site-footer-nav a {
  align-items: center;
  color: var(--muted-ink);
  display: inline-flex;
  font-size: 0.9375rem;
  min-height: 2.75rem;
  text-decoration: none;
}

.site-menu__panel > a:hover,
.site-footer-nav a:hover {
  color: var(--page-ink);
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.22em;
}

.site-account {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
}

.site-account {
  color: var(--muted-ink);
  font-size: 0.9375rem;
  line-height: 1.25;
}

.site-account__link {
  align-items: center;
  color: var(--page-ink);
  display: inline-flex;
  font: inherit;
  min-height: 2.75rem;
  text-decoration: none;
}

/* Sign in is the anonymous CTA — a balanced outline button (no fill). */
.site-account__link {
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  min-height: 2.3rem;
  padding: 0.35rem 0.9rem;
}

.site-account__link:hover {
  border-color: var(--page-ink);
  color: var(--page-ink);
}

/* Header menu disclosure. Desktop default: hamburger button hidden, panel
   shown inline (the base .site-menu__panel is already display:flex). The
   mobile block below hides the closed panel; [data-open] — set on .site-menu
   by the inline menu script — reveals it as an overlay. */
.site-menu__toggle {
  align-items: center;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: none;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
  touch-action: manipulation;
}

/* Flat three-bar hamburger; the bars cross into a ✕ when the menu is open. */
.site-menu__icon,
.site-menu__icon::before,
.site-menu__icon::after {
  background: var(--page-ink);
  border-radius: 1px;
  display: block;
  height: 2px;
  width: 1.25rem;
}

.site-menu__icon {
  position: relative;
}

.site-menu__icon::before,
.site-menu__icon::after {
  content: "";
  position: absolute;
}

.site-menu__icon::before {
  top: -0.4rem;
}

.site-menu__icon::after {
  top: 0.4rem;
}

.site-menu[data-open] .site-menu__icon {
  background: transparent;
}

.site-menu[data-open] .site-menu__icon::before {
  top: 0;
  transform: rotate(45deg);
}

.site-menu[data-open] .site-menu__icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-main {
  padding: 4.5rem 0;
}

.page-slot {
  max-width: var(--measure-page);
  margin-inline: auto;
}

.page-kicker {
  margin: 0 0 0.85rem;
  color: var(--muted-ink);
  font-size: 0.875rem;
  text-align: center;
}

.page-kicker::before {
  content: "";
  display: block;
  width: 2.75rem;
  height: 1px;
  margin: 0 auto 1.45rem;
  background: var(--soft-divider);
}

/* Reading pages keep a left-aligned header (no centered hero). */
.article-page .page-kicker {
  text-align: left;
}

.article-page .page-kicker::before {
  content: none;
}

.page-slot h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.65rem + 2.5vw, 3.35rem);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
}

.page-slot p {
  margin: 0;
}

.page-slot h1 + p {
  max-width: 38rem;
  margin: 1rem auto 0;
  color: var(--muted-ink);
  font-size: 1.125rem;
  line-height: 1.6;
  text-align: center;
  text-wrap: pretty;
}

.article-page__body h1,
.article-page__tease-header h1 {
  text-align: left;
}

.article-page h1 + p {
  margin-inline: 0;
  text-align: left;
}

.home-intro {
  max-width: 48rem;
}

.home-intro__header {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}

.home-intro__header::before {
  content: "";
  display: block;
  width: 2.75rem;
  height: 1px;
  margin: 0 auto 1.45rem;
  background: var(--soft-divider);
}

.home-intro__dek {
  max-width: 38rem;
  margin: 1rem auto 0;
  color: var(--muted-ink);
  font-size: 1.125rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.home-intro__primary-link {
  align-items: center;
  border-bottom: 1px solid var(--page-ink);
  color: var(--page-ink);
  display: inline-flex;
  font-weight: 650;
  margin-top: 1.5rem;
  min-height: 2.75rem;
  padding-bottom: 0.2rem;
  text-decoration: none;
}

.home-intro__primary-link:hover {
  border-bottom-width: 2px;
  padding-bottom: calc(0.2rem - 1px);
}

.home-intro__manual {
  margin-top: 4rem;
}

.home-intro__manual-row {
  border-bottom: 1px solid var(--quiet-divider);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
  padding: 1.4rem 0;
}

.home-intro__manual-row h2,
.home-intro__manual-row p {
  margin: 0;
}

.home-intro__manual-row h2 {
  font-size: 1rem;
  line-height: 1.35;
}

.home-intro__manual-row p {
  color: var(--muted-ink);
  line-height: 1.6;
}

.manual-page__body {
  border-top: 1px solid var(--soft-divider);
  margin-top: 3rem;
}

.manual-page__section {
  border-bottom: 1px solid var(--soft-divider);
  padding: 1.5rem 0;
}

.manual-page__section h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0;
}

.manual-page__section p,
.manual-page__list {
  color: var(--page-ink);
  line-height: 1.7;
  margin: 0.85rem 0 0;
  text-wrap: pretty;
}

.manual-page__section p + p {
  margin-top: 1rem;
}

.manual-page__list {
  padding-left: 1.2rem;
}

.manual-page__list li + li {
  margin-top: 0.65rem;
}

.manual-page__contact a {
  color: var(--page-ink);
  font-weight: 650;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.manual-page__contact a:hover {
  text-decoration-thickness: 0.12em;
}

.manual-page__section p a {
  color: var(--page-ink);
  text-decoration: underline;
  text-decoration-color: var(--muted-ink);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
}

.manual-page__section p a:hover {
  text-decoration-color: var(--page-ink);
  text-decoration-thickness: 0.12em;
}

/* Authentication (passwordless: magic link + Google + Microsoft) */
.auth-page {
  max-width: 30rem;
}

/* The masthead (kicker, h1, lede) inherits the centered page-slot style.
   Everything actionable sits in one narrow, centered column — no card. */
.auth-flows {
  display: grid;
  gap: 1.4rem;
  margin: 2.5rem auto 0;
  max-width: 23rem;
}

.auth-section {
  display: grid;
  gap: 0.85rem;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.auth-field label {
  color: var(--page-ink);
  font-size: 0.9375rem;
  font-weight: 650;
}

.auth-field input {
  background: var(--page-background);
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  color: var(--page-ink);
  font: inherit;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

.auth-field input:focus-visible {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--focus-fill);
  outline: none;
}

.auth-turnstile {
  min-height: 0;
}

.auth-submit,
.auth-provider-button {
  align-items: center;
  background: var(--page-background);
  border: 1px solid var(--page-ink);
  border-radius: 0.5rem;
  color: var(--page-ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 650;
  gap: 0.625rem;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 0.9rem;
  text-align: center;
  width: 100%;
}

/* Solid ink CTA: the one filled button, anchoring hierarchy without hue. */
.auth-submit--primary {
  background: var(--page-ink);
  border-color: var(--page-ink);
  color: var(--reading-background);
}

.auth-submit--primary:not(:disabled):hover {
  background: oklch(0.3 0.008 60);
  border-color: oklch(0.3 0.008 60);
}

.auth-submit__spinner {
  display: none;
  width: 1.05em;
  height: 1.05em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}

.auth-submit.is-submitting {
  cursor: progress;
}

.auth-submit.is-submitting .auth-submit__spinner {
  display: block;
}

.auth-submit:disabled {
  cursor: progress;
  opacity: 0.9;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit__spinner {
    animation-duration: 1.4s;
  }
}

.auth-provider-button__logo {
  display: block;
  flex: 0 0 auto;
  height: 1.125rem;
  width: 1.125rem;
}

.auth-provider-button:not(:disabled):hover {
  background: var(--page-surface);
}

.auth-divider {
  align-items: center;
  color: var(--subtle-ink);
  display: flex;
  font-size: 0.85rem;
  gap: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--soft-divider);
  content: "";
  flex: 1;
  height: 1px;
}

.auth-provider-list {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.auth-provider-list__item {
  margin: 0;
}

/* Disabled (e.g. before OAuth credentials are configured) keeps the brand mark
   visible so the production look can be previewed; only interaction is removed. */
.auth-provider-button:disabled {
  cursor: not-allowed;
}

.auth-notice {
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  margin: 0;
  padding: 0.9rem 1rem;
}

.auth-notice h2 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 0;
}

.auth-notice p {
  color: var(--muted-ink);
  line-height: 1.55;
  margin: 0.35rem 0 0;
  text-wrap: pretty;
}

.auth-notice--success {
  background: var(--teaching-surface);
  border-color: var(--focus-ring);
}

.auth-notice--error {
  background: var(--page-surface);
  border-color: var(--error-ink);
}

.account-page {
  max-width: 44rem;
}

.account-settings,
.account-access-prompt {
  border-top: 1px solid var(--soft-divider);
  margin-top: 3rem;
}

.account-notice {
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
}

.account-notice--success {
  background: var(--teaching-surface);
  border-color: var(--focus-ring);
}

.account-notice h2 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 0;
}

.account-notice p {
  color: var(--muted-ink);
  line-height: 1.55;
  margin: 0.35rem 0 0;
}

.account-access-prompt {
  padding-top: 1.35rem;
}

.account-access-prompt h2,
.account-section__header h2,
.account-action-area h3 {
  margin: 0;
}

.account-access-prompt h2,
.account-section__header h2 {
  font-size: 1.15rem;
  line-height: 1.3;
}

.account-access-prompt p,
.account-section__header p,
.account-action-area p {
  color: var(--muted-ink);
  line-height: 1.6;
  margin: 0.45rem 0 0;
  text-wrap: pretty;
}

.account-access-prompt__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.account-action-link {
  align-items: center;
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  color: var(--page-ink);
  display: inline-flex;
  font-weight: 650;
  min-height: 2.85rem;
  padding: 0.7rem 0.9rem;
  text-decoration: none;
}

.account-action-link--primary {
  border-color: var(--page-ink);
}

.account-action-link:hover {
  border-color: var(--teaching-accent);
  color: var(--teaching-accent);
}

.account-section {
  border-bottom: 1px solid var(--soft-divider);
  padding: 1.5rem 0;
}

.account-definition-list {
  border-top: 1px solid var(--quiet-divider);
  margin: 1.15rem 0 0;
}

.account-definition-list div {
  border-bottom: 1px solid var(--quiet-divider);
  display: grid;
  gap: 0.5rem 1.25rem;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  padding: 0.85rem 0;
}

.account-definition-list dt {
  color: var(--muted-ink);
  font-size: 0.9375rem;
}

.account-definition-list dd {
  color: var(--page-ink);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-definition-list dd[data-account-email-verified="true"] {
  color: var(--teaching-accent);
  font-weight: 650;
}

.account-provider-list {
  border-top: 1px solid var(--quiet-divider);
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 0;
}

.account-provider-list li {
  border-bottom: 1px solid var(--quiet-divider);
  display: grid;
  gap: 0.35rem 1.25rem;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  padding: 0.85rem 0;
}

.account-provider-list__name {
  color: var(--page-ink);
  font-weight: 650;
}

.account-provider-list__status {
  color: var(--muted-ink);
  line-height: 1.5;
}

.account-provider-actions {
  margin-top: 1.35rem;
}

.account-provider-actions h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 0;
}

.account-provider-link-form {
  margin: 0;
}

.account-signout-form {
  margin-top: 1rem;
}

.account-change-email-form,
.account-delete-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  max-width: 26rem;
}

.account-form-field {
  display: grid;
  gap: 0.4rem;
}

.account-form-field span {
  color: var(--page-ink);
  font-weight: 650;
}

.account-form-field input {
  background: var(--page-background);
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  color: var(--page-ink);
  font: inherit;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

.account-form-field input:focus-visible {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--focus-fill);
  outline: none;
}

.account-provider-link-button {
  align-items: center;
  appearance: none;
  background: var(--page-background);
  border: 1px solid var(--page-ink);
  border-radius: 0.5rem;
  color: var(--page-ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 650;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 0.9rem;
  text-align: center;
}

.account-provider-link-button:hover {
  background: var(--page-surface);
}

/* The one destructive action reads as destructive at rest, then fills on intent. */
.account-delete-button {
  border-color: var(--error-ink);
  color: var(--error-ink);
}

.account-delete-button:hover {
  background: var(--error-ink);
  border-color: var(--error-ink);
  color: var(--reading-background);
}

.account-action-areas {
  display: grid;
  gap: 0;
  margin-top: 1.15rem;
}

/* Actions read as a calm divided list, not a stack of boxed cards: a single
   hairline sits between items, with nothing ruling the first or last edge. */
.account-action-area {
  padding: 1.1rem 0;
}

.account-action-area:first-child {
  padding-top: 0;
}

.account-action-area + .account-action-area {
  border-top: 1px solid var(--quiet-divider);
}

.account-action-area h3 {
  font-size: 1rem;
  line-height: 1.35;
}

/* The delete action is set apart as its own quiet danger zone at the page end. */
.account-section--danger {
  padding-top: 2.25rem;
}

.account-email-preferences-form {
  display: grid;
  gap: 1rem;
  justify-items: start;
  margin-top: 1.15rem;
  max-width: 26rem;
}

.account-checkbox-field {
  align-items: start;
  color: var(--page-ink);
  cursor: pointer;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: auto minmax(0, 1fr);
  line-height: 1.5;
}

.account-checkbox-field input {
  accent-color: var(--page-ink);
  height: 1.05rem;
  margin-top: 0.15rem;
  width: 1.05rem;
}

.unsubscribe-page {
  max-width: 32rem;
}

.unsubscribe-form,
.unsubscribe-page__links {
  margin-top: 1.75rem;
  text-align: center;
}

.account-action-area__status {
  color: var(--subtle-ink);
  font-size: 0.9375rem;
  font-weight: 650;
}

.error-page {
  max-width: 38rem;
}

.error-page__links {
  border-top: 1px solid var(--soft-divider);
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin-top: 2rem;
  padding-top: 1rem;
}

.error-page__links a {
  color: var(--page-ink);
  font-weight: 650;
  text-decoration-color: var(--soft-divider);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.error-page__links a:hover {
  color: var(--teaching-accent);
  text-decoration-color: var(--teaching-accent);
}

.article-page.page-slot {
  max-width: none;
}

.article-page__layout {
  display: grid;
  grid-template-columns: minmax(0, var(--measure-article));
  justify-content: center;
}

.article-page__article {
  min-width: 0;
}

.article-page__header {
  align-items: center;
  border-bottom: 1px solid var(--soft-divider);
  display: flex;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
}

.article-page__header p {
  margin: 0;
}

.article-page__header time {
  color: var(--muted-ink);
  font-size: 0.9375rem;
}

.article-page__body {
  color: var(--reading-ink);
  font-size: 1.0625rem;
  line-height: 1.78;
  max-width: var(--measure-article);
}

.article-page__body p,
.article-page__body ul,
.article-page__body ol,
.article-page__body figure,
.article-page__body blockquote {
  margin: 1.4rem 0 0;
  text-wrap: pretty;
}

/* Lead-in: the first paragraph after the title sets an editorial register. */
.article-page__body > h1 + p {
  color: var(--page-ink);
  font-size: 1.2rem;
  line-height: 1.6;
  margin-top: 1.6rem;
}

.article-page__body h1 {
  color: var(--page-ink);
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.55rem + 2vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.article-page__body h2,
.article-page__body h3,
.article-page__body h4 {
  color: var(--page-ink);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
}

/* Section breaks read as larger pauses than paragraph breaks. */
.article-page__body h2 {
  font-size: 1.55rem;
  letter-spacing: -0.008em;
  margin: 3.5rem 0 0;
}

.article-page__body h3 {
  font-size: 1.22rem;
  margin: 2.6rem 0 0;
}

.article-page__body h4 {
  font-size: 1.02rem;
  margin: 2.2rem 0 0;
}

.article-page__body a {
  color: var(--page-ink);
  text-decoration-color: var(--muted-ink);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

.article-page__body a:hover {
  text-decoration-color: var(--page-ink);
  text-decoration-thickness: 0.12em;
}

.article-page__body code {
  background: var(--code-surface);
  border: 1px solid var(--quiet-divider);
  border-radius: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.05rem 0.25rem;
}

.article-page__body pre {
  background: var(--code-surface);
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  box-sizing: border-box;
  color: var(--page-ink);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin: 1.35rem 0 0;
  overflow-x: auto;
  padding: 1rem;
  white-space: pre;
  width: 100%;
}

.article-page__body pre code {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  display: inline;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  white-space: inherit;
}

.article-page__body li + li {
  margin-top: 0.45rem;
}

.article-page__tease-header {
  border-bottom: 1px solid var(--soft-divider);
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
}

.article-page__tease-header h1,
.article-page__tease-header p {
  margin: 0;
}

.article-page__tease-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.55rem + 2vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.08;
  text-wrap: balance;
}

.article-page__tease-header h1 + p {
  color: var(--muted-ink);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-top: 0.9rem;
  text-wrap: pretty;
}

.article-page__body--tease {
  border-bottom: 1px solid var(--soft-divider);
  padding-bottom: 1.5rem;
}

.article-gate {
  border-bottom: 1px solid var(--soft-divider);
  color: var(--page-ink);
  margin-top: 0;
  padding: 1.25rem 0 1.5rem;
}

.article-gate__eyebrow,
.article-gate h2,
.article-gate p {
  margin: 0;
}

.article-gate__eyebrow {
  color: var(--muted-ink);
  font-size: 0.875rem;
}

.article-gate h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin-top: 0.4rem;
  text-wrap: balance;
}

.article-gate p {
  color: var(--muted-ink);
  line-height: 1.6;
  margin-top: 0.55rem;
  max-width: 35rem;
  text-wrap: pretty;
}

.article-gate__link {
  align-items: center;
  border: 1px solid var(--page-ink);
  color: var(--page-ink);
  display: inline-flex;
  font-weight: 650;
  margin-top: 1rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
}

.article-gate__link:hover {
  background: var(--page-surface);
}

.article-roadmap {
  margin-top: 4.5rem;
}

.article-roadmap__series {
  padding: 0;
}

.article-roadmap__series + .article-roadmap__series {
  margin-top: 4rem;
}

.article-roadmap__series h2,
.article-roadmap__series > p {
  margin: 0;
}

.article-roadmap__series h2 {
  font-size: 1.2rem;
  line-height: 1.25;
  text-wrap: balance;
}

.article-roadmap__series > p {
  color: var(--muted-ink);
  font-size: 0.9375rem;
  margin-top: 0.35rem;
}

.article-roadmap__series ol {
  counter-reset: article-roadmap;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.article-roadmap__entry {
  align-items: baseline;
  border-top: 1px solid var(--quiet-divider);
  counter-increment: article-roadmap;
  display: grid;
  gap: 0.4rem 1.25rem;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  padding: 1.15rem 0;
}

.article-roadmap__entry::before {
  color: var(--subtle-ink);
  content: counter(article-roadmap, decimal-leading-zero);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.article-roadmap__entry h3,
.article-roadmap__entry p {
  margin: 0;
}

.article-roadmap__entry h3 {
  font-size: 1.0625rem;
  grid-column: 2;
  line-height: 1.35;
}

.article-roadmap__entry h3 a {
  align-items: center;
  color: var(--page-ink);
  display: inline-flex;
  min-height: 2.75rem;
  text-decoration-color: var(--soft-divider);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.article-roadmap__entry h3 a:hover {
  color: var(--teaching-accent);
  text-decoration-color: var(--teaching-accent);
}

.article-roadmap__entry--completed h3 a {
  text-decoration-color: var(--quiet-divider);
}

.article-roadmap__entry p {
  color: var(--muted-ink);
  font-size: 0.9375rem;
  grid-column: 2;
  line-height: 1.55;
  max-width: 38rem;
  text-wrap: pretty;
}

.article-roadmap__entry .article-roadmap__completion {
  align-items: center;
  align-self: center;
  display: inline-flex;
  grid-column: 3;
  grid-row: 1;
  margin: 0;
}

.article-roadmap__status {
  color: var(--subtle-ink);
  font-size: 0.875rem;
}

.article-navigation {
  align-items: start;
  border-top: 1px solid var(--quiet-divider);
  display: grid;
  gap: 1rem 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4rem;
  padding-top: 1.5rem;
}

/* Read-state marker: a two-state circle shared by the roadmap indicator and the
   article toggle. Hollow ring = unread; ink-filled check = read. Greyscale only. */
.read-marker {
  display: inline-grid;
  block-size: 1.3rem;
  inline-size: 1.3rem;
  place-items: center;
}

.read-marker__glyph {
  block-size: 100%;
  display: block;
  inline-size: 100%;
}

.read-marker__ring {
  fill: none;
  stroke: color-mix(in srgb, var(--page-ink), transparent 62%);
  stroke-width: 1.6;
  transition:
    fill 160ms cubic-bezier(0.22, 1, 0.36, 1),
    stroke 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.read-marker__check {
  fill: none;
  opacity: 0;
  stroke: var(--reading-background);
  stroke-dasharray: 13;
  stroke-dashoffset: 13;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  transition:
    stroke-dashoffset 240ms cubic-bezier(0.22, 1, 0.36, 1) 40ms,
    opacity 120ms ease;
}

[data-read-state="read"] .read-marker__ring {
  fill: var(--page-ink);
  stroke: var(--page-ink);
}

[data-read-state="read"] .read-marker__check {
  opacity: 1;
  stroke-dashoffset: 0;
}

/* Article-page toggle: icon-only button, 44px touch target around the marker. */
.read-toggle-control {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.read-toggle {
  appearance: none;
  background: transparent;
  block-size: 2.75rem;
  border: 0;
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  display: inline-grid;
  inline-size: 2.75rem;
  padding: 0;
  place-items: center;
}

.read-toggle:hover .read-marker__ring {
  stroke: var(--page-ink);
}

.read-toggle-control[data-read-state="read"] .read-toggle:hover .read-marker__ring {
  fill: color-mix(in srgb, var(--page-ink), transparent 16%);
  stroke: color-mix(in srgb, var(--page-ink), transparent 16%);
}

.read-toggle:focus-visible {
  background: var(--focus-fill);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.read-toggle[aria-busy="true"] {
  cursor: progress;
}

.read-toggle__error {
  color: var(--error-ink);
  font-size: 0.8125rem;
  line-height: 1.3;
  max-inline-size: 12rem;
  text-align: end;
}

/* Minimal inline links — no bordered cards. */
.article-navigation__link,
.article-navigation__all {
  color: var(--page-ink);
  min-width: 0;
  text-decoration: none;
}

.article-navigation__link:hover .article-navigation__title {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.22em;
}

.article-navigation__link--previous {
  grid-column: 1;
}

.article-navigation__all {
  align-items: center;
  color: var(--muted-ink);
  display: flex;
  font-size: 0.9375rem;
  grid-column: 2;
  justify-content: center;
  text-align: center;
}

.article-navigation__all:hover {
  color: var(--page-ink);
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.22em;
}

.article-navigation__link--next {
  grid-column: 3;
  text-align: right;
}

.article-navigation__label,
.article-navigation__title {
  display: block;
}

.article-navigation__label {
  color: var(--muted-ink);
  font-size: 0.8125rem;
}

.article-navigation__link--previous .article-navigation__label::before {
  content: "\2190\00a0";
}

.article-navigation__link--next .article-navigation__label::after {
  content: "\00a0\2192";
}

.article-navigation__title {
  font-weight: 650;
  line-height: 1.35;
  margin-top: 0.3rem;
}

.content-debug {
  max-width: none;
}

.content-debug code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.content-debug-section {
  margin-top: 3rem;
}

.content-debug-section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.2;
}

.content-debug-summary,
.content-debug-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 1.25rem 0 0;
}

.content-debug-summary p,
.content-debug-counts div {
  border-top: 1px solid var(--soft-divider);
  margin: 0;
  min-width: 8rem;
  padding-top: 0.75rem;
}

.content-debug-summary strong,
.content-debug-counts dd {
  display: block;
  color: var(--page-ink);
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.1;
  margin: 0 0 0.25rem;
}

.content-debug-summary span,
.content-debug-counts dt,
.content-debug-muted {
  color: var(--muted-ink);
}

.content-debug-counts dt {
  font-size: 0.9375rem;
}

.content-debug-table {
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
  min-width: 42rem;
  width: 100%;
}

.content-debug-table caption {
  margin-bottom: 0.75rem;
  text-align: left;
}

.content-debug-table th,
.content-debug-table td {
  border-bottom: 1px solid var(--soft-divider);
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.content-debug-table thead th {
  border-top: 1px solid var(--soft-divider);
  color: var(--muted-ink);
  font-weight: 650;
}

.content-debug-table tbody th {
  font-weight: 600;
}

.content-debug-section:has(.content-debug-table) {
  overflow-x: auto;
}

.content-debug-json {
  background: var(--code-surface);
  border: 1px solid var(--soft-divider);
  box-sizing: border-box;
  color: var(--page-ink);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 1rem 0 0;
  max-height: 32rem;
  overflow: auto;
  padding: 1rem;
  white-space: pre;
}

/* The heading text sits flush; the "#" anchor link lives in the left gutter
   and only appears on hover/focus, so headings read as clean serif lines. */
.anchored-heading {
  position: relative;
  scroll-margin-top: 1.5rem;
}

.anchored-heading a {
  color: var(--muted-ink);
  font-family: var(--font-mono);
  font-size: 0.78em;
  opacity: 0;
  padding-right: 0.4rem;
  position: absolute;
  right: 100%;
  text-decoration: none;
  top: 0.15em;
  transition: opacity 140ms ease;
}

.anchored-heading a:focus-visible,
.anchored-heading:hover a {
  opacity: 1;
}

.teaching-callout,
.prompt-block,
.before-after,
.copyable-example {
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  box-sizing: border-box;
  margin: 1.75rem 0;
  overflow: hidden;
}

.teaching-callout {
  background: var(--teaching-surface);
  padding: 1rem 1.125rem;
}

.teaching-callout--warning {
  border-color: oklch(0.76 0.08 75);
}

.teaching-callout__title,
.prompt-block figcaption,
.before-after__label,
.copyable-example figcaption {
  color: var(--page-ink);
  font-size: 0.875rem;
  font-weight: 650;
}

.teaching-callout__title {
  margin: 0 0 0.5rem;
}

.teaching-callout__body > :first-child,
.prompt-block blockquote > :first-child {
  margin-top: 0;
}

.teaching-callout__body > :last-child,
.prompt-block blockquote > :last-child {
  margin-bottom: 0;
}

.prompt-block,
.copyable-example {
  background: var(--page-background);
}

.prompt-block figcaption,
.copyable-example figcaption {
  align-items: center;
  border-bottom: 1px solid var(--soft-divider);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0 1rem;
}

.prompt-block blockquote {
  background: var(--code-surface);
  color: var(--page-ink);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin: 0;
  overflow-x: auto;
  padding: 1rem;
  text-wrap: wrap;
}

.before-after {
  background: var(--page-background);
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.before-after__item {
  min-width: 0;
}

.before-after__item + .before-after__item {
  border-top: 1px solid var(--soft-divider);
}

.before-after__label {
  align-items: center;
  border-bottom: 1px solid var(--soft-divider);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin: 0;
  padding: 0.8rem 1rem;
}

.before-after pre,
.copyable-example__code {
  background: var(--code-surface);
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  color: var(--page-ink);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
  overflow-x: auto;
  padding: 1rem;
  white-space: pre;
  width: 100%;
}

.before-after code {
  color: var(--page-ink);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.copyable-example__code code {
  white-space: pre;
}

.code-block-shell {
  background: var(--code-surface);
  border: 1px solid var(--soft-divider);
  border-radius: 0.5rem;
  box-sizing: border-box;
  margin: 1.35rem 0 0;
  overflow: hidden;
  position: relative;
}

.code-block-shell .code-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding-top: 2.75rem;
}

.copy-control {
  background: var(--page-background);
  border: 1px solid var(--soft-divider);
  border-radius: 0.25rem;
  color: var(--muted-ink);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.2;
  min-height: 2.75rem;
  padding: 0.45rem 0.65rem;
}

.copy-control:hover {
  border-color: var(--muted-ink);
  color: var(--page-ink);
}

.copy-control[data-copy-state="copied"] {
  background: var(--focus-fill);
  border-color: var(--focus-ring);
  color: var(--page-ink);
}

.copy-control[data-copy-state="failed"] {
  color: var(--page-ink);
}

.code-block-shell > .copy-control {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
}

/* Centered footer: nav is the primary content, copyright is quiet fine print below. */
.site-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.site-footer-nav {
  justify-content: center;
}

.site-footer__copyright {
  margin: 0;
  color: var(--subtle-ink);
  font-size: 0.8125rem;
}

@media (max-width: 42rem) {
  /* Header is the overlay's positioning context; brand left, hamburger right. */
  .site-header {
    align-items: center;
    position: relative;
  }

  /* Show the hamburger button; collapse the panel until the menu script sets
     [data-open]. */
  .site-menu__toggle {
    display: flex;
  }

  .site-menu:not([data-open]) > .site-menu__panel {
    display: none;
  }

  /* Open: a flat, full-header-width overlay dropping below the header row. */
  .site-menu[data-open] > .site-menu__panel {
    align-items: stretch;
    background: var(--reading-background);
    border: 1px solid var(--soft-divider);
    box-shadow: 0 0.5rem 1.5rem oklch(0.21 0.008 60 / 0.12);
    flex-direction: column;
    gap: 0;
    left: 0;
    padding: 0.5rem 0;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
  }

  .site-menu[data-open] > .site-menu__panel > a,
  .site-menu[data-open] > .site-menu__panel .site-account {
    min-height: 2.75rem;
    padding-inline: var(--space-shell);
    width: 100%;
  }

  .site-menu[data-open] > .site-menu__panel .site-account__link {
    border: 0;
    min-height: 2.75rem;
    padding: 0;
  }

  .site-account {
    border-left: 0;
    padding-left: 0;
  }

  .page-slot h1 {
    font-size: 2.25rem;
  }

  .home-intro__manual-row {
    display: block;
  }

  .home-intro__manual-row p {
    margin-top: 0.4rem;
  }

  .account-definition-list div,
  .account-provider-list li {
    display: block;
  }

  .account-definition-list dd,
  .account-provider-list__status {
    display: block;
    margin-top: 0.25rem;
  }

  .account-provider-link-form {
    margin-top: 0.45rem;
  }

  .article-roadmap__entry {
    gap: 0.4rem 0.85rem;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
  }

  .article-page__layout {
    display: block;
  }

  .article-navigation {
    grid-template-columns: 1fr;
  }

  .article-navigation__link--previous,
  .article-navigation__all,
  .article-navigation__link--next {
    grid-column: 1;
    text-align: left;
  }

  .article-navigation__all {
    justify-content: flex-start;
  }
}

@media (min-width: 36rem) {
  .before-after {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .before-after__item + .before-after__item {
    border-left: 1px solid var(--soft-divider);
    border-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
