/* Base: reset, typography, focus, motion */

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

* {
  margin: 0;
}

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

body {
  min-height: 100svh;
  background: var(--color-surface-base);
  color: var(--color-text-primary);
  font-family: var(--font-grotesk);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  hyphens: auto;
  overflow-wrap: break-word;
}

/* English words are short enough: no automatic hyphenation (German needs it) */
:root:lang(en) body {
  hyphens: manual;
}

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

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

/* zero specificity: component classes always win over this reset */
:where(ul, ol)[role="list"] {
  list-style: none;
  padding: 0;
}

/* ---------- Text styles ---------- */

.text-display,
.text-h1,
.text-h2,
.text-h3 {
  font-weight: var(--font-weight-bold);
}

.text-display { font-size: var(--font-size-display); line-height: var(--line-height-display); letter-spacing: var(--letter-spacing-display); }
.text-h1 { font-size: var(--font-size-h1); line-height: var(--line-height-h1); letter-spacing: var(--letter-spacing-h1); }
.text-h2 { font-size: var(--font-size-h2); line-height: var(--line-height-h2); letter-spacing: var(--letter-spacing-h2); }
.text-h3 { font-size: var(--font-size-h3); line-height: var(--line-height-h3); letter-spacing: var(--letter-spacing-h3); }

.text-lead {
  font-size: var(--font-size-lead);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-lead);
  letter-spacing: var(--letter-spacing-lead);
}

.text-body {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-body);
}

.text-small {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-small);
  letter-spacing: var(--letter-spacing-small);
}

.text-button {
  font-size: var(--font-size-button);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-button);
  letter-spacing: var(--letter-spacing-button);
}

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

.container {
  width: 100%;
  max-width: calc(var(--layout-content) + 2 * var(--layout-margin));
  margin-inline: auto;
  padding-inline: var(--layout-margin);
}

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

.skip-link {
  position: fixed;
  top: var(--space-16);
  left: var(--space-16);
  z-index: 1000;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-pill);
  background: var(--color-surface-inverse);
  color: var(--color-fixed-light);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: 2px solid var(--color-interactive-primary);
  outline-offset: 2px;
}

/* after a tap or click (site.js): no ring; any key press brings it back */
:root[data-pointer] :focus-visible {
  outline: none;
}

/* ---------- 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;
  }
}

/* Placeholder layout for pages without their own template yet: clear the fixed header */
.page-default {
  min-height: 60svh;
  padding-block: calc(var(--header-height, 92px) + var(--layout-block)) var(--layout-section);
}

/* the hidden attribute always wins over component display values */
[hidden] {
  display: none !important;
}
