/* Hero film: shared stage (each hero folder carries its own copy). */
:root {
  --bg: #0a0908;
  --ink: #f1ece4;
  --ink-2: rgba(241, 236, 228, 0.74);
  --ink-3: rgba(241, 236, 228, 0.52);
  --amber: #ffa53d;
  --hair: rgba(241, 236, 228, 0.14);
  --edge: clamp(20px, 4.5vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scrollbar-color: rgba(241,236,228,.22) var(--bg); scrollbar-width: thin; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--amber); color: #120c05; }
:focus-visible { outline: 1.5px solid var(--amber); outline-offset: 4px; border-radius: 6px; }
a { color: inherit; text-decoration: none; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- nav: quiet and minimal, but alive ---------- */
.nav {
  --nav-ink: #f5f3ee;
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 40px;
  padding: 22px var(--edge); padding-top: max(22px, env(safe-area-inset-top));
}
/* no bar at any point: the nav floats over the scene, kept readable by a very soft shadow on the words */
.nav { text-shadow: 0 1px 2px rgba(6, 8, 14, 0.35), 0 0 18px rgba(6, 8, 14, 0.45); }
.nav__logo { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; color: var(--nav-ink); }
.nav__logo .nav__dot { margin-top: 8px; }
/* the wordmark, with "Care365" set small and quiet, tucked under "Solar" */
.nav__mark { display: inline-grid; line-height: 1; }
.nav__sub { justify-self: end; margin-top: 4px; font-size: 9.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(245, 243, 238, 0.58); }
.nav__dot { width: 6px; height: 6px; border-radius: 50%; background: #ffb020; box-shadow: 0 0 8px rgba(255, 176, 32, 0.7); animation: nav-breathe 3s ease-in-out infinite; }
@keyframes nav-breathe { 0%, 100% { opacity: 1; box-shadow: 0 0 9px rgba(255, 176, 32, 0.75); } 50% { opacity: 0.45; box-shadow: 0 0 3px rgba(255, 176, 32, 0.3); } }
.nav__links { display: flex; gap: 36px; margin-left: auto; }
.nav__links a { position: relative; font-size: 14.5px; color: rgba(245, 243, 238, 0.6); padding-bottom: 3px; transition: color .25s ease; }
/* the underline slides in from the left, and out to the right */
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--nav-ink); transform: scaleX(0); transform-origin: right; transition: transform .3s cubic-bezier(0.65, 0, 0.35, 1); }
.nav__links a:hover, .nav__links a:focus-visible { color: var(--nav-ink); }
.nav__links a:hover::after, .nav__links a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  text-shadow: none; box-shadow: 0 0 22px rgba(6, 8, 14, 0.25);
  font-size: 14.5px; font-weight: 500; padding: 9px 18px; border-radius: 999px;
  border: 1px solid rgba(245, 243, 238, 0.25); color: var(--nav-ink); background: rgba(245, 243, 238, 0);
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, transform .16s ease;
}
.nav__cta:hover, .nav__cta:focus-visible { background: var(--nav-ink); color: #0b0b0c; border-color: var(--nav-ink); box-shadow: 0 0 24px rgba(255, 176, 32, 0.35); }
.nav__cta:active { transform: scale(.97); }
/* on load: wordmark, links, button, one after another once the scene starts */
.nav__logo, .nav__links a, .nav__cta { opacity: 0; translate: 0 -4px; transition-property: opacity, translate, color, background-color, border-color, box-shadow, transform; }
.is-ready .nav__logo, .is-ready .nav__links a, .is-ready .nav__cta, .no-gl .nav__logo, .no-gl .nav__links a, .no-gl .nav__cta { opacity: 1; translate: 0 0; }
.is-ready .nav__logo { transition: opacity .6s ease 0s, translate .6s ease 0s; }
.is-ready .nav__links a:nth-child(1) { transition: opacity .6s ease .08s, translate .6s ease .08s, color .25s ease; }
.is-ready .nav__links a:nth-child(2) { transition: opacity .6s ease .16s, translate .6s ease .16s, color .25s ease; }
.is-ready .nav__links a:nth-child(3) { transition: opacity .6s ease .24s, translate .6s ease .24s, color .25s ease; }
.is-ready .nav__cta { transition: opacity .6s ease .32s, translate .6s ease .32s, background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, transform .16s ease; }
@media (prefers-reduced-motion: reduce) { .nav__dot { animation: none; } }

/* ---------- the film ---------- */
.hx { position: relative; height: var(--film, 700vh); }
.hx__stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 540px; overflow: hidden; background: #050404; }
.hx__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* keeps the copy column calm, only while the copy is on screen */
.hx__scrim {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, rgba(11,11,12,.6) 0%, rgba(11,11,12,.35) 24%, rgba(11,11,12,.1) 40%, rgba(11,11,12,0) 50%);
  opacity: var(--copy, 1);
}

