/* ─── Base Styles ────────────────────────────────────────────────────────────
   Resets, page scrollbar, typography, layout wrapper, utilities.
   Breakpoints (mobile-first, min-width): 480 / 640 / 768 / 992 / 1200.
   ────────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Themed page scrollbar — never the unstyled OS default (docs/styling.md). */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--pastel-green) 70%, var(--primary-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(--pastel-green) 70%, var(--primary-color));
    border: 2px solid var(--bg-light);
    border-radius: 999px;

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

body {
  margin: 0;
  min-width: 320px;
  font: 400 16px/1.7 var(--f-b);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body:not(.home) {
  background-image:
    radial-gradient(50vw 30vw at 90% 0, color-mix(in srgb, var(--secondary-color) 18%, transparent), transparent 60%),
    radial-gradient(50vw 30vw at 0 10%, color-mix(in srgb, var(--pastel-green) 20%, transparent), transparent 60%);
  background-repeat: no-repeat;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
  display: block;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--hover-duration) var(--timing);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--f-h);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.02em;
  color: inherit;
}

h1 em,
h2 em {
  font-style: italic;
  font-weight: 300;
}

p,
figure,
blockquote {
  margin: 0;
}

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

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

button {
  cursor: pointer;
}

::selection {
  background: var(--tint-green);
}

:focus-visible {
  outline: 2px solid var(--deep);
  outline-offset: 3px;
  border-radius: 8px;
}

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

.ha-wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.ha-main {
  position: relative;
  z-index: 1;
  display: block;
}

.is-locked {
  overflow: hidden;
}

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

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

.ha-skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface-color);

  &:focus {
    left: 8px;
  }
}

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