/* ============================================
   Reset & Base Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  color: var(--color-heading);
}

strong {
  font-weight: 600;
  color: var(--color-heading);
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ============================================
   Code
   ============================================ */

code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--color-code-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  line-height: 1.5;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* ============================================
   Images
   ============================================ */

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

/* ============================================
   Lists
   ============================================ */

ul, ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

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

/* ============================================
   Accessibility
   ============================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-size: var(--text-sm);
}

.skip-link:focus {
  top: var(--space-md);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================
   Selection
   ============================================ */

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* ============================================
   Scrollbar (subtle)
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-surface);
  border-radius: 4px;
}

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