/* ============================================================
   BASE STYLES
   CSS reset, box-sizing, body defaults, smooth scroll,
   selection color, and global typography baseline.
============================================================ */

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

/* --- Root --- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* --- Body --- */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Selection --- */
::selection {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

/* --- Images --- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

p {
  line-height: var(--line-height-relaxed);
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* --- Layout utility --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--section-padding-x);
}

/* --- Section baseline --- */
section {
  padding-block: var(--section-padding-y);
}

/* --- Scroll fade-in animation --- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Visually 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-width: 0;
}

/* --- Skip navigation link --- */
.skip-nav {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 999;
  background-color: var(--color-accent);
  color: var(--color-bg);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}

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

/* --- Focus-visible styles (keyboard navigation) --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--border-radius-sm);
}

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