/* ─────────────────────────────────────────────────────────────────────────────
   Hintlab Base Styles
   Reset, typography scale, layout primitives.
   All sizing in rem/em. No fixed-px text containers.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Reset ──────────────────────────────────────────────────────────────────── */

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

html {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul, ol {
  margin-top: 0;
  margin-bottom: calc(var(--sp) * 2);
  padding-left: calc(var(--sp) * 3);
}

li {
  margin-bottom: calc(var(--sp) * .5);
}

/* ── Focus — keyboard users ─────────────────────────────────────────────────── */

*:focus {
  outline: var(--b2) solid var(--ink);
  outline-offset: 2px;
}

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

*:focus-visible {
  outline: var(--b2) solid var(--ink);
  outline-offset: 2px;
}

/* ── Typography scale ───────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  font-family: var(--font-sans);
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 0;
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  border-bottom: var(--b4) solid var(--ink);
  padding-bottom: var(--sp);
  margin-bottom: calc(var(--sp) * 3);
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: calc(var(--sp) * .75);
}

p {
  margin-top: 0;
  margin-bottom: calc(var(--sp) * 1.5);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--ink);
}

.label {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── Layout ─────────────────────────────────────────────────────────────────── */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--sp) * 4);
}

.section {
  margin-bottom: calc(var(--sp) * 6);
}

/* ── High contrast mode ──────────────────────────────────────────────────────── */

@media (prefers-contrast: high) {
  *:focus,
  *:focus-visible {
    outline-width: var(--b3);
  }
}
