/**
 * StreetWarz Idle - Base Styles
 * Foundational styles using design tokens
 */

/* ===== CSS RESET & NORMALIZATION ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: var(--sw-leading-normal);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: var(--sw-mobile-tap-highlight);
}

body {
  font-family: var(--sw-font-family-primary);
  font-weight: var(--sw-font-normal);
  color: var(--sw-white);
  background-color: var(--sw-dark-bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY BASE ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--sw-font-bold);
  line-height: var(--sw-leading-tight);
  margin-bottom: var(--sw-space-4);
}

h1 { font-size: var(--sw-text-4xl); }
h2 { font-size: var(--sw-text-3xl); }
h3 { font-size: var(--sw-text-2xl); }
h4 { font-size: var(--sw-text-xl); }
h5 { font-size: var(--sw-text-lg); }
h6 { font-size: var(--sw-text-base); }

p {
  margin-bottom: var(--sw-space-4);
  line-height: var(--sw-leading-normal);
}

/* ===== INTERACTIVE ELEMENTS ===== */
button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

input,
textarea,
select {
  border: 1px solid var(--sw-dark-border);
  border-radius: var(--sw-radius-md);
  padding: var(--sw-space-2) var(--sw-space-3);
  background-color: var(--sw-dark-bg-secondary);
  color: var(--sw-white);
  transition: all var(--sw-transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--sw-brand-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* ===== LINKS ===== */
a {
  color: var(--sw-brand-accent);
  text-decoration: none;
  transition: color var(--sw-transition-fast);
}

a:hover {
  color: var(--sw-brand-primary);
}

/* ===== LISTS ===== */
ul, ol {
  list-style: none;
}

/* ===== IMAGES & MEDIA ===== */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--sw-dark-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--sw-dark-border);
  border-radius: var(--sw-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sw-brand-primary);
}

/* ===== SELECTION ===== */
::selection {
  background-color: var(--sw-brand-primary);
  color: var(--sw-white);
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
  outline: 2px solid var(--sw-brand-primary);
  outline-offset: 2px;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  body {
    padding-top: var(--sw-mobile-safe-area-top);
    padding-bottom: var(--sw-mobile-safe-area-bottom);
    padding-left: var(--sw-mobile-safe-area-left);
    padding-right: var(--sw-mobile-safe-area-right);
  }

  /* Ensure touch targets are at least 44px */
  button,
  input,
  select,
  textarea,
  a {
    min-height: var(--sw-mobile-touch-target);
  }
}

/* ===== UTILITY CLASSES ===== */
.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;
}

.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.pointer-events-none {
  pointer-events: none;
}

.pointer-events-auto {
  pointer-events: auto;
}