/* SPDX-FileCopyrightText: 2026 Kartoza
 * SPDX-License-Identifier: MIT
 *
 * Reset, document defaults and typography.
 */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  /* A struggling reader benefits from a slightly looser setting than usual. */
  letter-spacing: 0.003em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.018em;
  font-weight: 640;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

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

a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
a:hover { text-decoration-color: currentColor; }

strong { font-weight: 660; }

code, .notation {
  font-family: var(--font-mark);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
  padding: 0.08em 0.3em;
  border-radius: var(--radius-sm);
  background: var(--paper-sunken);
  white-space: nowrap;
}

/* The colour code, carried into the running prose. */
.notation--h { color: var(--floor); background: var(--floor-wash); }
.notation--f { color: var(--wall); background: var(--wall-wash); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

img, svg { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: calc(var(--s4) * -6);
  z-index: 100;
  padding: var(--s3) var(--s4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 620;
  transition: top var(--motion) var(--ease);
}
.skip-link:focus { top: var(--s3); }

@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;
  }
}
:root[data-reduced-motion="true"] *, 
:root[data-reduced-motion="true"] *::before,
:root[data-reduced-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

/* --- the ground-line rule, the signature mark of the interface ------------
 * In descriptive geometry the linha de terra is drawn as a horizontal line
 * finished with a short tick at each end. That mark is the spine of this
 * interface: it opens the brand, separates a lesson heading from its body, and
 * carries the step rail. It is used only where a real division is being made.
 */
.ground-rule {
  position: relative;
  height: 1px;
  background: var(--rule-strong);
  opacity: 0.5;
  margin: var(--s5) 0;
}
.ground-rule::before,
.ground-rule::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--rule-strong);
}
.ground-rule::before { left: 0; }
.ground-rule::after { right: 0; }

/* Small caps-style annotation, the drafting label voice. */
.eyebrow {
  font-family: var(--font-mark);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 var(--s2);
}

em { font-style: italic; color: var(--ink-muted); }