.hx__copy { position: absolute; z-index: 3; left: var(--edge); top: 50%; transform: translateY(-46%); width: min(42rem, 46vw); will-change: opacity, transform; }
.hx__title { margin: 0; font-weight: 400; font-size: clamp(2.9rem, 6.4vw, 6rem); line-height: 0.98; letter-spacing: -0.038em; text-wrap: balance; }
.hx__title span { display: block; }
.hx__sub { margin: 28px 0 0; max-width: 31rem; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.hx__actions { display: flex; align-items: center; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; line-height: 1; transition: transform .16s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out), box-shadow .3s var(--ease-out); }
.btn--primary { padding: 16px 26px; border-radius: 999px; background: var(--ink); color: #14110d; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.btn--primary:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }
.btn--primary:active { transform: translateY(0) scale(.97); }
.btn--link { padding: 8px 0; }
.btn--link span { transition: transform .3s var(--ease-out); }
.btn--link:hover span { transform: translateX(4px); }
.btn--link:active { transform: scale(.98); }
.hx__trust { margin: 40px 0 0; max-width: 31rem; font-size: 14px; line-height: 1.5; color: var(--ink-3); }

.hx__cue { position: absolute; z-index: 3; left: var(--edge); bottom: 32px; display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
.hx__cue i { width: 1px; height: 28px; background: linear-gradient(var(--ink-3), transparent); transform-origin: top; animation: hx-cue 2.6s var(--ease-out) infinite; }
@keyframes hx-cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* the film fades in once the first frame is drawn */
.hx__canvas { opacity: 0; transition: opacity 1.6s var(--ease-out); }
.is-ready .hx__canvas { opacity: 1; }

/* the page after the hero, in the preview routes */
.hx-next { padding: 120px var(--edge); min-height: 60vh; color: var(--ink-3); border-top: 1px solid var(--hair); font-size: 15px; }

/* no WebGL: the last frame as a still */
.no-gl .hx { height: auto; }
.no-gl .hx__stage { background: #050404 var(--poster, none) center / cover no-repeat; }
.no-gl .hx__cue { display: none; }

/* reduced motion: the final frame, no scroll film */
.is-still .hx { height: auto; }
.is-still .hx__cue { display: none; }

@media (max-width: 820px) {
  .nav { gap: 16px; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: 18px; }
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; padding: 8px 15px; font-size: 14px; }
  .hx__copy { top: max(92px, 12svh); transform: none; width: auto; right: var(--edge); }
  .hx__title { font-size: clamp(2.6rem, 11.5vw, 4rem); }
  .hx__sub { margin-top: 16px; font-size: 16px; }
  .hx__actions { margin-top: 22px; gap: 22px; }
  .btn--primary { padding: 14px 22px; }
  .hx__scrim { background: linear-gradient(180deg, rgba(5,4,4,.86) 0%, rgba(5,4,4,.62) 44%, rgba(5,4,4,0) 64%); }
  .hx__trust { font-size: 13px; margin-top: 20px; }
  .hx__cue { bottom: 20px; }
}
@media (max-height: 680px) and (max-width: 820px) { .hx__sub { display: none; } }
@media (prefers-reduced-motion: reduce) { .hx__cue i { animation: none; } * { scroll-behavior: auto !important; } }

/* the rendered pull-back sits under the live layer; over it the live layer only adds light */
.hx__bake { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; }
.hx__canvas.is-overlay { mix-blend-mode: screen; }

/* phones: every headline starts on the same line, in the middle of the sky between the logo and the hills (the house sits at
   55svh - 22.9vw there; see the cover-fit in film-b.js). Short screens keep it clear of the logo, tall ones of the roof. */
@media (max-width: 819.98px) { :root { --head-m: clamp(92px, calc(27.5svh - 11.4vw - 32px), 200px); } }
