/* ==========================================================================
   base.css
   Reset, element defaults, typography rules and layout primitives.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  min-height: 100vh;
  background: var(--color-surface-white);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--leading-body);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* ---- Typography rules -------------------------------------------------------
   Headings: a two-line heading never leaves one word alone on the 2nd line.
   Body: avoid orphaned last words.                                           */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: var(--leading-heading);
  color: var(--color-text-primary);
  text-wrap: balance;
  overflow-wrap: break-word;
}

p, li, dd, figcaption, blockquote {
  text-wrap: pretty;
}

/* Bricolage Grotesque: Figma fixes the optical size at 14 for every style.
   The self-hosted file already has it built in (fonts.css); this keeps the
   same result if the full variable font is ever used instead. */
h1, h2, h3, h4, h5, h6,
.site-nav, .btn, .project-banner__wordmark {
  font-variation-settings: "opsz" 14, "wdth" 100;
}

a {
  color: inherit;
}

/* ---- Focus ----------------------------------------------------------------- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}

/* ---- Skip link ------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-page-x);
  top: -100px;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-text-primary);
  color: var(--color-cream);
  font-family: var(--font-heading);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

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

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

/* ---- Layout primitives --------------------------------------------------------
   .container — page margins (64 desktop / 24 mobile), max content 1312.        */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--space-page-x));
  margin-inline: auto;
  padding-inline: var(--space-page-x);
}

/* ---- Text styles (Figma text styles as classes) ---------------------------------- */
.t-display {
  font-family: var(--font-heading);
  font-size: var(--type-display);
  font-weight: 500;
  line-height: var(--leading-display);
  color: var(--color-text-primary);
}

.t-title {
  font-size: var(--type-title);
  font-weight: 500;
}

.t-h2 {
  font-size: var(--type-h2);
  font-weight: 500;
}

.t-h3 {
  font-size: var(--type-h3);
  font-weight: 600;
}

.t-h4 {
  font-size: var(--type-h4);
  font-weight: 600;
}

.t-body-lg {
  font-size: var(--type-body-lg);
  line-height: var(--leading-body);
}

.t-subtitle {
  font-size: var(--type-subtitle);
  line-height: var(--leading-body);
  color: var(--color-text-muted);
}

.t-small {
  font-size: var(--type-body-sm);
  line-height: var(--leading-small);
}

.t-caption {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

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