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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--surface-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open,
body.drawer-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

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

em {
  color: var(--color-accent-popcorn);
  font-style: normal;
}

mark {
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
}

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 7px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  background: var(--surface-card);
  color: var(--text-secondary);
}

::selection {
  background: var(--color-primary);
  color: var(--surface-bg);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: var(--z-toast);
  padding: 12px 18px;
  background: var(--color-primary);
  color: var(--surface-bg);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 12px;
}

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

* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-card-hover) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--surface-card-hover);
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface-bg);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
