/* =================================================================
   RESET & BASE
   ================================================================= */

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

* {
  margin: 0;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--sw-text);
  background: var(--sw-canvas);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Focus visibility (accessibility) ---- */
:focus-visible {
  outline: 3px solid var(--sw-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Skip link ---- */
.sw-skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--sw-ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--sw-radius-sm);
  z-index: 200;
  font-weight: 600;
  transition: top 0.15s ease;
}

.sw-skip-link:focus {
  top: 1rem;
}

/* ---- Container ---- */
.sw-container {
  width: 100%;
  max-width: var(--sw-container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 400px) {
  .sw-container {
    padding: 0 1rem;
  }
}

/* ---- Visually hidden (screen-reader only) ---- */
.sw-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;
}

/* ---- Section rhythm ---- */
.sw-section {
  padding: var(--sw-space-2xl) 0;
}

@media (max-width: 768px) {
  .sw-section {
    padding: var(--sw-space-xl) 0;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
