/* A small reset that retains native form behavior and list semantics. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, blockquote, figure, pre) {
  margin: 0;
}

:where(ul, ol) {
  padding-inline-start: 1.5em;
}

:where(img, picture, svg, video) {
  display: block;
  max-inline-size: 100%;
}

:where(img, video) {
  block-size: auto;
}

:where(button, input, textarea, select) {
  max-inline-size: 100%;
  color: inherit;
  font: inherit;
}

textarea {
  resize: vertical;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: auto;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-thickness: 0.12em;
}

/* Two contrasting rings remain visible on light, dark and red surfaces. */
:focus-visible {
  outline: 3px solid var(--color-focus-outer);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--color-focus-inner);
}

::selection {
  background-color: var(--color-urban-red);
  color: var(--color-white);
}

.surface-light,
.surface-white {
  color-scheme: light;
  background-color: var(--color-surface);
  color: var(--color-text);
}

.surface-white {
  --color-surface: var(--color-white);
}

.surface-dark {
  --color-surface: var(--color-urban-black);
  --color-text: var(--color-white);
  --color-text-muted: var(--color-stone);
  --color-link: var(--color-white);
  --color-link-hover: var(--color-stone);
  --color-control-hover: var(--color-charcoal);
  --color-rule: var(--color-charcoal);
  --color-detail-text: var(--color-architectural-gold);

  color-scheme: dark;
  background-color: var(--color-surface);
  color: var(--color-text);
}

/* These guard future additions; the foundation itself introduces no 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;
  }
}
