/* ============================================================================
   Limitless template engine: engine.css
   ----------------------------------------------------------------------------
   Built on scroll-craft by Nate Herk (github.com/nateherkai/scroll-craft),
   MIT License, copyright (c) 2026 Nate Herk. See LICENSE-scrollcraft.txt in
   this folder. The token layer, the act/cue/pan/parallax/reveal device layer
   and the flow reveal recipe are his; the layered hero, grow, before-after,
   gallery-slide, settle, unblur-words, the sticky call bar and the
   "reduced motion renders complete and static" rule are ours.

   Two layers, and the split matters:
     TOKENS   six colour roles + two fonts. fill.mjs writes these per business
              into a <style data-tokens> block; the engine never changes.
     DEVICES  what engine.js drives. Restyle your own markup, not these.

   Everything continuous animates transform or opacity only (clip-path for the
   before/after wipe, filter once for the un-blur heading). No card, badge or
   pill classes ship here: the family stylesheet owns the composition.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */
:root {
  /* --- the six colour roles (fill.mjs overrides these per business) ------- */
  --canvas:     #f6f5f2;   /* the page ground. Light by default (our refs are light pages). */
  --ink:        #15181c;   /* primary text                                      */
  --muted:      #5b6470;   /* secondary text, tinted toward the ink, never flat grey */
  --accent:     #0b5fa5;   /* ONE accent: the brand hue. Owns the phone button.  */
  --accent-ink: #ffffff;   /* text that sits on the accent                      */
  --line:       color-mix(in oklab, var(--ink) 12%, transparent); /* hairlines  */

  --font-display: "Archivo", system-ui, sans-serif;
  --font-text:    "Geist", system-ui, sans-serif;

  /* --- derived (do not set per business) --------------------------------- */
  --surface:     color-mix(in oklab, var(--canvas) 92%, white);
  --line-strong: color-mix(in oklab, var(--ink) 22%, transparent);
  --accent-soft: color-mix(in oklab, var(--accent) 10%, var(--canvas));
  --accent-deep: color-mix(in oklab, var(--accent) 82%, var(--ink));

  /* scroll-craft aliases so the inherited device layer reads our tokens */
  --sc-canvas: var(--canvas); --sc-surface: var(--surface);
  --sc-ink: var(--ink); --sc-ink-soft: var(--muted);
  --sc-accent: var(--accent); --sc-accent-ink: var(--accent-ink);
  --sc-hairline: var(--line); --sc-hairline-strong: var(--line-strong);
  --sc-font-display: var(--font-display); --sc-font-text: var(--font-text);

  /* fluid type ramp; tracking tightens as size grows (optical correction) */
  --t-xs:   clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --t-sm:   clamp(0.9375rem, 0.9rem + 0.18vw, 1rem);
  --t-base: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --t-lg:   clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --t-xl:   clamp(1.6rem, 1.35rem + 1.2vw, 2.25rem);
  --t-2xl:  clamp(2rem, 1.6rem + 2.2vw, 3.2rem);
  --t-3xl:  clamp(2.5rem, 1.8rem + 3.6vw, 4.5rem);
  --t-4xl:  clamp(2.75rem, 1.7rem + 5.2vw, 6rem);

  --track-tight: -0.03em; --track-snug: -0.018em; --track-normal: -0.004em; --track-wide: 0.08em;
  --leading-none: 0.96; --leading-tight: 1.08; --leading-body: 1.6;
  --measure: 62ch;

  /* 4px space scale */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem; --s-10: 8rem;
  --section: clamp(4rem, 8vw, 9rem);
  --gutter:  clamp(1.25rem, 5vw, 5rem);
  --maxw:    78rem;

  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;

  /* elevation: offset + soft blur, tinted to the ink hue, never a halo */
  --shadow-color: 215 25% 20%;
  --e1: 0 1px 2px hsl(var(--shadow-color) / 0.10), 0 2px 6px -1px hsl(var(--shadow-color) / 0.08);
  --e2: 0 2px 4px hsl(var(--shadow-color) / 0.10), 0 10px 22px -6px hsl(var(--shadow-color) / 0.16);
  --e3: 0 4px 8px hsl(var(--shadow-color) / 0.10), 0 20px 44px -10px hsl(var(--shadow-color) / 0.22);
  --edge: inset 0 1px 0 color-mix(in oklab, white 60%, transparent);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --d-fast: 140ms; --d-base: 220ms; --d-slow: 360ms;
  --d-reveal: 620ms;

  --bar-h: 4rem;
  --z-stage: 1; --z-copy: 20; --z-bar: 100;
}

