/* ==========================================================================
   Base: reset, typography, layout helpers, motion
   Uses tokens only. No raw colors, font sizes, or spacing in this file.
   ========================================================================== */

/* ---- Reset --------------------------------------------------------------- */

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

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

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

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

/* ---- Typography ---------------------------------------------------------- */

body {
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-body-300);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body-300);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-heading);
  overflow-wrap: break-word;
}

h1 { font-size: var(--font-size-page-title); }
h2 { font-size: var(--font-size-section-title); }
h3 { font-size: var(--font-size-heading-200); }
h4 { font-size: var(--font-size-heading-300); }
h5,
h6 { font-size: var(--font-size-heading-400); }

strong,
b {
  font-weight: var(--font-weight-bold);
}

/* Type styles, named after the Figma text styles (Website/…) */

.heading-50,
.heading-100,
.heading-200,
.heading-300,
.heading-400 {
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-heading);
}

.heading-50 { font-size: var(--font-size-heading-50); }
.heading-100 { font-size: var(--font-size-heading-100); }
.heading-200 { font-size: var(--font-size-heading-200); }
.heading-300 { font-size: var(--font-size-heading-300); }
.heading-400 { font-size: var(--font-size-heading-400); }

/* Responsive title sizes for any heading level (32 / 48 / 64 and 32 / 48 / 48) */
.heading-page { font-size: var(--font-size-page-title); }
.heading-section { font-size: var(--font-size-section-title); }

.body-100 {
  font-family: var(--font-body);
  font-size: var(--font-size-body-100);
  line-height: var(--line-height-body-100);
}

.body-200 {
  font-family: var(--font-body);
  font-size: var(--font-size-body-200);
  line-height: var(--line-height-body-200);
}

.body-300 {
  font-family: var(--font-body);
  font-size: var(--font-size-body-300);
  line-height: var(--line-height-body-300);
}

.body-300-bold {
  font-family: var(--font-body);
  font-size: var(--font-size-body-300);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-body-300);
}

.body-400 {
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: var(--font-size-body-400);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-body-400);
  letter-spacing: var(--letter-spacing-body-400);
  text-transform: capitalize;
}

/* ---- Links and focus ----------------------------------------------------- */

a {
  color: var(--color-link);
  text-decoration-thickness: var(--size-border);
  text-underline-offset: var(--space-4);
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover,
a.is-hover {
  color: var(--color-link-hover);
}

:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}

.on-dark :focus-visible,
.on-dark:focus-visible {
  outline-color: var(--color-focus-inverse);
}

/* ---- Layout helpers ------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--width-max);
  margin-inline: auto;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-16));
}

.visually-hidden {
  position: absolute;
  width: var(--size-border);
  height: var(--size-border);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: var(--space-8);
  left: var(--space-8);
  z-index: 10;
  padding: var(--space-12) var(--space-16);
  background-color: var(--color-blue-900);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: var(--font-size-button);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-2);
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  color: var(--color-white);
  transform: translateY(0);
}

/* ---- Motion: scroll reveal ----------------------------------------------- */
/* The "js" class is set in the <head>, so content stays visible without JS. */

.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Motion: page transitions -------------------------------------------- */
/* Cross-fade between pages where the browser supports view transitions. */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--duration-base);
  animation-timing-function: var(--ease-out);
}

/* ---- Motion: off for people who ask for reduced motion ------------------- */

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

  @view-transition {
    navigation: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
