/* ============================================================
   base.css — reset, document defaults, typography, links, lists
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem); /* anchor offset under sticky nav */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(14, 124, 134, 0.18); }

/* ── Headings ── */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.12;
}
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; }
h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.005em;
}

/* ── Paragraphs ── */
p {
  margin-bottom: 1.4rem;
  color: var(--text-secondary);
  max-width: var(--measure);
}
p:last-child { margin-bottom: 0; }

strong { color: var(--text); font-weight: 600; }
em { font-style: italic; }

/* ── Links: underlined, high contrast, generous ── */
a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(14, 124, 134, 0.4);
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
a:hover { color: var(--accent-2); text-decoration-color: currentColor; }
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Inline code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-elevated);
  color: var(--accent-2);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* ── Lists ── */
ul, ol { max-width: var(--measure); margin-bottom: 1.4rem; padding-left: 0; }
ul { list-style: none; }
ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
}
ul li::before {
  content: '';
  position: absolute;
  left: 0.15rem;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
ol { list-style: none; counter-reset: li; }
ol li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
  counter-increment: li;
}
ol li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ── Skip link (a11y) ── */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
