/* Wild Vibes — reset, element defaults, layout primitives, section shells. */

/* ------------------------------------------------------------------ */
/* 1. Reset                                                            */
/* ------------------------------------------------------------------ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h-stuck) + var(--sp-5));
  -moz-tab-size: 2;
  tab-size: 2;
}

body {
  min-height: 100svh;
  background: var(--wv-paper);
  color: var(--wv-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Media */
img, picture, svg, video, canvas, iframe {
  display: block;
  max-width: 100%;
}
img, video { height: auto; }
svg { fill: currentColor; }

/* Forms inherit type */
input, button, textarea, select, optgroup {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { background: none; border: 0; padding: 0; cursor: pointer; }
textarea { resize: vertical; }

/* Sensible wrapping */
p, li, h1, h2, h3, h4, h5, h6, dt, dd, figcaption, blockquote, caption, label, summary {
  overflow-wrap: break-word;
}
h1, h2, h3, h4 { text-wrap: balance; }
p, li, figcaption { text-wrap: pretty; }

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

table { border-collapse: collapse; border-spacing: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--ctx-line);
  margin-block: var(--sp-6);
}

/* ------------------------------------------------------------------ */
/* 2. Typography                                                       */
/* ------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-head);
  letter-spacing: var(--ls-head);
  color: var(--ctx-head);
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5, h6 {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ctx-muted);
}

/* Heading rhythm — space above, tight below. Owl-safe. */
h2 + p, h3 + p, h4 + p, h2 + ul, h3 + ul { margin-top: var(--sp-3); }
p + h2, ul + h2, ol + h2, figure + h2, div + h2 { margin-top: var(--sp-7); }
p + h3, ul + h3, ol + h3, figure + h3, div + h3 { margin-top: var(--sp-6); }
p + p, p + ul, ul + p, p + ol, ol + p { margin-top: var(--sp-4); }

em, i { font-style: italic; }
strong, b { font-weight: var(--fw-bold); color: var(--ctx-fg); }

small { font-size: var(--fs-small); }

/* Body prose helper — pages may drop it on any wrapper of running text. */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--sp-4); }
.prose p { color: var(--ctx-fg); }
.prose a { text-underline-offset: 3px; }

.lead { font-size: var(--fs-lead); line-height: var(--lh-snug); color: var(--ctx-muted); }
.muted { color: var(--ctx-muted); }
.tabular { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); }
.script { font-weight: 500; letter-spacing: -0.01em; }

::selection {
  background: var(--wv-lime);
  color: var(--wv-forest-dk);
}

/* ------------------------------------------------------------------ */
/* 3. Links                                                            */
/* ------------------------------------------------------------------ */

a {
  color: var(--ctx-link);
  text-decoration-color: color-mix(in srgb, currentColor 34%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur-1) var(--ease-out),
              text-decoration-color var(--dur-1) var(--ease-out);
}
a:hover { text-decoration-color: currentColor; }
a:where(:not([class])):hover { color: var(--wv-forest-dk); }

/* ------------------------------------------------------------------ */
/* 4. Focus                                                            */
/* ------------------------------------------------------------------ */

:focus { outline: none; }

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

/* On dark grounds the olive ring disappears — flip it to lime. */
.sec--forest :focus-visible,
.site-foot :focus-visible,
.lightbox :focus-visible,
[data-ground="dark"] :focus-visible {
  outline-color: var(--wv-lime);
}

/* ------------------------------------------------------------------ */
/* 5. Skip link                                                        */
/* ------------------------------------------------------------------ */

.skip {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-skip);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--wv-forest-dk);
  color: var(--wv-mist);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
  box-shadow: var(--sh-2);
  transform: translateY(-320%);
  transition: transform var(--dur-2) var(--ease-spring);
}
.skip:focus-visible {
  transform: translateY(0);
  outline-color: var(--wv-lime);
}

