/* Reset, document defaults, typography and layout utilities. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The page stays hidden until translations and the shared layout are in place (see app.js). */
.is-booting body {
  opacity: 0;
}

body {
  transition: opacity var(--duration-fast) ease;
}

main {
  flex: 1;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

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

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--text-link);
  text-underline-offset: 0.2em;
}

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

::selection {
  background: var(--color-coral-500);
  color: var(--color-white);
}

[hidden] {
  display: none !important; /* the hidden attribute must always win over component display rules */
}

/* Typography */

.display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 400;
  line-height: var(--leading-display);
  letter-spacing: -0.01em;
  color: var(--text-brand);
  text-wrap: balance;
}

.h1,
.h2,
.h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-heading);
  color: var(--text-brand);
  text-wrap: balance;
}

.h1 {
  font-size: var(--text-h1);
}

.h2 {
  font-size: var(--text-h2);
}

.h3 {
  font-size: var(--text-h3);
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hand {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-denim-700);
}

.lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: var(--measure);
}

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

.text-sm {
  font-size: var(--text-sm);
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2,
.prose h3 {
  margin-top: var(--space-7);
}

.prose ul {
  padding-left: var(--space-5);
}

/* Layout utilities */

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

.section {
  padding-block: var(--section-gap);
}

.section--brand {
  background: var(--surface-brand);
}

.section--quiet {
  background: var(--surface-quiet);
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.section__intro {
  margin-top: var(--space-3);
}

.stack > * + * {
  margin-top: var(--space-4);
}

.stack-lg > * + * {
  margin-top: var(--space-6);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

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

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  z-index: var(--layer-toast);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-ink-900);
  color: var(--color-white);
  text-decoration: none;
}

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

/* Locks page scroll while a drawer or dialog is open. */
.is-scroll-locked {
  overflow: hidden;
}

/* Rounded photo frame used across pages. */
.photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-quiet);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important; /* accessibility override must beat every component animation */
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
