/* ==========================================================================
   HYGIENE HAVEN — base.css  (shared design system; DO NOT edit from section work)
   --------------------------------------------------------------------------
   CONTRACT FOR SECTION AUTHORS
   - Each section lives in partials/NN.html as ONE root element:
       <section id="<anchor>" class="sNN" data-section="NN" aria-labelledby="sNN-title"> … </section>
     Add data-theme="dark" on dark-background sections (nav switches to light text).
   - Section CSS goes in css/sNN.css and every selector MUST be scoped under .sNN
     (keyframes prefixed sNN-). Section JS goes in js/sNN.js as an IIFE using window.HH.
   - Use the tokens below; never hard-code other brand colours.
   - Shared helpers: .container, .eyebrow, .h-display/.h-1/.h-2/.h-3, .lead, .label,
     .btn (+ --lime/--teal/--ghost/--light/--sm), .link-arrow, .chip, .panel,
     [data-reveal], [data-split], [data-magnetic], [data-parallax].
   - Mobile first-class: no horizontal overflow at 375px; every hover interaction
     must also work by tap/click and keyboard focus.
   ========================================================================== */

:root {
  --lime: #C5DE6B;
  --teal: #347F83;
  --white: #FFFFFF;
  --mint: #EAF3E7;
  --pale-lime: #F2F7DE;
  --forest: #203D3D;
  --grey: #F5F7F4;
  --charcoal: #273436;

  --teal-700: #2A676A;
  --teal-300: #8DBBBD;
  --lime-700: #5D7412;          /* accessible lime-toned text on light backgrounds */
  --ink: var(--charcoal);
  --ink-soft: #55676A;
  --line: rgba(39, 52, 54, .12);
  --line-light: rgba(255, 255, 255, .16);

  --font-display: "Bricolage Grotesque", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --fs-display: clamp(2.6rem, 7.2vw, 6.5rem);
  --fs-1: clamp(2.1rem, 5vw, 4.25rem);
  --fs-2: clamp(1.6rem, 3vw, 2.5rem);
  --fs-3: clamp(1.15rem, 1.6vw, 1.4rem);
  --fs-lead: clamp(1.05rem, 1.35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-label: .72rem;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-y: clamp(5rem, 11vw, 10rem);
  --maxw: 1320px;
  --nav-h: 76px;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-pill: 999px;

  --shadow-soft: 0 20px 50px -24px rgba(32, 61, 61, .28);
  --shadow-lift: 0 30px 70px -30px rgba(32, 61, 61, .45);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: .7s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
[data-theme="dark"] :focus-visible { outline-color: var(--lime); }
::selection { background: var(--lime); color: var(--forest); }

.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 200; background: var(--forest); color: #fff; padding: .7rem 1rem; border-radius: var(--r-sm); transition: top .2s; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
main > section { position: relative; }
[data-theme="dark"] { color: var(--white); --ink: #fff; --ink-soft: rgba(255, 255, 255, .72); --line: var(--line-light); }

/* ---------- Type ---------- */
.h-display, .h-1, .h-2, .h-3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.03em; line-height: 1.02; text-wrap: balance; }
.h-display { font-size: var(--fs-display); letter-spacing: -.045em; line-height: .96; }
.h-1 { font-size: var(--fs-1); }
.h-2 { font-size: var(--fs-2); line-height: 1.1; }
.h-3 { font-size: var(--fs-3); line-height: 1.25; letter-spacing: -.015em; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-soft); max-width: 60ch; text-wrap: pretty; }
.label, .eyebrow { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { display: inline-flex; align-items: center; gap: .7rem; color: var(--teal); }
.eyebrow::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(197, 222, 107, .3); }
[data-theme="dark"] .eyebrow { color: var(--lime); }
.accent { color: var(--teal); }
[data-theme="dark"] .accent { color: var(--lime); }
.u-line { background: linear-gradient(var(--lime), var(--lime)) 0 92% / 0 .14em no-repeat; transition: background-size 1s var(--ease-out) .3s; }
.is-in .u-line, .u-line.is-in { background-size: 100% .14em; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--forest); --fg: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
  min-height: 52px; padding: .85rem 1.6rem; border-radius: var(--r-pill);
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: .95rem; letter-spacing: -.005em;
  border: 1px solid transparent; overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease-out), box-shadow .4s, color .3s, border-color .3s;
  will-change: transform;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hover-bg, var(--teal)); border-radius: inherit; transform: translateY(101%); transition: transform .5s var(--ease-out); }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn svg { width: 18px; height: 18px; transition: transform .4s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn--lime { --bg: var(--lime); --fg: var(--forest); --hover-bg: #fff; }
.btn--teal { --bg: var(--teal); --fg: #fff; --hover-bg: var(--forest); }
.btn--light { --bg: #fff; --fg: var(--forest); --hover-bg: var(--lime); }
.btn--ghost { --bg: transparent; --fg: currentColor; border-color: currentColor; --hover-bg: var(--lime); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--forest); border-color: var(--lime); }
.btn--sm { min-height: 44px; padding: .55rem 1.15rem; font-size: .875rem; }

.link-arrow { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; padding-block: .35rem; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: gap .4s var(--ease-out); }
.link-arrow svg { width: 18px; height: 18px; }
.link-arrow:hover { gap: .95rem; }

.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--fs-small); font-weight: 500; background: rgba(255, 255, 255, .6); }
[data-theme="dark"] .chip { background: rgba(255, 255, 255, .06); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-soft); }

