/* ============================================
   BASE STYLES & RESET
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  min-height: 100vh;
  overflow-x: hidden !important;
  width: 100vw;
  overflow-y: auto;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

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

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--border-radius-sm);
}

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

/* Forms */
input,
textarea,
select {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

button {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  cursor: pointer;
  border: none;
  background: none;
}

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

li {
  margin-bottom: var(--space-sm);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-xl);
}

th,
td {
  padding: var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

th {
  background: var(--bg-secondary);
  font-weight: var(--font-weight-semibold);
}

/* Code */
code,
pre {
  font-family: var(--font-family-mono);
  background: var(--bg-secondary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
}

/* HR */
hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-3xl) 0;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive images in containers */
.image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  background: var(--bg-secondary);
}

.image-container img {
  display: block;
  width: 100%;
  height: auto;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: white;
  padding: var(--space-lg);
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}
