/* ==========================================================================
   base.css — reset, page defaults, typography, layout helpers.
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  /* faint graph-paper grid, like a sprite editor */
  background-image:
    linear-gradient(var(--grid) 2px, transparent 2px),
    linear-gradient(90deg, var(--grid) 2px, transparent 2px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  transition: background-color 0.2s steps(4), color 0.2s steps(4);
}

svg {
  display: block;
  shape-rendering: crispEdges;
  fill: currentColor;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
}

h3 {
  font-size: 1.75rem;
  line-height: 1.1;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 4px solid var(--a3);
  outline-offset: 4px;
}

::selection {
  background: var(--a2);
  color: var(--on-a2);
}

section[id] {
  scroll-margin-top: 96px;
}

/* ---- helpers ---- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--a1);
  color: var(--on-a1);
  font-family: var(--font-pixel);
  font-size: 0.75rem;
}

.skip-link:focus {
  top: 16px;
}

.eyebrow {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  letter-spacing: 1px;
  line-height: 1.6;
  color: var(--a3);
}

.hl {
  color: var(--hl);
  text-shadow: 4px 4px 0 var(--shadow);
}

.section {
  padding-block: var(--section-y);
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 44px;
}

.section__lead {
  max-width: 36rem;
  font-size: 1.125rem;
  color: var(--muted);
}

/* CRT scanlines. Strength comes from the active skin. */
.crt {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: var(--scanlines);
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0 2px, transparent 2px 4px);
}
