*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-family);
  font-weight: var(--fw-regular);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@supports (scrollbar-width: none) { body { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; } }
body::-webkit-scrollbar { width: 6px; height: 6px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb { background-color: var(--border-strong); border-radius: var(--radius-pill); }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img, video, svg { display: block; max-width: 100%; }
button, input, textarea, select {
  font: inherit; color: inherit; background: none; border: none; outline: none;
  -webkit-appearance: none; appearance: none;
}
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: var(--fw-semibold); line-height: 1.2; }

/* Utilities */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Page transition */
#app { min-height: 100vh; }
.page-enter { animation: fadeIn var(--transition-normal) forwards; opacity: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@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;
  }
}
