/* ============================================
   Base Styles — CORE
   Foundational CSS for all projects
   ============================================ */

/* ===== Reset ===== */

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

/* ===== HTML & Body ===== */

html {
  font-size: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

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

body.menu-open {
  overflow: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  letter-spacing: var(--letter-spacing-h1);
}

h2 {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-h2);
}

h3 {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-h3);
}

h4 {
  font-size: var(--font-size-h4);
  line-height: var(--line-height-h4);
}

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

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--easing-ease-out);
}

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

a:focus-visible {
  outline: 2px solid var(--interactive-focus);
  outline-offset: 2px;
}

/* Remove outline for mouse users */
a:focus:not(:focus-visible) {
  outline: none;
}

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

/* ===== Images & Media ===== */

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

img {
  border-style: none;
}

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

ul, ol {
  list-style: none;
}

/* ===== Buttons ===== */

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

button:focus-visible {
  outline: 2px solid var(--interactive-focus);
  outline-offset: 2px;
}

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

/* ===== Focus Visible (Accessibility) ===== */

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

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

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

::selection {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

/* ===== Reduced Motion (Accessibility) ===== */

@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;
  }
}

/* ===== Screen Reader Only (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-width: 0;
}

/* ===== Skip Link (Accessibility) ===== */

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--space-4);
  background-color: var(--accent-primary);
  color: var(--bg-primary);
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform var(--duration-fast) var(--easing-ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}
