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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern', 'liga', 'calt';
  scroll-behavior: smooth;
}

body {
  background: var(--color-chalk);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

/* Gentle animated gradient backdrop — Mediterranean-tinted, barely-there.
   Sits behind all content. */
body::before {
  content: '';
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 25%, rgba(0,165,234, 0.10), transparent 60%),
    radial-gradient(ellipse 55% 45% at 78% 70%, rgba(0,165,234, 0.085), transparent 60%),
    radial-gradient(ellipse 50% 40% at 55% 90%, rgba(44,125,168, 0.055), transparent 65%),
    radial-gradient(ellipse 70% 55% at 90% 15%, rgba(71,185,238, 0.06), transparent 65%);
  filter: blur(60px) saturate(105%);
  animation: mcBgDrift 44s ease-in-out infinite alternate;
  will-change: transform;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(17,46,69, 0.04) 1px, transparent 0);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
  opacity: 0.4;
}

@keyframes mcBgDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  33%  { transform: translate3d(2%, -1.5%, 0) scale(1.02); }
  66%  { transform: translate3d(-1.5%, 2%, 0) scale(1.015); }
  100% { transform: translate3d(1.5%, 1%, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  text-wrap: balance;
  color: inherit;
}

p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; transition: color var(--d-base) var(--ease-out); }
a:hover { color: var(--color-brass); }

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

button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }

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

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

::selection { background: var(--color-aegean); color: var(--color-chalk); }

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

.tabular { font-variant-numeric: tabular-nums; }

.small-caps {
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-driftwood);
}

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

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 900ms var(--ease-out),
    transform 900ms var(--ease-out);
}
.reveal.is-revealed {
  opacity: 1;
  transform: none;
}
.reveal--stagger-1 { transition-delay: 80ms; }
.reveal--stagger-2 { transition-delay: 160ms; }
.reveal--stagger-3 { transition-delay: 240ms; }
.reveal--stagger-4 { transition-delay: 320ms; }

@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;
  }
  .reveal { opacity: 1; transform: none; }
}
