/* Base Styles - Reset & Typography */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-7xl);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--font-size-6xl);
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--font-size-4xl);
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--font-size-3xl);
}

h5 {
  font-size: var(--font-size-2xl);
}

h6 {
  font-size: var(--font-size-xl);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

em {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background-color: var(--color-bg-elevated);
  border-radius: var(--border-radius-sm);
  color: var(--color-accent-primary);
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
}

li {
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

/* Images */
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form elements */
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

/* Utility classes */
.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;
}

.no-scroll {
  overflow: hidden;
}

/* Selection */
::selection {
  background-color: var(--color-accent-primary);
  color: var(--color-bg-primary);
}

/* Scrollbar styling (webkit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-border-bright);
  border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-primary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-bright) var(--color-bg-secondary);
}

/* 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;
  }
  
  html {
    scroll-behavior: auto;
  }
}
