/* ============================================================
   Ali3N Dev — the publication stylesheet.

   The colour tokens are lifted verbatim from ali3nstudios.com so the
   two sites are visibly the same company: the same navy grounds, the
   same #38b6ff accent, the same theme-toggle behaviour.

   What differs is everything to do with reading. The marketing site is
   built around cards and a hero; this one is built around a 68ch text
   column, larger body type, real code styling and tables that survive a
   phone. There is no particle canvas and no hero glow on an article
   page — decoration that competes with prose is decoration in the way.
   ============================================================ */

/* ---- Dark (the default) ------------------------------------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:             #050a18;
  --bg-deep:        #00050f;
  --surface:        #0b1327;
  --surface-2:      #111c38;
  --surface-hover:  #16244a;
  --surface-code:   #071021;

  --brand-grad:  linear-gradient(120deg, #00050f 0%, #021043 55%, #010815 100%);
  --accent-grad: linear-gradient(120deg, #2ebae9 0%, #38b6ff 45%, #4c74ff 100%);

  --text:        #e9eefa;
  --text-body:   #dbe4f5;   /* long-form copy sits slightly softer than headings */
  --text-muted:  #a3b4d0;
  --text-faint:  #7186a8;

  --accent:      #38b6ff;
  --accent-soft: #2ebae9;
  --accent-deep: #4c74ff;
  --accent-alt:  #8f8cff;
  --link:        #6dc4ff;
  --link-hover:  #9bd8ff;

  --border:      #1d2c4f;
  --border-soft: #14203c;
  --ring:        #58c8ff;
  --shadow:      0 10px 30px rgba(0, 0, 0, .45);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, .3);

  --ok:     #35d39a;
  --warn:   #ffc861;
  --danger: #ff7a7a;

  --code-key:  #8f8cff;
  --code-str:  #35d39a;
  --code-num:  #ffc861;
  --code-com:  #7186a8;

  --logo-dark-display:  block;
  --logo-light-display: none;
}

/* ---- Light -------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:             #f5f7fc;
  --bg-deep:        #eaeef7;
  --surface:        #ffffff;
  --surface-2:      #f0f3fa;
  --surface-hover:  #e7ecf7;
  --surface-code:   #f7f9fd;

  --brand-grad:  linear-gradient(120deg, #eef2fa 0%, #e3eaf7 55%, #edf1f9 100%);
  --accent-grad: linear-gradient(120deg, #0b8fbf 0%, #0f74c9 45%, #2f4fd4 100%);

  --text:        #0c1424;
  --text-body:   #1a2438;
  --text-muted:  #47576f;
  --text-faint:  #64748f;

  --accent:      #0f6fb5;
  --accent-soft: #0b8fbf;
  --accent-deep: #2f4fd4;
  --accent-alt:  #5b52d6;
  --link:        #0a5f9e;
  --link-hover:  #084a7c;

  --border:      #d3dbe9;
  --border-soft: #e4e9f3;
  --ring:        #0f6fb5;
  --shadow:      0 10px 28px rgba(16, 32, 64, .10);
  --shadow-soft: 0 1px 4px rgba(16, 32, 64, .08);

  --ok:     #12805c;
  --warn:   #8a5a00;
  --danger: #b3261e;

  --code-key:  #5b52d6;
  --code-str:  #12805c;
  --code-num:  #8a5a00;
  --code-com:  #64748f;

  --logo-dark-display:  none;
  --logo-light-display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg:             #f5f7fc;
    --bg-deep:        #eaeef7;
    --surface:        #ffffff;
    --surface-2:      #f0f3fa;
    --surface-hover:  #e7ecf7;
    --surface-code:   #f7f9fd;
    --brand-grad:  linear-gradient(120deg, #eef2fa 0%, #e3eaf7 55%, #edf1f9 100%);
    --accent-grad: linear-gradient(120deg, #0b8fbf 0%, #0f74c9 45%, #2f4fd4 100%);
    --text:        #0c1424;
    --text-body:   #1a2438;
    --text-muted:  #47576f;
    --text-faint:  #64748f;
    --accent:      #0f6fb5;
    --accent-soft: #0b8fbf;
    --accent-deep: #2f4fd4;
    --accent-alt:  #5b52d6;
    --link:        #0a5f9e;
    --link-hover:  #084a7c;
    --border:      #d3dbe9;
    --border-soft: #e4e9f3;
    --ring:        #0f6fb5;
    --shadow:      0 10px 28px rgba(16, 32, 64, .10);
    --shadow-soft: 0 1px 4px rgba(16, 32, 64, .08);
    --ok:     #12805c;
    --warn:   #8a5a00;
    --danger: #b3261e;
    --code-key:  #5b52d6;
    --code-str:  #12805c;
    --code-num:  #8a5a00;
    --code-com:  #64748f;
    --logo-dark-display:  none;
    --logo-light-display: block;
  }
}

/* ---- Non-colour tokens -------------------------------------- */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --measure: 68ch;
  --wrap: 1160px;
  --wrap-narrow: 760px;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  /* Body copy runs a step larger than the marketing site: this is a
     reading surface, not a landing page. */
  --step--1: clamp(.8125rem, .79rem + .1vw, .875rem);
  --step-0:  clamp(1.0625rem, 1.02rem + .2vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.13rem + .35vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.3rem + .7vw, 1.9rem);
  --step-3:  clamp(1.75rem, 1.45rem + 1.3vw, 2.5rem);
  --step-4:  clamp(2.05rem, 1.6rem + 2.2vw, 3.1rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

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

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 1.15em; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
::selection { background: var(--accent); color: #00050f; }

.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;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); color: var(--text);
  padding: .75rem 1rem; border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---- Layout -------------------------------------------------- */
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, var(--wrap-narrow)); margin-inline: auto; }
main { flex: 1 0 auto; padding-block: 2.5rem 4rem; }

