/* AB24 — base reset & typography foundation */

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

/* Any component class that sets its own `display` (flex/grid/etc.) beats
   the browser's default [hidden]{display:none} at equal specificity —
   without this, toggling the `hidden` attribute silently does nothing on
   such elements (lightboxes, grids toggled by JS, empty states). */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

table {
  border-collapse: collapse;
}

/* ---- Accessible focus states ---- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-sm);
  z-index: var(--z-toast);
  background: var(--color-brand-strong);
  color: var(--color-text-inverse);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  transition: top var(--duration-fast) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-sm);
}

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

::selection {
  background: var(--color-brand);
  color: var(--color-text-inverse);
}

/* ---- Typography scale ---- */
.display-1 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-heavy);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

.display-2 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-heavy);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

/*
   Definitive spacing rhythm for the eyebrow -> heading -> lead/body
   pattern. Fixed (not viewport-dependent) so the same gap applies
   identically everywhere this pattern is used, and at every breakpoint —
   whether wrapped in .section-head or standalone (e.g. inside .split).
   Only the LAST element in a run should have no trailing margin; that's
   handled with :last-child rather than per-usage overrides.
*/
.h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
}

.h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-sm);
}

.h3 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-xs);
}

.h4 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-xs);
}

.h2:last-child,
.h3:last-child,
.h4:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  color: var(--ab24-black);
  line-height: var(--lh-body);
  margin-bottom: var(--space-sm);
}

.lead:last-child {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  margin-bottom: var(--space-xs);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand-strong);
}

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

.text-subtle {
  color: var(--color-text-subtle);
}

.text-inverse {
  color: var(--color-text-inverse);
}
