/* ==========================================================================
   base.css — Reset, root elements, typography, helpers
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--accent) transparent;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: var(--lh-base);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
  background-color: var(--surface-2);
}

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

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

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

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

/* Headings */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--heading);
  letter-spacing: -0.01em;
}

p {
  max-width: 68ch;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* Scrollbar (WebKit) */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: var(--bg-alt);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
  border: 3px solid var(--bg-alt);
}

/* Focus visibility (keyboard accessibility) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: fixed;
  inset-block-start: -100px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  transition: inset-block-start var(--dur) var(--ease-out);
}
.skip-link:focus {
  inset-block-start: 1rem;
}

/* Screen-reader only */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Utility text */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--fs-300);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-strong);
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

.text-accent {
  color: var(--accent-strong);
}
.text-center {
  text-align: center;
}
.text-balance {
  text-wrap: balance;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
