/**
 * Base styles — reset, typography, layout primitives
 */

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

/* ── Typography ── */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin: 0;
}

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

a:hover {
  color: var(--color-accent-hover);
}

code,
pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-subtle);
}

pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-subtle);
}

ul, ol {
  margin: 0;
  padding-left: var(--space-6);
}

/* ── Layout ── */

.container {
  width: 100%;
  max-width: var(--container-md);
  margin-inline: auto;
  padding-inline: var(--content-padding);
}

.container--sm { max-width: var(--container-sm); }
.container--lg { max-width: var(--container-lg); }
.container--xl { max-width: var(--container-xl); }

.stack {
  display: flex;
  flex-direction: column;
}

.stack--2  { gap: var(--space-2); }
.stack--4  { gap: var(--space-4); }
.stack--6  { gap: var(--space-6); }
.stack--8  { gap: var(--space-8); }
.stack--12 { gap: var(--space-12); }

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

/* ── Text utilities ── */

.text-muted   { color: var(--color-text-muted); }
.text-subtle  { color: var(--color-text-subtle); }
.text-sm      { font-size: var(--font-size-sm); }
.text-xs      { font-size: var(--font-size-xs); }
.text-lg      { font-size: var(--font-size-lg); }
.text-center  { text-align: center; }
.text-mono    { font-family: var(--font-mono); }
.lead         { font-size: var(--font-size-lg); line-height: var(--line-height-loose); }

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