/* === BASE — Typography, body, global elements === */

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--text-primary);
  background-color: var(--surface-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Headings --- */

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--accent);
}

.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}

h1, .text-h1 { font-size: var(--text-h1); }
h2, .text-h2 { font-size: var(--text-h2); }
h3, .text-h3 { font-size: var(--text-h3); }

/* --- Paragraphs --- */

p {
  max-width: 65ch;
}

p + p {
  margin-top: var(--space-4);
}

.text-lg {
  font-size: var(--text-body-lg);
}

.text-sm {
  font-size: var(--text-small);
}

/* --- Links --- */

a:not([class]) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--duration-fast) var(--ease-in-out),
              text-decoration-color var(--duration-fast) var(--ease-in-out);
}

a:not([class]):hover {
  color: var(--accent-hover);
}

/* --- Focus --- */

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

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

/* --- Skip link --- */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-dark);
  color: var(--text-on-dark);
  font-size: var(--text-small);
  z-index: 100;
  border-radius: 0 0 4px 4px;
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

/* --- Selection --- */

::selection {
  background-color: var(--accent-light);
  color: var(--surface-dark);
}

/* --- Reduced motion --- */

@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;
  }
}
