/* Reset + base. Mobile-first: every rule here is the small-screen baseline;
   larger viewports are layered on with min-width queries in components.css. */

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

html {
  /* Prevent iOS bumping text size on orientation change. */
  -webkit-text-size-adjust: 100%;
  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 {
  margin: 0;
  padding: 0;
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  min-height: 100vh;
  /* Belt and braces against horizontal scroll; individual components are
     still built not to overflow in the first place. */
  overflow-x: hidden;
  overflow-wrap: break-word;
}

/* Media never overflows its container. */
img, svg, video, iframe {
  max-width: 100%;
  display: block;
}
img { height: auto; }

a {
  color: var(--color-gold);
  text-decoration: none;
}
a:hover { color: var(--color-cream); }

button { font-family: inherit; }

input, select, textarea {
  font-family: var(--font-body);
  font-size: max(16px, 1rem); /* <16px triggers iOS zoom-on-focus */
  max-width: 100%;
}

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

h1, h2, h3, h4 { overflow-wrap: break-word; }

/* Author-level so it beats layout classes like .stack { display: flex }.
   JS toggles visibility purely via the hidden attribute. */
[hidden] { display: none !important; }

/* ===== Layout primitives ===== */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--sm { padding-block: var(--section-y-sm); }
.section--dark { background: var(--color-black); }
.section--charcoal { background: var(--color-charcoal); }
.section--cream { background: var(--color-cream); color: var(--color-black); }
.section--border-top { border-top: 1px solid var(--border-subtle-dark); }

.stack { display: flex; flex-direction: column; }
.stack--sm { gap: var(--space-3); }
.stack--md { gap: var(--space-5); }
.stack--lg { gap: var(--stack-gap); }

/* ===== Type helpers ===== */
.text-wrap-pretty { text-wrap: pretty; }

.eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-gold);
}
.eyebrow--dark { color: var(--color-charcoal); }
.eyebrow--dim { color: var(--color-gold-dim); }

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  text-transform: uppercase;
  color: var(--color-white);
}
.display--on-light { color: var(--color-black); }

.body-copy {
  margin: 0;
  font-size: var(--text-lede);
  line-height: 1.6;
  color: var(--color-bone);
}
.body-copy--sm { font-size: var(--text-body-md); }

.measure { max-width: 62ch; }

.rule { height: var(--rule-thin); background: var(--color-gold); }
.rule--medium { height: var(--rule-medium); }
.rule--short { width: 88px; max-width: 100%; }
.rule--hairline { background: var(--border-hairline-dark); }

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