/* ---- Header -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; gap: 1rem; padding-block: .65rem; }

.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; margin-right: auto; }
.brand:hover { color: inherit; }
.brand img { height: 34px; width: auto; }
.brand .logo-dark  { display: var(--logo-dark-display); }
.brand .logo-light { display: var(--logo-light-display); }
/* The section badge is what tells a reader they are in /dev/ and not on
   the storefront. It is the only place the two sites differ in the header. */
.brand-badge {
  font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: .18rem .42rem; border-radius: 5px; line-height: 1;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: .45rem .7rem;
  color: var(--text-muted); text-decoration: none;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface-hover); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--surface-2); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.theme-toggle .icon-sun  { display: var(--logo-dark-display); }
.theme-toggle .icon-moon { display: var(--logo-light-display); }

@media (max-width: 61.99em) {
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: .5rem 1rem 1rem;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: .75rem .5rem; border-radius: 0; border-bottom: 1px solid var(--border-soft); }
}
@media (min-width: 62em) {
  .nav-toggle { display: none; }
  .site-nav { display: block !important; }
}

/* ---- Page heads ---------------------------------------------- */
.page-head { padding-block: 2rem 1.5rem; border-bottom: 1px solid var(--border-soft); margin-bottom: 2rem; }
.page-head h1 { margin-bottom: .3rem; }
.page-head p { color: var(--text-muted); margin: 0; max-width: 62ch; }
.eyebrow {
  color: var(--accent); font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; font-size: .72rem; margin: 0 0 .5rem;
  display: block;
}

.breadcrumbs { font-size: .85rem; color: var(--text-faint); margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .4rem; color: var(--border); }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ---- Home lead ----------------------------------------------- */
.lead-story {
  display: block; text-decoration: none; color: inherit;
  padding: 1.75rem; margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent), var(--surface);
}
.lead-story:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: inherit; }
.lead-story h2 { font-size: var(--step-2); margin: .35rem 0 .5rem; }
.lead-story p { color: var(--text-muted); margin: 0 0 .75rem; max-width: 66ch; }

/* ---- Article list -------------------------------------------- */
.stack { display: grid; gap: 0; }
.entry {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border-soft);
  display: grid; gap: .4rem;
}
.entry:first-child { padding-top: 0; }
.entry h2, .entry h3 { margin: 0; font-size: var(--step-1); }
.entry h2 a, .entry h3 a { color: var(--text); text-decoration: none; }
.entry h2 a:hover, .entry h3 a:hover { color: var(--accent); }
.entry p { color: var(--text-muted); margin: 0; max-width: 70ch; }

.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--text-faint);
}
.meta > * + *::before { content: "·"; margin-right: .5rem; color: var(--border); }
.meta a { color: var(--text-muted); text-decoration: none; }
.meta a:hover { color: var(--accent); }

.chip {
  display: inline-block; font-size: .68rem; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--accent);
  border: 1px solid var(--border); text-decoration: none; line-height: 1.4;
}
a.chip:hover { border-color: var(--accent); background: var(--surface-hover); color: var(--accent); }
.chip--muted { color: var(--text-muted); }