/* ---------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--bar-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--t-base);
  line-height: var(--leading-body);
  letter-spacing: var(--track-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  overflow-x: clip;
  padding-top: var(--bar-h);
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:root { caret-color: var(--accent); accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
:where(a) { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
@supports (scrollbar-color: auto) {
  html { scrollbar-color: color-mix(in oklab, var(--ink) 26%, transparent) transparent; scrollbar-width: thin; }
}
:where(table, .nums, [data-sc-count], .tel) { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ typography -- */
.display {
  font-family: var(--font-display); font-weight: 600;
  line-height: var(--leading-none); letter-spacing: var(--track-tight);
  text-wrap: balance; margin: 0;
}
.display--xl { font-size: var(--t-4xl); }
.display--lg { font-size: var(--t-3xl); }
.display--md { font-size: var(--t-2xl); letter-spacing: var(--track-snug); }
.display--sm { font-size: var(--t-xl); letter-spacing: var(--track-snug); line-height: var(--leading-tight); }
.lede { font-size: var(--t-lg); line-height: 1.42; letter-spacing: var(--track-snug); max-width: 44ch; margin: 0; }
.body { max-width: var(--measure); color: var(--muted); margin: 0; }
.label { font-size: var(--t-xs); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--muted); font-weight: 600; }
@media (max-width: 700px) {
  /* step the hero down one rung so a phone does not wrap the H1 to six lines */
  .display--xl { font-size: var(--t-3xl); }
  .display--lg { font-size: var(--t-2xl); }
}

/* ---------------------------------------------------------------- layout -- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.stack > * + * { margin-top: var(--s-4); }
.stack > :is(h1, h2, h3) { margin-top: var(--s-7); }
.stack > :is(h1, h2, h3):first-child { margin-top: 0; }
.rule { height: 1px; border: 0; background: var(--line); margin: 0; }

/* buttons: one primary (accent), one quiet. Press feedback is scale, not colour. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 3rem; padding: 0.8em 1.4em; border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 600; font-size: var(--t-sm);
  letter-spacing: var(--track-normal); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--d-fast) var(--ease-out), background-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--e1); }
.btn--primary:hover { background: var(--accent-deep); box-shadow: var(--e2); }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--quiet:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.btn svg { width: 1.1em; height: 1.1em; }

/* =============================================================== THE BAR ==
   The sticky header. Fixed, top, and the highest thing on the page. Nothing
   ever animates over it: every stage, plane and reveal lives under --z-bar.
   Click-to-call is its first control on a phone. */
.bar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar-h); z-index: var(--z-bar);
  display: flex; align-items: center; gap: var(--s-4);
  padding-inline: var(--gutter);
  background: var(--canvas); /* flat and opaque on purpose: fixed chrome never joins a repaint */
  border-bottom: 1px solid var(--line);
}
/* --sc-p registered as a number so calc()/clamp() math on it is clean (wipes, blades, shingles) */
@property --sc-p { syntax: "<number>"; inherits: true; initial-value: 0; }
.bar__brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; min-width: 0; }
.bar__brand img { height: 2.1rem; width: auto; }
.bar__name { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--track-snug); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__nav { display: flex; gap: var(--s-5); margin-inline: auto; }
.bar__nav a { text-decoration: none; font-size: var(--t-sm); color: var(--muted); }
.bar__nav a:hover { color: var(--ink); }
.bar__call { margin-left: auto; }
@media (max-width: 860px) {
  .bar__nav { display: none; }
  .bar__name { max-width: 40vw; }
  .bar__call { padding-inline: 1.1em; }
  .bar__call .btn__label { display: none; } /* the number itself is the label on a phone */
}

/* =============================================================== DEVICES ==
   Driven by engine.js. Inherited from scroll-craft: act, stage, cue, pan,
   parallax, reveal, count, in/stagger. */
.sc-act--pinned { position: relative; }
.sc-stage {
  position: sticky; top: var(--bar-h);
  height: calc(100vh - var(--bar-h)); height: calc(100svh - var(--bar-h));
  overflow: clip; z-index: var(--z-stage);
}
[data-sc-cue] { opacity: 0; will-change: opacity, transform; }
.sc-ready [data-sc-cue] { transition: none; }
[data-sc-pan] { display: flex; will-change: transform; }
[data-sc-reveal] { will-change: clip-path; }
[data-sc-parallax] { will-change: transform; }