/* ---------- Reveal system (core.js adds .is-in) ---------- */
[data-reveal] { transition: opacity var(--dur) var(--ease-out), transform 1s var(--ease-out), clip-path 1.1s var(--ease-out), filter .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
[data-reveal="up"] { opacity: 0; transform: translateY(36px); }
[data-reveal="left"] { opacity: 0; transform: translateX(-48px); }
[data-reveal="right"] { opacity: 0; transform: translateX(48px); }
[data-reveal="scale"] { opacity: 0; transform: scale(.92); }
[data-reveal="blur"] { opacity: 0; filter: blur(14px); }
[data-reveal="clip"] { clip-path: inset(0 0 100% 0); }
[data-reveal="clip-x"] { clip-path: inset(0 100% 0 0); }
[data-reveal="circle"] { clip-path: circle(0% at 50% 50%); }
[data-reveal].is-in { opacity: 1; transform: none; filter: none; clip-path: inset(0 0 0 0); }
[data-reveal="circle"].is-in { clip-path: circle(75% at 50% 50%); }

/* Split text: core.js wraps words -> <span class="w"><span class="wi">word</span></span> */
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .12em; margin-bottom: -.12em; }
[data-split] .wi { display: inline-block; transform: translateY(110%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--wi) * 55ms + var(--delay, 0ms)); }
[data-split].is-in .wi { transform: none; }

/* ---------- Scroll progress ---------- */
.scroll-bar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120; pointer-events: none; }
.scroll-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--lime)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h); display: flex; align-items: center; gap: 1.5rem; padding-inline: var(--gutter); color: var(--forest); transition: background .4s, color .4s, transform .5s var(--ease-out), box-shadow .4s, height .4s; }
.nav.is-scrolled { background: rgba(255, 255, 255, .82); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 1px 0 var(--line); height: 64px; }
.nav.is-dark { color: #fff; }
.nav.is-dark.is-scrolled { background: rgba(32, 61, 61, .78); box-shadow: 0 1px 0 var(--line-light); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__brand { display: inline-flex; align-items: center; gap: .65rem; font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; font-size: 1.02rem; color: var(--lime-700); white-space: nowrap; }
.nav.is-dark .nav__brand { color: var(--lime); }
.nav__brand img { width: 40px; height: 40px; transition: transform 1.2s var(--ease-out); }
.nav__brand:hover img { transform: rotate(180deg); }
.nav__links { display: flex; gap: clamp(.9rem, 1.6vw, 1.7rem); margin-left: auto; font-size: .9rem; font-weight: 500; }
.nav__links a { position: relative; padding-block: .5rem; opacity: .82; transition: opacity .3s; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 2px; background: var(--lime); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .45s var(--ease-out); }
.nav__links a:hover, .nav__links a.is-active { opacity: 1; }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav__cta-mobile, .nav__toggle { display: none; }
.nav__toggle { width: 44px; height: 44px; margin-left: auto; position: relative; z-index: 2; }
.nav__toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease-out), top .4s var(--ease-out); }
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

@media (max-width: 1100px) {
  .nav__cta { display: none; }
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; inset: 0; margin: 0; padding: calc(var(--nav-h) + 1.5rem) var(--gutter) 2rem;
    flex-direction: column; gap: 0; background: var(--forest); color: #fff;
    font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 600; letter-spacing: -.02em;
    clip-path: circle(0% at calc(100% - 2.5rem) 2.4rem); visibility: hidden; overflow-y: auto;
    transition: clip-path .7s var(--ease-in-out), visibility 0s .7s;
  }
  .nav__links a { padding-block: .7rem; border-bottom: 1px solid var(--line-light); opacity: 1; }
  .nav__links a::after { display: none; }
  .nav__links .nav__cta-mobile { display: block; margin-top: 1.5rem; border: 0; color: var(--lime); }
  .nav.is-open .nav__links { clip-path: circle(150% at calc(100% - 2.5rem) 2.4rem); visibility: visible; transition-delay: 0s; }
  .nav.is-open { color: #fff; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav.is-open .nav__brand { color: var(--lime); position: relative; z-index: 2; }
}

/* ---------- Shared keyframes ---------- */
@keyframes hh-spin { to { transform: rotate(360deg); } }
@keyframes hh-spin-rev { to { transform: rotate(-360deg); } }
@keyframes hh-pulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: .5; } }
@keyframes hh-ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes hh-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes hh-dash { to { stroke-dashoffset: 0; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  [data-reveal], [data-split] .wi { opacity: 1 !important; transform: none !important; clip-path: none !important; filter: none !important; }
}