/* ---- Columns ------------------------------------------------- */
.cols { display: grid; gap: 3rem; }
@media (min-width: 62em) {
  .cols { grid-template-columns: minmax(0, 1fr) 300px; gap: 3.5rem; }
}
.sidebar > section { margin-bottom: 2.25rem; }
.sidebar h2 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); margin-bottom: .75rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: .45rem; }
.sidebar a { color: var(--text-muted); text-decoration: none; font-size: .93rem; }
.sidebar a:hover { color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---- Article ------------------------------------------------- */
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: var(--step-3); margin-bottom: .5rem; max-width: 22ch; }
@media (min-width: 48em) { .article-header h1 { max-width: 26ch; } }
.dek {
  font-size: var(--step-1); color: var(--text-muted);
  max-width: 60ch; margin: 0 0 1rem; line-height: 1.45;
}

.prose { max-width: var(--measure); color: var(--text-body); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: var(--step-2); margin-top: 2.4em; margin-bottom: .5em;
  padding-top: .5em; border-top: 1px solid var(--border-soft);
  color: var(--text); scroll-margin-top: 5rem;
}
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { font-size: var(--step-1); margin-top: 1.9em; margin-bottom: .4em; color: var(--text); scroll-margin-top: 5rem; }
.prose ul, .prose ol { padding-left: 1.35em; margin-block: 1.15em; }
.prose li { margin-bottom: .45em; }
.prose li > ul, .prose li > ol { margin-block: .45em; }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--link); }

.prose blockquote {
  margin: 1.6em 0; padding: .2em 0 .2em 1.15em;
  border-left: 3px solid var(--accent); color: var(--text-muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* Inline code and fenced blocks. Code is the reason a developer
   publication needs its own typography at all. */
.prose code {
  font-family: var(--font-mono); font-size: .875em;
  background: var(--surface-2); color: var(--accent-alt);
  padding: .12em .38em; border-radius: 5px;
  border: 1px solid var(--border-soft);
  overflow-wrap: break-word;
}
.prose figure.code { margin: 1.6em 0; position: relative; }
.prose figure.code pre {
  margin: 0; padding: 1.1rem 1.15rem; overflow-x: auto;
  background: var(--surface-code); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem; line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}
.prose figure.code code {
  background: none; border: 0; padding: 0; color: var(--text-body);
  font-size: inherit; white-space: pre;
}
.code-lang {
  position: absolute; top: .5rem; right: .65rem;
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); pointer-events: none;
}

/* Tables scroll inside their own box; the page never scrolls sideways. */
.prose .table-scroll { overflow-x: auto; margin: 1.6em 0; -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 32rem; }
.prose th, .prose td {
  text-align: left; padding: .6rem .75rem;
  border: 1px solid var(--border); vertical-align: top;
}
.prose th { background: var(--surface-2); font-weight: 650; color: var(--text); white-space: nowrap; }

.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border-soft); margin-block: 1.6em; }
.prose hr { margin: 2.5em 0; }

/* ---- Article furniture ---------------------------------------- */
.callout {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 1rem 1.15rem; margin: 1.75rem 0; font-size: .95rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-left-color: var(--warn); }
.callout-info { border-left-color: var(--accent-soft); }
.callout h3 { font-size: 1rem; margin: 0 0 .4rem; }

.sources-box {
  margin-top: 3rem; padding: 1.35rem 1.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: var(--measure);
}
.sources-box h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); margin: 0 0 .9rem; border: 0; padding: 0;
}
.sources-box ol { list-style: none; margin: 0; padding: 0; counter-reset: src; }
.sources-box li {
  counter-increment: src; margin-bottom: .85rem;
  padding-left: 2rem; position: relative; font-size: .93rem;
}
.sources-box li::before {
  content: counter(src); position: absolute; left: 0; top: .1rem;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-faint); font-size: .72rem; font-weight: 700;
  display: grid; place-items: center;
}
.sources-box li:last-child { margin-bottom: 0; }
.sources-box .src-role {
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent); margin-left: .4rem;
}
.sources-box .src-pub { color: var(--text-faint); font-size: .85rem; display: block; }

.disclosure {
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
  font-size: .85rem; color: var(--text-faint);
  max-width: var(--measure);
}
.disclosure a { color: var(--text-muted); }

