/* global.css — base element styles for the dark canvas */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-lg);          /* 18px body */
  line-height: var(--leading-relaxed);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

p { color: var(--text-muted); }

strong { color: var(--text-primary); font-weight: var(--weight-medium); }

/* Links inside body copy */
.link {
  color: var(--text-primary);
  border-bottom: 1px solid rgba(245, 245, 242, 0.4);
  transition: border-color var(--duration-base) var(--ease-out);
}
.link:hover { border-color: var(--color-paper); }

/* Universal focus ring — Cardinal Red, 2px, 2px offset. Never removed. */
:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);     /* 24px mobile */
}
@media (min-width: 768px) {
  .container { padding-inline: var(--space-12); }   /* 48px tablet+ */
}

.container--narrow { max-width: var(--max-width-narrow); }

section { padding-block: var(--section-py-mobile); }
@media (min-width: 768px) {
  section { padding-block: var(--section-py-desktop); }
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  color: var(--color-black);
  padding: var(--space-3) var(--space-4);
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

/* Visually hidden (screen-reader only) */
.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;
}