/* --- rise: the reveal recipe. 14px, 620ms, ease-out, stagger 30 to 80ms, once. */
[data-sc-in], [data-lm-rise], [data-sc-stagger] > *, [data-lm-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity var(--d-reveal) var(--ease-out), transform var(--d-reveal) var(--ease-out);
}
[data-sc-in].sc-in, [data-lm-rise].sc-in, [data-sc-stagger] > .sc-in, [data-lm-stagger] > .sc-in { opacity: 1; transform: none; }

/* --- settle: a block that eases into place (the booking block). Scale from
   0.975 and a 22px rise, shadow arrives via an opacity layer, once. */
[data-lm-settle] { position: relative; opacity: 0; transform: translate3d(0, 22px, 0) scale(0.975);
  transition: opacity var(--d-reveal) var(--ease-out), transform 700ms var(--ease-out); }
[data-lm-settle]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--e3); opacity: 0; pointer-events: none; z-index: -1;
  transition: opacity 700ms var(--ease-out) 120ms; }
[data-lm-settle].is-settled { opacity: 1; transform: none; }
[data-lm-settle].is-settled::after { opacity: 1; }

/* --- unblur-words: heading words un-blur, once per page. */
[data-lm-unblur] .w { display: inline-block; opacity: 0; filter: blur(6px); transform: translate3d(0, 4px, 0);
  transition: opacity 320ms var(--ease-out), filter 500ms var(--ease-out), transform 500ms var(--ease-out); }
[data-lm-unblur].is-clear .w { opacity: 1; filter: blur(0); transform: none; }
/* coarse pointers: opacity + rise only, no per-word blur repaint on a phone GPU */
.lm-mobile [data-lm-unblur] .w { filter: none; }

/* --- pointer devices (desktop only, seasoning) */
[data-sc-tilt] { transform-style: preserve-3d; will-change: transform; }
[data-sc-magnet] { will-change: transform; }

/* ========================================================= LAYERED HERO ==
   Three planes from three images (far 0.31, mid 0.17, foreground 1.0) with
   the copy at 1x. Planes are absolutely positioned, carry max-width:none and
   never transition transform. The foreground is cut so it dips where the
   copy and the call button sit. A gradient floor hides the clip line. */
.hero {
  position: relative; overflow: clip; isolation: isolate;
  min-height: calc(100svh - var(--bar-h));
  display: grid; align-items: end;
  background: var(--canvas);
}
.hero__plane {
  position: absolute; inset: 0; z-index: 0; overflow: visible; pointer-events: none;
  will-change: transform;
}
.hero__plane img, .hero__plane picture { position: absolute; left: 50%; top: 0; height: 112%; width: auto; max-width: none;
  min-width: 100%; object-fit: cover; transform: translateX(-50%); }
.hero__plane--far { z-index: 0; }   /* rate 0.31 */
.hero__plane--mid { z-index: 1; }   /* rate 0.17 */
.hero__plane--fore { z-index: 3; }  /* the subject, rate 0.20, between mid and front */
/* the FRONT plane: rides with the page (rate 0) and overtakes the subject. A
   shaped solid ground when the family has no cut-out front image. */
.hero__ground { position: absolute; inset: auto 0 -40% 0; height: 74%; z-index: 4; pointer-events: none;
  background: var(--canvas);
  -webkit-mask: radial-gradient(140% 100% at 50% 100%, black 60%, transparent 61%); mask: radial-gradient(140% 100% at 50% 100%, black 60%, transparent 61%); }
.hero__plane--front { z-index: 4; }
.hero__plane--front img { top: auto; bottom: -2%; height: auto; width: 100%; min-width: 0; object-fit: contain; object-position: center bottom; }
.hero__floor { position: absolute; inset: auto 0 0 0; height: clamp(160px, 28vh, 300px); z-index: 4; pointer-events: none;
  background: linear-gradient(to top, var(--canvas) 0%, color-mix(in oklab, var(--canvas) 70%, transparent) 55%, transparent 100%); }
.hero__scrim { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(100deg, color-mix(in oklab, var(--canvas) 92%, transparent) 0%, color-mix(in oklab, var(--canvas) 78%, transparent) 34%, color-mix(in oklab, var(--canvas) 20%, transparent) 58%, transparent 74%); }
.hero__copy { position: relative; z-index: 5; }
@media (max-width: 860px) {
  /* one plane on a phone: the far image holds, mid and fore are not painted */
  .hero__plane--mid, .hero__plane--fore { display: none; }
  .hero__scrim { background: linear-gradient(to top, color-mix(in oklab, var(--canvas) 96%, transparent) 0%, color-mix(in oklab, var(--canvas) 86%, transparent) 42%, color-mix(in oklab, var(--canvas) 30%, transparent) 70%, transparent 100%); }
  .hero__ground { display: none; }
}

