/**
 * Base Styles
 * 
 * Contains CSS reset, typography, and base element styles.
 * This file should be loaded after variables.css and theme.css.
 */

/********************************
 * CSS Reset
 ********************************/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/********************************
 * Typography
 ********************************/
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

@media (max-width: 768px) {
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
  h4 { font-size: var(--font-size-xl); }
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-700);
}

a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/********************************
 * Lists
 ********************************/
ul, ol {
  list-style: none;
}

/********************************
 * Images & Media
 ********************************/
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/********************************
 * Forms
 ********************************/
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

/********************************
 * Tables
 ********************************/
table {
  border-collapse: collapse;
  width: 100%;
}

/********************************
 * Hidden & Accessibility
 ********************************/
.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;
}

.hidden {
  display: none !important;
}

/********************************
 * Selection
 ********************************/
::selection {
  background-color: var(--primary-200);
  color: var(--primary-900);
}

/********************************
 * Scrollbar Styling
 ********************************/
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-500);
}

/********************************
 * Focus Styles
 ********************************/
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}