/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  overflow-x: hidden;
}

/* Block scroll when modal/menu is open */
body.scroll-lock {
  overflow: hidden;
}

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

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

button, a {
  -webkit-tap-highlight-color: transparent;
}

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

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  line-height: 1.1;
  text-wrap: balance;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback */
}

p {
  max-width: 70ch;
  text-wrap: pretty;
}

/* Accessibility Focus */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

::selection {
  background: var(--color-primary);
  color: #fff;
}

/* Skip link for a11y */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 1rem;
  background: var(--color-text);
  color: #fff;
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

[hidden] {
  display: none !important;
}

/* Reduced Motion Support */
@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;
  }
}
