/* ==========================================================================
   Base Reset, Typography, Layout Primitives & Motion
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--scale-body);
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  font-family: var(--font-heading);
  color: var(--text-heading);
  font-weight: 400;
}

h1 {
  letter-spacing: -0.02em;
  line-height: 1.12;
}

h2 {
  letter-spacing: -0.015em;
  line-height: 1.18;
}

h3,
h4 {
  letter-spacing: -0.01em;
  line-height: 1.28;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

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

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

img {
  height: auto;
  border-radius: var(--radius-media);
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--color-primary-hover);
}

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

ul {
  margin-top: 0;
  margin-bottom: 1rem;
}

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

.skip-link {
  position: fixed;
  top: -100%;
  left: 0.75rem;
  z-index: 1100;
  background: var(--bg-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-btn);
  padding: 0.6rem 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-nav);
}

.skip-link:focus-visible {
  top: 0.75rem;
}

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

@media (min-width: 768px) {
  .container {
    padding-inline: 2rem;
  }
}

/* Sections */
.section {
  position: relative;
  scroll-margin-top: 5.5rem;
}

.section--tint {
  background-color: var(--bg-surface);
}

.section--white {
  background-color: var(--bg-white);
}

.section--dark {
  background-color: var(--bg-dark);
  color: var(--color-white);
}

.section--top {
  padding-top: var(--space-section-top);
}

.section--padded {
  padding-block: var(--space-section-y);
}

.section--top.section--padded {
  padding-top: var(--space-section-top);
}

.section--compact-top {
  padding-top: 1.5rem;
}

.section--compact-bottom {
  padding-bottom: 1rem;
}

/* Inline SVG Icon Primitive */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex-shrink: 0;
  fill: currentColor;
}

/* Motion & Scroll Reveal */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .scroll-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.35s ease, transform 0.35s ease;
  }

  .scroll-reveal.is-revealed {
    opacity: 1;
    transform: none;
  }
}

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

  .gallery-trigger:hover img,
  .gallery-trigger:focus-visible img {
    transform: none;
  }
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .site-header,
  .scroll-top-btn,
  .theme-switch,
  .skip-link {
    display: none !important;
  }

  .section--top {
    padding-top: 0 !important;
  }
}