/* ================================================================== GROW ==
   A pinned segment whose progress (0..1) drives a drawer: the procedural
   plant / lawn on a canvas, or an image sequence. Final state on phones and
   under reduced motion (the act is not pinned there; the canvas paints p=1). */
[data-lm-grow] canvas, canvas[data-sc-sequence] { width: 100%; height: 100%; display: block; }
.grow__frame { position: absolute; inset: 0; }

/* =========================================================== BEFORE/AFTER ==
   Two images, one clip-path, a labeled handle. Pointer drag, keyboard via
   the range input, or scroll-driven inside a pinned act. */
.ba { position: relative; overflow: hidden; border-radius: var(--r-lg); aspect-ratio: 4 / 3; user-select: none; -webkit-user-select: none; touch-action: pan-y; background: var(--surface); }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.ba__after { clip-path: inset(0 0 0 var(--ba, 50%)); will-change: clip-path; }
.ba__handle { position: absolute; top: 0; bottom: 0; left: var(--ba, 50%); width: 2px; margin-left: -1px; background: var(--accent-ink); box-shadow: 0 0 0 1px color-mix(in oklab, var(--ink) 30%, transparent); pointer-events: none; }
.ba__handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 2.75rem; height: 2.75rem; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--accent); box-shadow: var(--e2); }
.ba__grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; color: var(--accent-ink); pointer-events: none; }
.ba__grip svg { width: 1.4rem; height: 1.4rem; }
.ba__tag { position: absolute; bottom: var(--s-4); padding: 0.35em 0.75em; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; letter-spacing: var(--track-wide); text-transform: uppercase;
  background: color-mix(in oklab, var(--ink) 78%, transparent); color: var(--canvas); pointer-events: none; }
.ba__tag--before { left: var(--s-4); }
.ba__tag--after { right: var(--s-4); }
.ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba__range:focus-visible ~ .ba__handle::after { outline: 3px solid var(--accent-ink); outline-offset: 2px; }

/* ========================================================= GALLERY SLIDE ==
   A horizontal rail that pans across as the page scrolls (pinned pan act),
   against a slower background plane. Items settle in sequence from --sc-p.
   On phones it is a native swipe strip, not a pinned act. */
.rail-act { position: relative; }
.rail-act .sc-stage { display: grid; align-items: center; }
.rail-bg { position: absolute; inset: -10% 0; z-index: 0; pointer-events: none; will-change: transform; }
.rail { position: relative; z-index: 1; gap: clamp(1rem, 2.4vw, 2rem); padding-inline: var(--gutter); align-items: stretch; }
.rail > * { flex: 0 0 auto; }
@media (prefers-reduced-motion: no-preference) and (min-width: 861px) {
  .rail > * { --i: 0; opacity: calc(0.55 + 0.45 * clamp(0, (var(--sc-p, 0) * 6 - var(--i)), 1)); transform: translate3d(0, calc((1 - clamp(0, (var(--sc-p, 0) * 6 - var(--i)), 1)) * 18px), 0); }
  .rail > :first-child { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
  .rail-act .sc-stage { position: static; height: auto; overflow: visible; }
  .rail { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: var(--s-4); transform: none !important; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail > * { scroll-snap-align: center; }
  .rail-bg { display: none; }
}

/* ------------------------------------------------------- reduced motion --
   Everything complete and static. Not fewer and gentler: finished. */
@media (prefers-reduced-motion: reduce) {
  [data-sc-in], [data-lm-rise], [data-sc-stagger] > *, [data-lm-stagger] > *, [data-lm-settle], [data-sc-cue] { opacity: 1 !important; transform: none !important; transition: none !important; }
  [data-lm-settle]::after { opacity: 1; transition: none; }
  [data-lm-unblur] .w { opacity: 1; filter: none; transform: none; transition: none; }
  [data-sc-parallax], [data-sc-pan], .hero__plane, .rail-bg { transform: none !important; }
  [data-sc-reveal] { clip-path: none !important; }
  .sc-act--pinned { height: auto !important; }
  .sc-stage { position: relative; top: auto; height: auto; min-height: 60vh; }
  .rail-act .sc-stage { position: static; height: auto; overflow: visible; }
  .rail { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
  .rail > * { scroll-snap-align: center; opacity: 1; transform: none; }
  .ba__after { transition: none; }
}
/* the engine adds .lm-reduce when the media query is true at mount, so JS-set
   inline styles are also neutralised by the rules above */
