/* ============================================================
   Base — reset, typography, utilities
   ============================================================ */

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

* {
  margin: 0;
}

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

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

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

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

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

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.2rem + 3.4vw, 3.4rem);
}
h2 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.3rem);
}
h3 {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.35rem);
}

p {
  text-wrap: pretty;
}

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

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

/* Smooth theme transitions */
body,
.site-header,
.site-footer,
.card,
.admin-card,
.admin-sidebar,
.admin-topbar,
.stat-card,
.table-wrap,
.gallery-item,
.lightbox-content,
input,
textarea,
select,
.btn,
.badge,
.filter-chip,
.toast {
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

/* ---------- Utilities ---------- */

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 300;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  transition: top 0.2s ease;
}

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

.text-muted {
  color: var(--text-2);
}
.text-center {
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section {
  padding: clamp(48px, 6vw, 84px) 0;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.section-head .kicker {
  margin-bottom: 14px;
}

.section-copy {
  color: var(--text-2);
  max-width: 52ch;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
