/**
 * CSS Reset & Base Styles
 * Modern, minimal reset for consistent baseline
 * 
 * @version 1.0.0
 */

/* ========================================
   Box Sizing & Reset
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========================================
   Root & HTML
   ======================================== */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ========================================
   Body
   ======================================== */

body {
  min-height: 100vh;
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  background: var(--color-bg-primary);
  overflow-x: hidden;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition-colors);
}

a:hover {
  color: var(--color-accent-light);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

strong, b {
  font-weight: var(--font-bold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

/* ========================================
   Lists
   ======================================== */

ul, ol {
  list-style-position: inside;
  margin-bottom: var(--space-4);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: var(--space-2);
}

/* Remove list styles for navigation */
nav ul,
nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav li {
  margin: 0;
}

/* ========================================
   Media Elements
   ======================================== */

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
}

svg {
  fill: currentColor;
}

/* ========================================
   Forms
   ======================================== */

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

textarea {
  resize: vertical;
}

/* ========================================
   Tables
   ======================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

th,
td {
  padding: var(--space-3);
  text-align: left;
}

th {
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

/* ========================================
   Utility Classes
   ======================================== */

/* Screen Reader Only */
.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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  z-index: var(--z-above-all);
  padding: var(--space-4);
  background: var(--color-accent);
  color: white;
  font-weight: var(--font-semibold);
}

.skip-link:focus {
  top: 0;
}

/* ========================================
   Selection
   ======================================== */

::selection {
  background: var(--color-accent);
  color: white;
  text-shadow: none;
}

::-moz-selection {
  background: var(--color-accent);
  color: white;
  text-shadow: none;
}

/* ========================================
   Scrollbar (Webkit)
   ======================================== */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface-elevated);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* ========================================
   Focus Visible
   ======================================== */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Remove outline for mouse users */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

/* ========================================
   Reduced Motion
   ======================================== */

@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;
  }
}
