/* ============================================
   BASE — Reset, Typography, Global Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ─── Skip to Content (Accessibility) ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--accent-teal);
  color: white;
  font-weight: var(--weight-semibold);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: var(--z-max);
  transition: top var(--duration-normal) var(--ease-out);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ─── Scroll Progress Bar ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-amber));
  z-index: var(--z-max);
  transition: width 50ms linear;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

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

p {
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

a:hover {
  color: var(--accent-teal-hover);
}

strong, b {
  font-weight: var(--weight-semibold);
}

/* ─── Focus Visible ─── */
:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ─── Selection ─── */
::selection {
  background: var(--accent-teal-light);
  color: var(--text-primary);
}

/* ─── Images & Media ─── */
img, svg {
  display: block;
  max-width: 100%;
}

/* ─── Lists ─── */
ul, ol {
  list-style: none;
}

/* ─── Forms Base ─── */
input, textarea, select, button {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

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

/* ─── Utility Classes ─── */
.text-gradient {
  background: linear-gradient(135deg, var(--accent-teal), #22D3EE, var(--accent-amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── 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;
  }

  .scroll-progress {
    display: none;
  }
}