/* Screen-reader-only utility */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ */
/* 6. Containers                                                       */
/* ------------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--wrap-pad) * 2);
  margin-inline: auto;
  padding-inline: var(--wrap-pad);
}

.wrap--narrow { max-width: calc(var(--wrap-narrow) + var(--wrap-pad) * 2); }
.wrap--wide   { max-width: calc(var(--wrap-wide) + var(--wrap-pad) * 2); }
.wrap--flush  { padding-inline: 0; }

/* Escape hatch: bleed a child to the full viewport inside a .wrap. */
.bleed {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

/* ------------------------------------------------------------------ */
/* 7. Sections                                                         */
/* ------------------------------------------------------------------ */

.sec {
  position: relative;
  isolation: isolate;
  padding-block: var(--sec-y);
  background: var(--ctx-bg);
  color: var(--ctx-fg);
  overflow: clip;      /* keeps corner doodles from causing scroll */
}

.sec--tight { padding-block: var(--sec-y-sm); }
.sec--tall  { padding-block: var(--sec-y-lg); }
.sec--flush-top    { padding-top: 0; }
.sec--flush-bottom { padding-bottom: 0; }

/* --- grounds ------------------------------------------------------ */

.sec--paper {
  --ctx-bg: var(--wv-paper);
  --ctx-card: var(--wv-paper);
  --ctx-card-2: var(--wv-paper-warm);
}

.sec--warm {
  --ctx-bg: var(--wv-paper-warm);
  --ctx-card: var(--wv-paper);
  --ctx-card-2: #FFFFFF;
}

.sec--forest {
  --ctx-bg: var(--wv-forest-dk);
  --ctx-fg: var(--wv-mist);
  --ctx-muted: var(--wv-mist-soft);
  --ctx-line: var(--wv-line-dark);
  --ctx-head: var(--wv-mist);
  --ctx-accent: var(--wv-lime);
  --ctx-doodle: var(--wv-lime);
  --ctx-card: var(--wv-forest-mid);
  --ctx-card-2: #374C0D;
  --ctx-link: var(--wv-lime);
  --ctx-shadow: none;
}

.sec--lime {
  --ctx-bg: var(--wv-lime);
  --ctx-fg: var(--wv-ink);
  --ctx-muted: #3E4B24;
  --ctx-line: #A9CB63;
  --ctx-head: var(--wv-forest-dk);
  --ctx-accent: var(--wv-forest-dk);
  --ctx-doodle: var(--wv-forest-dk);
  --ctx-card: #FFFFFF;
  --ctx-card-2: var(--wv-lime-soft);
  --ctx-link: var(--wv-forest-dk);
}

.sec--soft {
  --ctx-bg: var(--wv-lime-soft);
  --ctx-fg: var(--wv-ink);
  --ctx-muted: #4A5730;
  --ctx-line: #C7DFA0;
  --ctx-head: var(--wv-forest-dk);
  --ctx-accent: var(--wv-forest);
  --ctx-doodle: var(--wv-forest);
  --ctx-card: #FFFFFF;
  --ctx-card-2: #FFFFFF;
}

/* --- section head ------------------------------------------------- */

.sec__head {
  max-width: 46rem;
  margin-bottom: clamp(1.75rem, 1.1rem + 2.6vw, 3.25rem);
}
.sec__head--center {
  margin-inline: auto;
  text-align: center;
}
.sec__head--center .kicker { justify-content: center; }
.sec__head--wide { max-width: none; }

.sec__title {
  font-size: var(--fs-h2);
  color: var(--ctx-head);
}

.sec__lede {
  margin-top: var(--sp-4);
  max-width: var(--measure);
  font-size: var(--fs-lead);
  line-height: var(--lh-snug);
  color: var(--ctx-muted);
}
.sec__head--center .sec__lede { margin-inline: auto; }

/* --- kicker ------------------------------------------------------- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ctx-accent);
}
.kicker::before {
  content: "";
  width: 1.9rem;
  height: 3px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--wv-lime);
}
.sec--lime .kicker::before,
.sec--soft .kicker::before { background: var(--wv-forest-dk); }

.kicker--plain::before { display: none; }

/* ------------------------------------------------------------------ */
/* 8. Reduced motion                                                   */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}


/* A .doodle sits at --z-doodle (1); a plain .wrap creates no stacking context,
   so corner doodles paint over headings at narrow widths. Lift the content. */
.sec > .wrap,
.hero > .wrap,
.sec > .wrap--narrow,
.sec > .wrap--wide { position: relative; z-index: var(--z-raised); }
