/* Reset + typography + utilities shared everywhere. */

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

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "kern";
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease), opacity .2s;
}

body.is-leaving { opacity: 0; }

/* ---------- CROSS-DOCUMENT VIEW TRANSITIONS ----------
   Chrome 126+ / Safari 18+ auto-crossfade between pages on same-origin nav.
   Older browsers fall back to the JS loader system below. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .32s;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- PAGE LOADER OVERLAY ----------
   Shown briefly while the browser is navigating to an internal link.
   Hidden by default; scroll.js toggles .is-on when a link is clicked. */
.wc-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  /* Fade OUT slowly, but APPEAR instantly (override below) */
  transition: opacity .35s var(--ease) .05s, visibility 0s linear .4s;
}
.wc-loader.is-on,
html.wc-is-loading .wc-loader {
  opacity: 1;
  visibility: visible;
  transition: none;
}
.wc-loader-inner {
  text-align: center;
  transform: translateY(-4px);
}
.wc-loader-mark {
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 54px);
  color: var(--green-700);
  margin-bottom: 24px;
  letter-spacing: .005em;
  line-height: 1;
  opacity: 0.92;
}
.wc-loader-bar {
  width: 180px;
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  border-radius: 2px;
}
.wc-loader-bar::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 45%; left: -45%;
  background: var(--green-700);
  border-radius: 2px;
  animation: wc-loader-slide 1.1s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes wc-loader-slide {
  0%   { left: -45%; }
  50%  { left: 55%; }
  100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .wc-loader-bar::after {
    animation: none;
    width: 100%;
    left: 0;
  }
}

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--green-700); }

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

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

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection {
  background: var(--green-100);
  color: var(--green-900);
}

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--cream);
  z-index: 200;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 20px; }

/* Visually hidden (a11y) */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Icon sprite defaults */
.wc-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Scroll progress bar (fixed at top of every page) */
.scrollbar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--pink);
  z-index: 100;
  transition: width .1s linear;
}

/* Reduced motion */
@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;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
