/* base.css — reset, tokens, typography. No web fonts: nothing to fetch. */

:root {
  --ink:        #14181f;
  --ink-soft:   #4d5665;
  /* Darkened from #7b8494, which measured 3.25:1 on --paper-3 and so failed
     WCAG AA for normal text. This clears 4.5:1 on every surface it is used on. */
  --ink-faint:  #656c79;
  --paper:      #ffffff;
  --paper-2:    #f5f6f8;
  --paper-3:    #eceef2;
  --line:       #dcdfe6;
  --accent:     #1c5d99;
  --accent-ink: #ffffff;
  --accent-soft:#e8f0f8;
  --good:       #1f6f4a;
  --good-soft:  #e6f2ec;
  --warn:       #8a5a00;
  --warn-soft:  #fbf0da;
  /* One danger family, so nothing hard-codes a red that only works in one
     theme — #c33 measured 3.50:1 on the dark background. */
  --danger:     #cc3333;
  --danger-ink: #8a1c1c;
  --danger-soft:#fdf2f2;
  --danger-line:#e3bdbd;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --shadow: 0 1px 2px rgba(20, 24, 31, .06), 0 4px 12px rgba(20, 24, 31, .05);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #e7eaef;
    --ink-soft:   #a9b2c0;
    --ink-faint:  #87909d;
    --paper:      #14171c;
    --paper-2:    #1a1e25;
    --paper-3:    #23282f;
    --line:       #313842;
    --accent:     #6fa8dc;
    --accent-ink: #0f1216;
    --accent-soft:#1c2733;
    --good:       #7cc9a3;
    --good-soft:  #17261f;
    --warn:       #d8b06a;
    --warn-soft:  #2a2317;
    --danger:     #f0a9a9;
    --danger-ink: #f0a9a9;
    --danger-soft:#2a1a1a;
    --danger-line:#4d2a2a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper-2);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 var(--sp-3); line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

ul, ol { margin: 0 0 var(--sp-3); padding-left: 1.25em; }
li + li { margin-top: var(--sp-1); }

code, pre { font-family: var(--mono); font-size: .875em; }
pre {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3);
  overflow-x: auto;
  background: var(--paper-3);
  border-radius: var(--r-md);
}
code:not(pre code) {
  padding: .1em .35em;
  background: var(--paper-3);
  border-radius: var(--r-sm);
}

/*
 * Focus ring, written so older WebKit still gets one.
 *
 * Safari below 15.4 does not understand :focus-visible and would simply ignore
 * a rule written only for it — leaving keyboard users with no ring at all. So
 * the ring is attached to :focus, and then withdrawn only for pointer focus on
 * browsers that can tell the difference. Every browser ends up with a visible
 * ring for keyboard users; newer ones just avoid showing it on a mouse click.
 */
:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--paper);
  border-radius: var(--r-md);
  z-index: 50;
}
.skip-link:focus { left: var(--sp-2); }

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

.muted  { color: var(--ink-soft); }
.faint  { color: var(--ink-faint); }
.small  { font-size: .875rem; }
.tnum   { font-variant-numeric: tabular-nums; }
