/* ─── Base ───────────────────────────────────────────────────────────────────
   Mobile-first; breakpoints 480 / 640 / 768 / 992 / 1200.
   ────────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  /* Themed page scrollbar (docs/styling.md). */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary-color) 55%, var(--bg-color)) var(--bg-light);
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: var(--bg-light);
  }
  ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary-color) 55%, var(--bg-color));
    border: 2px solid var(--bg-light);
    border-radius: 999px;

    &:hover {
      background: var(--primary-color);
    }
  }
}

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

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--text-font);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--title-font);
  font-weight: 600;
  line-height: 1.05;
  color: inherit;
}

p,
li,
dd,
dl,
blockquote,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--red);
  transition: color var(--hover-duration) var(--timing);

  &:hover {
    color: var(--red-dark);
  }
}

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

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

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

.main-wrapper {
  position: relative;
  overflow-x: clip;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;

  @media (min-width: 768px) {
    padding: 0 32px;
  }
}

.locked {
  overflow: hidden;
}

.section-pad {
  padding: var(--section-pad) 0;
}

.section-pad-bottom {
  padding-bottom: var(--section-pad);
}

.section-alt {
  background: var(--paper-alt);
}

.section-surface {
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ─── Accessibility ──────────────────────────────────────────────────────── */

.screen-reader-text,
.screen-reader-response {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  margin: 0;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-pill);
}