/* ---- App promotion. Bordered card, no interstitial, no sticky bar. ---- */
.app-cta {
  margin: 2.5rem 0 0; padding: 1.35rem;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent), var(--surface);
  max-width: var(--measure);
}
.app-cta__label {
  font-size: .66rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: .75rem;
}
.app-cta__top { display: flex; gap: .9rem; align-items: flex-start; }
.app-cta__icon {
  width: 52px; height: 52px; flex: none; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--surface-2); object-fit: cover;
}
.app-cta h3 { margin: 0 0 .2rem; font-size: 1.06rem; }
.app-cta p { color: var(--text-muted); margin: 0; font-size: .93rem; }
.app-cta__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.store-link {
  font-size: .84rem; font-weight: 650; text-decoration: none;
  padding: .38rem .75rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted);
}
.store-link:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-hover); }

/* ---- Related ------------------------------------------------- */
.related { margin-top: 3rem; max-width: var(--measure); }
.related h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); margin-bottom: .9rem;
}
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { padding: .6rem 0; border-bottom: 1px solid var(--border-soft); }
.related li:last-child { border-bottom: 0; }
.related a { color: var(--text); text-decoration: none; font-weight: 600; }
.related a:hover { color: var(--accent); }
.related .meta { margin-top: .15rem; }

/* ---- Search + forms ------------------------------------------ */
.search-form { display: flex; gap: .6rem; max-width: 34rem; margin-bottom: 2rem; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], textarea, select {
  width: 100%; padding: .62rem .8rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: .95rem;
}
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--accent); }
textarea { min-height: 9rem; resize: vertical; font-family: var(--font-mono); font-size: .9rem; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.1rem; border-radius: 999px;
  font-weight: 650; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); color: var(--text); }
.btn-primary { background: var(--accent-grad); border-color: transparent; color: #00050f; }
.btn-primary:hover { filter: brightness(1.08); color: #00050f; }
:root[data-theme="light"] .btn-primary { color: #fff; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .btn-primary { color: #fff; }
}
.btn-sm { padding: .35rem .75rem; font-size: .85rem; }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---- Pagination ---------------------------------------------- */
.pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pager a, .pager span {
  padding: .45rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-muted); font-size: .9rem;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .current { background: var(--surface-2); color: var(--text); border-color: var(--border); font-weight: 650; }
.pager .disabled { opacity: .4; }

/* ---- Empty states -------------------------------------------- */
.empty {
  padding: 3rem 1.5rem; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty h2 { font-size: var(--step-1); color: var(--text); margin-bottom: .4rem; }

/* ---- Long-form standing pages -------------------------------- */
.doc { max-width: var(--measure); }
.doc h2 { font-size: var(--step-2); margin-top: 2.2em; padding-top: .4em; border-top: 1px solid var(--border-soft); }
.doc h2:first-of-type { margin-top: 1em; }
.doc h3 { font-size: var(--step-1); margin-top: 1.8em; }
.doc ul, .doc ol { padding-left: 1.35em; margin-block: 1.15em; }
.doc li { margin-bottom: .5em; }
.doc table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .93rem; }
.doc th, .doc td { text-align: left; padding: .55rem .7rem; border: 1px solid var(--border); vertical-align: top; }
.doc th { background: var(--surface-2); }
.doc code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }

.source-group { margin-bottom: 2rem; }
.source-group h3 { font-size: 1rem; text-transform: capitalize; margin-bottom: .6rem; }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-list li {
  padding: .7rem 0; border-bottom: 1px solid var(--border-soft);
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline;
}
.source-list .authority {
  font-family: var(--font-mono); font-size: .75rem; color: var(--text-faint);
  margin-left: auto;
}

/* ---- Footer -------------------------------------------------- */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding-block: 2.5rem; margin-top: auto;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 48em) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-brand img { height: 30px; width: auto; margin-bottom: .7rem; }
.footer-brand .logo-dark  { display: var(--logo-dark-display); }
.footer-brand .logo-light { display: var(--logo-light-display); }
.footer-brand p { color: var(--text-muted); max-width: 34ch; margin: 0; font-size: .9rem; }
.site-footer h2 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); margin-bottom: .7rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; font-size: .9rem; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-base {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border-soft);
  color: var(--text-faint); font-size: .85rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* ---- Print --------------------------------------------------- */
@media print {
  .site-header, .site-footer, .app-cta, .related, .pager, .sidebar { display: none; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; }
  .prose a::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}
