/* Home: act 1 (layered hero) and act 2 (dusk statement). Tokens come from site.css. */

.only-phone { display: none; }
.only-desk-img, .only-phone-img { display: block; }
.only-phone-img { display: none; }

/* ============================================================ act 1: hero == */
.hero { position: relative; }
.hero__stage {
  position: relative; isolation: isolate; overflow: clip;
  height: 100vh; height: 100svh; min-height: 640px;
  /* sky colours: shows only for the instant before the poster decodes */
  background: linear-gradient(#8fb8e6 0%, #cddff0 46%, #f3e2bd 64%, #cfc59a 100%);
}
.hero__poster, .hero__planes { position: absolute; inset: 0; }
.hero__poster > div { position: absolute; inset: 0; }
.hero__poster { transition: opacity 0.6s 0.1s ease-out; }

/* Every image layer shares one geometry (24px of overscan on each side, bottom anchored), so the
   poster and the planes register exactly and the pointer shift never exposes an edge. */
.hero__img {
  position: absolute; left: -24px; top: -24px;
  width: calc(100% + 48px); height: calc(108% + 24px); max-width: none;
  object-fit: cover; object-position: 50% 0;
}

.hero__planes { opacity: 0; transition: opacity 0.6s ease-out; pointer-events: none; }
.hero.is-ready .hero__planes { opacity: 1; }
.hero.is-ready .hero__poster { opacity: 0; }

.plane { position: absolute; inset: 0; max-width: none; transition: opacity 0.3s ease-out; }
.plane__inner { position: absolute; inset: 0; will-change: transform; }

/* The product pair stands on a sunlit ledge along the bottom of the hero, in front of the neighbourhood.
   Ledge and products share one plane (one parallax rate), so the contact never separates. */
.hero { --ledge: clamp(64px, 11vh, 112px); --line: calc(var(--ledge) * 0.5); }
.prod-ground {
  position: absolute; left: 0; right: 0; bottom: -40px; height: calc(var(--ledge) + 40px);
  background:
    radial-gradient(ellipse 46% 120% at 78% 0%, rgb(247 199 122 / 0.34), transparent 70%),
    linear-gradient(to bottom, #FBF8EF 0%, #F3EDDD 55%, #E6DEC9 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 -1px 0 rgb(var(--shade) / 0.1), 0 -14px 26px -10px rgb(var(--shade) / 0.3);
}
.prod { position: absolute; isolation: isolate; }
.hero__product {
  display: block; width: 100%; height: auto; max-width: none;
  filter: drop-shadow(0 4px 8px rgb(33 67 127 / 0.2));
}
/* contact shadow: a soft blurred ellipse plus a tight dark core right at the base (sun is on the right, so it leans left) */
.prod__shadow {
  position: absolute; z-index: -1; left: -10%; right: 2%; bottom: -5%; height: 11%;
  background: radial-gradient(closest-side, rgb(24 34 56 / 0.5), rgb(24 34 56 / 0.2) 60%, transparent);
  filter: blur(5px);
}
.prod::before {
  content: ""; position: absolute; z-index: -1; left: 2%; right: 4%; bottom: -1%; height: 3%;
  border-radius: 50%; background: rgb(14 22 40 / 0.62); filter: blur(1.5px);
}
/* Scene light on the cut-outs: the sun is low on the right, so the right edge warms, the left cools,
   and the base picks up a little shade. Masked to the product's own silhouette. */
.prod::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  -webkit-mask: var(--silhouette) center / 100% 100% no-repeat; mask: var(--silhouette) center / 100% 100% no-repeat;
  background:
    linear-gradient(100deg, rgb(190 203 224) 0%, rgb(243 241 237) 42%, rgb(255 236 200) 100%),
    linear-gradient(to bottom, #fff 0%, #fff 62%, rgb(184 192 182) 100%);
  background-blend-mode: multiply;
}
.prod--inv { --silhouette: url(/assets/img/p-hybrid-1ph-400.webp); }
.prod--bat { --silhouette: url(/assets/img/p-battery-cq-400.webp); }
.prod--inv { left: 66%; bottom: var(--line); width: 10vw; }
.prod--bat { left: 79%; bottom: var(--line); width: 11.5vw; }

/* the foreground leaves trail off before they reach the copy */
.plane--fore .hero__img {
  -webkit-mask-image: linear-gradient(to bottom, transparent 42%, #000 60%);
  mask-image: linear-gradient(to bottom, transparent 42%, #000 60%);
}

/* paper haze behind the copy only, a sibling of it */
.hero__scrim {
  position: absolute; z-index: 2; left: 0; top: 0; width: min(1100px, 80vw); height: 68%; pointer-events: none;
  background: radial-gradient(ellipse 62% 54% at 38% 42%,
    color-mix(in srgb, var(--paper) 92%, transparent) 0%,
    color-mix(in srgb, var(--paper) 84%, transparent) 46%,
    color-mix(in srgb, var(--paper) 38%, transparent) 72%,
    transparent 100%);
}

/* the bottom of the scene settles into the dusk below it, over every plane and the poster */
.hero__floor {
  position: absolute; z-index: 1; inset: auto 0 0 0; height: 220px; pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, transparent 38%, rgb(15 31 61 / 0.32) 72%, var(--dusk) 100%);
  opacity: clamp(0.45, calc(0.45 + (var(--sc-p, 0.5) - 0.5) * 3.2), 1);
}

.hero__copy {
  position: absolute; z-index: 3; left: 0; right: 0; top: calc(var(--bar-h) + 6vh); margin-inline: auto;
  display: flex; flex-direction: column; align-items: flex-start;
}
.hero__copy > * { max-width: 640px; }
.hero__copy .eyebrow { margin-bottom: 12px; text-wrap: balance; color: var(--navy); }
/* the long status line stays whole on a desktop; on a phone it may wrap between words rather than overflow */
@media (max-width: 600px) { .hero__copy .nowrap--wide { white-space: normal; } }
.hero .display-xl { font-size: clamp(44px, 4.7vw, 76px); line-height: 0.98; }
.hero__copy .lede { margin-top: 18px; max-width: 50ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
/* the ghost button keeps its own ground wherever the scene happens to sit behind it */
.hero .btn--ghost { background: color-mix(in srgb, var(--paper) 78%, transparent); }

/* ===================================================== phone composition == */
/* portrait art serves 600px and under; tablets (601 to 860) stack like a phone but show the landscape art */
@media (max-width: 600px) {
  .only-desk { display: none; }
  .only-phone { display: block; }
  .only-desk-img { display: none; }
  .only-phone-img { display: block; }
  .hero__img { height: calc(100% + 48px); object-position: 50% 100%; }
  .hero { --ledge: 76px; }
  .prod--inv { left: 17%; width: 24vw; }
  .prod--bat { left: 48%; width: 27vw; }
}

@media (max-width: 860px) {
  .hero { --hero-scene: 340px; }
  .hero__stage { height: auto; min-height: 100vh; min-height: max(100svh, 600px); }
  .hero__copy { position: relative; top: auto; padding-top: calc(var(--bar-h) + 22px); padding-bottom: var(--hero-scene); }
  .hero .display-xl { font-size: clamp(38px, 11vw, 60px); }
  .hero__copy .lede { font-size: 18px; margin-top: 16px; }
  .hero__actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 420px; margin-top: 24px; }
  .hero__actions .btn { width: 100%; }
  .hero__scrim {
    width: 100%; height: calc(100% - var(--hero-scene) + 90px);
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--paper) 92%, transparent) 0%,
      color-mix(in srgb, var(--paper) 84%, transparent) 62%,
      transparent 100%);
  }
}

/* tablet: copy on top over clean sky, the landscape scene as a full-width band at the bottom */
@media (min-width: 601px) and (max-width: 860px) {
  .hero__stage { background: linear-gradient(#cfe0f3 0%, #a9c8ec 36%, #8db6e4 57%, #8db6e4 100%); }
  .hero__scrim {
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--paper) 78%, transparent) 0%,
      color-mix(in srgb, var(--paper) 50%, transparent) 55%,
      transparent 100%);
  }
  .hero__img { top: auto; bottom: -24px; height: auto; aspect-ratio: 1672 / 941; object-fit: fill; }
  .hero__poster .hero__img, .plane--sky .hero__img {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 24%); mask-image: linear-gradient(to bottom, transparent 0%, #000 24%);
  }
  .hero { --ledge: 9vw; }
  .prod--inv { left: 62%; width: 11vw; }
  .prod--bat { left: 76%; width: 12.5vw; }
}

/* ===================================================== act 2: statement == */
.statement__stage {
  display: flex; align-items: center; overflow: clip;
  background: var(--dusk);
}
.statement__inner { position: relative; z-index: 2; display: grid; gap: var(--space-3); }
.statement__line { max-width: 16ch; font-size: clamp(40px, 6.6vw, 104px); line-height: 1; letter-spacing: -0.024em; }
/* Words are ghosted from the first frame (0.42, which keeps the ghost at 3:1 on the dusk ground) and light up one by one as --sc-p advances; the heading then stays at full until the stage scrolls away
   (no fade-out, so the stage never leaves as an empty dusk band). Driven from CSS so the line is legible the moment the stage slides in. */
.statement__line .w {
  --start: calc(0.02 + var(--i) * 0.014);
  opacity: clamp(0.42, calc(0.42 + (var(--sc-p, 0) - var(--start)) * 10), 1);
}
.statement__sub { max-width: 44ch; color: #D6DBE8; }

/* the sun sinks behind the roofline as the act advances: one transform and one opacity, both read from --sc-p */
.statement__sun {
  position: absolute; z-index: 0; left: 70%; top: 42%; width: 96vmax; height: 96vmax; margin: -48vmax 0 0 -48vmax;
  background: radial-gradient(closest-side, rgb(255 216 148 / 0.82) 0%, rgb(247 178 100 / 0.46) 12%, rgb(228 128 90 / 0.22) 30%, rgb(150 80 100 / 0.08) 52%, transparent 72%);
  transform: translate3d(0, calc(var(--sc-p, 0) * 30vh), 0);
  opacity: calc(1 - var(--sc-p, 0) * 0.55);
}
/* the hero's own roofline, cut to a silhouette in the colour of the evening. The box is the whole image
   (so no cut edge shows), pushed down so only the trees and roofs stand in the frame. */
.statement__skyline {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: -17vw; aspect-ratio: 1672 / 941; background: #0A152B;
  -webkit-mask: url(/assets/img/hero-roofs-960.webp) 50% 100% / 100% 100% no-repeat;
  mask: url(/assets/img/hero-roofs-960.webp) 50% 100% / 100% 100% no-repeat;
  /* browsers that read image-set type() take the avif cut (about half the bytes); the rest keep the webp above */
  -webkit-mask-image: image-set(url(/assets/img/hero-roofs-960.avif) type("image/avif"), url(/assets/img/hero-roofs-960.webp) type("image/webp"));
  mask-image: image-set(url(/assets/img/hero-roofs-960.avif) type("image/avif"), url(/assets/img/hero-roofs-960.webp) type("image/webp"));
}

@media (max-width: 860px) {
  /* Sunset horizon, so the stage has a ground the moment it slides in: heading in the sky, sun behind the
     treeline, the dark mass below holds the lede. */
  .statement__stage { align-items: stretch; }
  .statement__inner { display: flex; flex-direction: column; padding-top: calc(var(--bar-h) + 5vh); padding-bottom: 12vh; }
  .statement__line { max-width: 14ch; font-size: clamp(40px, 12.4vw, 64px); }
  .statement__sub { margin-top: auto; }
  .statement__sun { left: 62%; top: 38%; }
  .statement__skyline {
    left: 50%; right: auto; bottom: 0; width: 183vw; margin-left: -91.5vw; aspect-ratio: 940 / 1672;
    -webkit-mask-image: url(/assets/img/hero-m-roofs-940.webp); mask-image: url(/assets/img/hero-m-roofs-940.webp);
    -webkit-mask-image: image-set(url(/assets/img/hero-m-roofs-940.avif) type("image/avif"), url(/assets/img/hero-m-roofs-940.webp) type("image/webp"));
    mask-image: image-set(url(/assets/img/hero-m-roofs-940.avif) type("image/avif"), url(/assets/img/hero-m-roofs-940.webp) type("image/webp"));
  }
}

/* ================================================== reduced motion: static == */
@media (prefers-reduced-motion: reduce) {
  .hero__planes, .hero__poster, .plane { transition: none; }
  .hero__floor { opacity: 0.4; }
  /* the statement is one screen with both lines showing, no extra pinned scroll */
  .statement { height: auto !important; }
  .statement__stage { position: relative; min-height: 100svh; }
  .statement [data-sc-cue], .statement__line, .statement__line .w { opacity: 1 !important; transform: none !important; }
  .statement__sun { transform: none; opacity: 0.8; }
}

/* ============================================ act 3: the system draws itself == */
/* One drawing per breakpoint (landscape above 860px, portrait at 860px and under). Strokes are painted from
   --sc-p by system-draw.js; the four product boxes below are the same rectangles as the four product outlines
   in the SVG (in document order), so the cut-outs land exactly inside the lines. */
/* the header link /#how-it-works lands with the stage pinned at the top: cancel the page-wide scroll-padding for this anchor */
#how-it-works { scroll-margin-top: calc(-1 * (var(--bar-h) + 12px)); }
.draw { --draw-reserve: 134px; } /* caption line + stage padding + gap, under the bar */
.draw__stage {
  display: flex; flex-direction: column; align-items: stretch;
  /* landscape drawing width: 88% of the stage, capped at 1240px, and never taller than the room under the captions */
  --draw-w: min(88%, 1320px, calc((100svh - var(--bar-h) - var(--draw-reserve)) * 1310 / 400));
  padding-top: calc(var(--bar-h) + clamp(12px, 3vh, 32px)); padding-bottom: clamp(12px, 2.6vh, 28px);
  background: var(--paper);
}
.draw__captions { display: grid; flex: none; }
.draw__captions > p {
  grid-area: 1 / 1; font-size: clamp(30px, 3.3vw, 50px); line-height: 1.08; max-width: 18ch;
  will-change: opacity, transform;
}

.draw__figure { position: relative; flex: none; margin: auto; }
.draw__figure--land {
  display: block; aspect-ratio: 1310 / 400; width: var(--draw-w);
}
.draw__figure--port {
  display: none; aspect-ratio: 600 / 1060;
  width: min(calc(100% - 2 * var(--gutter)), 560px, calc((100svh - var(--bar-h) - var(--draw-reserve)) * 600 / 1060));
}
/* drafting-sheet dot grid, faint: the ground the drawing grows on, so the stage is never empty on entry */
.draw__figure::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgb(90 103 133 / 0.30) 0.9px, transparent 1.3px) 0 0 / 24px 24px;
  -webkit-mask: radial-gradient(ellipse 72% 78% at 50% 50%, #000 30%, transparent 100%);
  mask: radial-gradient(ellipse 72% 78% at 50% 50%, #000 30%, transparent 100%);
}
.draw__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.draw__svg .ln {
  fill: none; stroke: var(--navy); stroke-width: 1.6px; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.draw__svg .ln--energy { stroke: var(--teal-ink); stroke-width: 2px; }
.draw__svg .ln--dim { stroke: var(--ink-soft); stroke-width: 1px; }
.draw__svg .ln--rail { stroke-width: 2.4px; stroke-linecap: square; }
.draw__svg .ln--tiny { stroke-width: 1.2px; }
.draw__svg .outline-product { opacity: 0.25; }
.draw__svg .ghost { fill: none; stroke: var(--navy); stroke-width: 1px; stroke-dasharray: 3 4; stroke-linejoin: round; opacity: 0.2; vector-effect: non-scaling-stroke; }
.draw__svg .guide { stroke: var(--ink-soft); stroke-width: 1px; stroke-dasharray: 2 5; stroke-linecap: round; opacity: 0.4; vector-effect: non-scaling-stroke; }

.draw__label {
  position: absolute; font: 500 13px/1 var(--sc-font-text); letter-spacing: 0.01em; color: var(--ink-soft); white-space: nowrap;
}
.draw__label--c { transform: translateX(-50%); text-align: center; }
/* the maker under the part name, on its own line */
.draw__brand { display: block; margin-top: 0.3em; font-size: 0.82em; font-weight: 600; letter-spacing: 0.06em; color: var(--teal-ink); }
.draw__label--l { transform: translateY(-50%); }

/* Product boxes = the opaque area of each cut-out (760x881 and 716x882 inside 800px files; the rail and the
   AdvanSol unit fill their files), so the box and the outline share one aspect ratio; the image is offset and
   enlarged so its transparent margin falls outside the box. */
.draw__product { position: absolute; will-change: opacity, transform; }
.draw__product img {
  position: absolute; max-width: none; height: auto;
  filter: drop-shadow(0 6px 12px rgb(var(--shade) / 0.2));
}
.draw__product--inv { aspect-ratio: 760 / 881; }
.draw__product--inv img { left: -2.1053%; top: -0.681%; width: 105.2632%; }
.draw__product--bat { aspect-ratio: 716 / 882; }
.draw__product--bat img { left: -5.1676%; top: -5.3288%; width: 111.7318%; }
.draw__product--rail { aspect-ratio: 797 / 228; }
.draw__product--unit { aspect-ratio: 800 / 217; }
.draw__product--rail img, .draw__product--unit img { left: 0; top: 0; width: 100%; }
.draw__figure--land .draw__product--rail { left: 4.5802%; top: 52.25%; width: 14.5038%; }
.draw__figure--land .draw__product--unit { left: 25.9542%; top: 37.4141%; width: 11.4504%; }
.draw__figure--land .draw__product--inv { left: 40.0763%; top: 12%; width: 16.0305%; }
.draw__figure--land .draw__product--bat { left: 59.9237%; top: 17.4475%; width: 14.8855%; }
.draw__figure--port .draw__product--rail { left: 63.3333%; top: 9.434%; width: 31.6667%; }
.draw__figure--port .draw__product--unit { left: 18.3333%; top: 21.1321%; width: 33.3333%; }
.draw__figure--port .draw__product--inv { left: 15.8333%; top: 29.6226%; width: 38.3333%; }
.draw__figure--port .draw__product--bat { left: 17%; top: 58.1717%; width: 36%; }

/* captions share the drawing's left edge (the roof array starts 30 units in) */
@media (min-width: 861px), (max-width: 860px) and (orientation: landscape) {
  .draw__captions { width: var(--draw-w); max-width: none; padding-inline: calc(var(--draw-w) * 30 / 1310) 0; }
}

@media (max-width: 860px) {
  .draw { --draw-reserve: 132px; }
  .draw__stage { justify-content: center; }
  .draw__figure { margin: clamp(4px, 1.4vh, 14px) auto 0; }
  .draw__stage { padding-top: calc(var(--bar-h) + 16px); padding-bottom: 16px; }
  .draw__captions > p { font-size: clamp(28px, 8.2vw, 40px); max-width: none; }
  .draw__figure--land { display: none; }
  .draw__figure--port { display: block; }
  .draw__label { font-size: 12.5px; }
}
/* a phone on its side (844x390, 740x360): the wide drawing under one line of captions, as on desktop */
@media (max-width: 860px) and (orientation: landscape) {
  .draw { --draw-reserve: 84px; }
  .draw__stage { padding-top: calc(var(--bar-h) + 8px); padding-bottom: 8px; }
  .draw__captions > p { font-size: clamp(24px, 4.4vw, 32px); }
  .draw__figure--land { display: block; margin: auto; }
  .draw__figure--port { display: none; }
  .draw__label { font-size: 11px; }
}

/* reduced motion: one static screen of the finished system, all six lines readable above it */
@media (prefers-reduced-motion: reduce) {
  .draw { height: auto !important; }
  .draw__stage { position: relative; height: auto; min-height: 100svh; padding-bottom: var(--space-5); }
  .draw__captions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
  .draw__captions > p { grid-area: auto; font-size: clamp(24px, 2.3vw, 34px); }
  .draw [data-sc-cue] { opacity: 1 !important; transform: none !important; }
  .draw__product { transform: none !important; }
  .draw__figure { margin-block: var(--space-2) 0; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 860px) {
  .draw__captions { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .draw__captions > p { font-size: 24px; }
}

/* ===================================================== act 4: the range == */
/* Base = the flat layout: the heading block, then a native horizontal scroller (phones, no engine).
   The pan act is layered on at 861px and up when motion is allowed; with reduced motion on desktop the cards
   become a wrapped grid, so all ten are on screen. See the media queries further down. */
.range { --edge: var(--gutter); --card-w: min(78vw, 320px); position: relative; padding-top: var(--space-5); }
.range__lead { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: var(--space-3); }
.range__lead .display-lg { font-size: clamp(36px, 10vw, 52px); }
.range__lead .btn { margin-top: 4px; }
.rail {
  display: flex; align-items: stretch; gap: 20px; width: 100%;
  padding: 8px var(--edge) 24px; scroll-padding-inline: var(--edge);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail::after { content: ""; flex: 0 0 1px; } /* end gutter: padding-right is not counted by every browser */

/* Product cards: white surface, 18px radius, the product standing on a soft ellipse shadow on a pale floor. */
.fam {
  --A: 250px; --plinth: 36px;
  flex: 0 0 var(--card-w); scroll-snap-align: start;
  display: flex; flex-direction: column;
  padding: 14px 14px 22px; border-radius: var(--radius); background: #fff; color: var(--ink); text-decoration: none;
  border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), var(--lift-1);
  transition: opacity 420ms var(--ease), transform 160ms var(--ease);
}
.fam:focus-visible { border-radius: var(--radius); }
.fam:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) { .fam:hover { transform: translateY(-4px); } }
.fam h3 { margin: 22px 8px 0; font: 400 28px/1.1 var(--sc-font-display); letter-spacing: -0.01em; text-wrap: balance; }
.fam .small { margin: 8px 8px 0; }
.fam__brand { margin: 20px 8px 0; font-size: 12px; line-height: 1; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-ink); }
.fam .fam__brand + h3 { margin-top: 8px; }

.fam__img {
  position: relative; height: var(--A); border-radius: var(--radius-sm); isolation: isolate;
  background: radial-gradient(120% 90% at 50% 28%, #F2F5F8 0%, #E6EBF1 58%, #DCE2EB 100%);
}
/* the floor the product stands on */
.fam__img::before {
  content: ""; position: absolute; z-index: 0; inset: auto 0 0 0; height: var(--plinth);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: linear-gradient(#E4E9F0, #F1F4F8);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55);
}
.fam__img picture {
  position: absolute; z-index: 1; left: 50%; bottom: calc(var(--plinth) - 12px); transform: translateX(-50%);
  display: block; isolation: isolate;
}
/* the contact shadow, behind the product, on the floor */
.fam__img picture::before {
  content: ""; position: absolute; z-index: -1; left: -6%; right: -6%; bottom: -9px; height: 20px;
  background: radial-gradient(closest-side, rgb(var(--shade) / 0.34), rgb(var(--shade) / 0.12) 55%, transparent 100%);
}
.fam__pic { display: block; width: auto; max-width: none; filter: drop-shadow(0 6px 8px rgb(var(--shade) / 0.14)); }
/* Sized by visual height, so the line-up shares one baseline. Heights are fractions of the panel. */
.fam--hybrid .fam__pic { height: calc(var(--A) * 0.70); }
.fam--pv .fam__pic { height: calc(var(--A) * 0.58); }
.fam--bat .fam__pic { height: calc(var(--A) * 0.62); }
.fam--gmax .fam__pic { height: calc(var(--A) * 0.80); }
.fam--micro .fam__pic { height: calc(var(--A) * 0.38); }
.fam--eps .fam__pic { height: calc(var(--A) * 0.62); }
.fam--kroof .fam__pic { height: calc(var(--A) * 0.56); }
.fam--kground .fam__pic { height: calc(var(--A) * 0.56); }
.fam--advan .fam__pic { height: calc(var(--A) * 0.74); }
/* The EV charger file is 168px wide: set by width, never wider than 120 CSS px, and short enough to fit the panel. */
.fam--ev .fam__pic { height: auto; width: min(120px, calc((var(--A) - var(--plinth) - 16px) * 168 / 320)); }

/* arriving cards settle from half-faded to full as they enter the screen (set by deck.js, opacity only) */
.range.is-armed .fam:not(.is-in) { opacity: 0.55; }

@media (max-width: 860px) {
  .fam h3 { font-size: 26px; }
}

/* desktop widths, with or without motion: the rail starts on the content edge and the cards are fixed width */
@media (min-width: 861px) {
  .range { --edge: max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter))); --card-w: clamp(300px, 24vw, 360px); }
  .rail { gap: 24px; }
  .fam { --A: min(340px, 38vh); --plinth: 40px; }
  /* heading left, lede and button right: a fixed header area above the shelf */
  .range__lead {
    display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: clamp(32px, 5vw, 80px); row-gap: 14px;
    align-items: end; margin-bottom: 0;
  }
  .range__lead .display-lg { grid-column: 1; grid-row: 1 / span 2; align-self: end; font-size: clamp(34px, 3.8vw, 56px); max-width: 20ch; }
  .range__lead .lede { grid-column: 2; grid-row: 1; align-self: end; font-size: clamp(16px, 1.3vw, 19px); }
  .range__lead .btn { grid-column: 2; grid-row: 2; justify-self: start; margin-top: 0; }
}

/* short desktop windows (a 1280x600 laptop): a little less art so the heading block clears the bar */
@media (min-width: 861px) and (max-height: 700px) and (prefers-reduced-motion: no-preference) {
  .fam { --A: 33vh; --plinth: 34px; }
  .fam h3 { margin-top: 16px; }
  .fam { padding-bottom: 18px; }
}

/* ============================================ act 5: why Green Fox == */
.why { position: relative; padding-block: var(--space-5) var(--space-6); }
.why__stage { display: block; }
.why__title { font-size: clamp(34px, 9.4vw, 52px); max-width: 16ch; margin-bottom: var(--space-4); }
.why__deck { display: flex; flex-direction: column; gap: 16px; }
.why__card {
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(24px, 2.6vw, 40px); border-radius: var(--radius); background: #fff;
  border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), var(--lift-2);
}
.why__card .display-md { font-size: clamp(28px, 7.4vw, 40px); }
.why__certs { display: flex; flex-wrap: wrap; gap: 20px 32px; margin-top: 10px; }

/* in the deck the frame is 96px wide (3:4), big enough that a real scan will read later */
.why__certs .cert { width: auto; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 16px; flex: 1 1 250px; max-width: 340px; }

/* ---- flat layout: phones and reduced motion. The engine still sets inline heights and writes transforms and cue
   opacity, so the layout takes them back with !important. The stage stays position: sticky (so the engine's
   "will not pin" sanity check stays quiet) but with top: auto, which makes it behave as an ordinary block. */
@media (max-width: 860px), (prefers-reduced-motion: reduce) {
  .range, .why { height: auto !important; }
  .range__stage, .why__stage { top: auto; height: auto; overflow: visible; }
  .rail { transform: none !important; will-change: auto; }
  .why__card { transform: none !important; will-change: auto; }
  .why__title { opacity: 1 !important; transform: none !important; }
  .range { padding-bottom: 0; }
  .why { padding-block: var(--space-4) var(--space-5); }
}
@media (max-width: 860px) {
  .why__certs { flex-direction: column; gap: 18px; }
  .why__certs .cert { flex: none; max-width: none; }
}
/* reduced motion on desktop: a wrapped grid, so all ten cards are on screen with no sideways travel */
@media (min-width: 861px) and (prefers-reduced-motion: reduce) {
  .range { padding-block: var(--space-5); }
  .range__lead { margin-bottom: var(--space-4); }
  .rail {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; overflow: visible; scroll-snap-type: none;
    padding: 8px var(--edge) 8px;
  }
  .rail::after { display: none; }
  .fam { --A: 250px; }
}
@media (min-width: 1100px) and (prefers-reduced-motion: reduce) {
  .rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* wide screens: two rows of five. Panels are a little shorter so the widest cut-out (the microinverter) stays inside its card. */
@media (min-width: 1280px) and (prefers-reduced-motion: reduce) {
  .rail { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .fam { --A: 230px; }
}

/* ---- enhanced layout: desktop with motion allowed. The pan act travels the cards under a fixed heading;
   the deck builds under pin. */
@media (min-width: 861px) and (prefers-reduced-motion: no-preference) {
  .range { padding: 0; }
  .range__stage {
    display: flex; flex-direction: column; justify-content: center; gap: clamp(20px, 4.4vh, 44px);
    padding-top: calc(var(--bar-h) + 8px); padding-bottom: 8px;
  }
  .rail { overflow: visible; scroll-snap-type: none; padding: 0 0 0 var(--edge); will-change: transform; }
  .rail::after { flex-basis: calc(var(--gutter) - 24px); }

  .why { padding: 0; }
  .why__stage {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; align-content: center;
    gap: var(--space-4) clamp(32px, 5vw, 80px); padding-top: var(--bar-h);
  }
  .why__title { font-size: clamp(36px, 4vw, 58px); max-width: 12ch; margin: 0; }
  /* Every card sits in one grid cell and is lifted into place by --t from deck.js. Each rests 72px below the one
     before it, so a buried card still shows its title strip; the topmost card shows in full. */
  .why__deck { --off: 72px; display: grid; padding-bottom: calc(var(--off) * 2); }
  .why__card {
    grid-area: 1 / 1; align-self: start; min-height: 256px; /* the top card must reach at least as low as the tallest buried one (the certificates card, two lines of copy) */ padding-top: clamp(18px, 1.8vw, 24px);
    transform-origin: 50% 0; will-change: transform;
    transform: translateY(calc((1 - var(--t, 1)) * 60vh + var(--i) * var(--off))) scale(var(--s, 1));
    opacity: min(1, calc(var(--t, 1) * 6)); /* a card is not seen waiting below the stage */
  }
  .why__certs { flex-wrap: nowrap; }
  .why__certs .cert { flex: 1 1 0; min-width: 0; }
}
@media (min-width: 861px) and (max-width: 1180px) and (prefers-reduced-motion: no-preference) {
  .why__stage { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

/* ============================================== act 6: proof mosaic == */
/* A flow act: each tile drifts a little against the scroll (data-sc-parallax, travel at most 70px). Rows are kept
   96px apart so two neighbours moving opposite ways (relative travel under 60px) can never touch. */
.proof { padding-block: var(--space-5) var(--space-6); }
.proof__head { display: grid; gap: 14px; margin-bottom: var(--space-5); }
.proof__head .display-lg { max-width: 18ch; }
.proof__note { margin-top: var(--space-4); color: var(--ink-soft); }
.tile {
  margin: 0; overflow: hidden; border-radius: 14px; background: #E6EBF1;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.5), var(--lift-1);
  transition: opacity 400ms var(--ease);
}
.tile picture { display: block; width: 100%; height: 100%; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

.proof__mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 96px 24px; align-items: start; }
.tile--a { grid-column: 1 / 7; grid-row: 1; aspect-ratio: 3 / 2; }
.tile--b { grid-column: 7 / 10; grid-row: 1; aspect-ratio: 3 / 4; margin-top: 90px; }
.tile--c { grid-column: 10 / 13; grid-row: 1; aspect-ratio: 5 / 6; margin-top: 20px; }
.tile--d { grid-column: 1 / 4; grid-row: 2; aspect-ratio: 3 / 4; margin-top: 40px; }
.tile--e { grid-column: 4 / 7; grid-row: 2; aspect-ratio: 1 / 1; margin-top: 130px; }
.tile--f { grid-column: 7 / 13; grid-row: 2; aspect-ratio: 3 / 2; }
.tile--e img { object-position: 35% 50%; }

@media (max-width: 860px) {
  .proof { padding-block: var(--space-4) var(--space-5); }
  .proof__head { margin-bottom: var(--space-4); }
  .proof__mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { margin-top: 0 !important; grid-row: auto !important; transform: none !important; }
  .tile--a, .tile--f { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
  .tile--b, .tile--c, .tile--d, .tile--e { grid-column: auto; aspect-ratio: 4 / 5; }
  .tile--a { order: 1; } .tile--b { order: 2; } .tile--c { order: 3; } .tile--d { order: 4; } .tile--e { order: 5; } .tile--f { order: 6; }
}
/* a phone on its side is 740 to 860px wide but its proof photos are only 534 to 1008px: cap the grid so no tile is
   drawn bigger than its file supports at 2x (the largest tile is 700px, the 4:5 tiles 344px) */
@media (max-width: 860px) and (orientation: landscape) {
  .proof__mosaic { max-width: 700px; margin-inline: auto; }
}
@media (prefers-reduced-motion: reduce) { .tile { transform: none !important; } }

/* ================================================== act 7: two doors == */
.doors { position: relative; }
.doors__stage { display: flex; flex-direction: column; justify-content: center; gap: var(--space-4); padding-top: var(--bar-h); background: var(--dusk); }
.doors__pair { position: relative; display: flex; min-height: min(58vh, 520px); }

.door {
  --door-bg: color-mix(in srgb, #fff 6%, var(--dusk));
  position: relative; isolation: isolate; flex: 1 1 0; min-width: 0;
  display: flex; padding: clamp(24px, 3.2vw, 48px);
  color: var(--paper); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.door--partner { --door-bg: color-mix(in srgb, var(--navy) 34%, var(--dusk)); border-radius: var(--radius) 0 0 var(--radius); }
.door--home { border-radius: 0 var(--radius) var(--radius) 0; }
/* The panel is a pseudo-element so a width change on hover is shown as a scaleX settle (doors.js), never as a width animation. */
.door::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--door-bg); border-radius: inherit;
  transform-origin: 0 50%;
}
.door--home::before { transform-origin: 100% 50%; border-left: 1px solid color-mix(in srgb, var(--paper) 34%, transparent); }
.door:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
.door__body { position: relative; display: flex; flex-direction: column; gap: 14px; flex: 1; width: 100%; }
/* The photograph: full bleed inside the door, held back by a dusk scrim so the text keeps its contrast. Lazy, decorative. */
.door__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; }
.door__img, .door__bg picture { display: block; width: 100%; height: 100%; }
.door__img { object-fit: cover; opacity: 0.4; transition: opacity 320ms var(--ease); }
.door--partner .door__img { object-position: 50% 42%; }
.door--home .door__img { object-position: 50% 16%; }
.door__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgb(15 31 61 / 0.86) 0%, rgb(15 31 61 / 0.5) 34%, rgb(15 31 61 / 0.5) 52%, rgb(15 31 61 / 0.9) 82%);
}
/* The identity line answers the question above, so it is the largest thing on the panel. */
.door__who { color: var(--paper); max-width: 15ch; font-size: clamp(32px, 3.4vw, 52px); }
.door .small { margin-top: auto; max-width: 34ch; color: #C9D0E2; }
/* The action: a clear row at the foot of the door. */
.door__act {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 2px; padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--paper) 24%, transparent);
  font-size: 17px; line-height: 1.2; font-weight: 500; letter-spacing: -0.005em; color: var(--paper);
}
.door__arrow { flex: none; width: 22px; height: 22px; color: var(--teal); transition: transform 200ms var(--ease); }
.door:active .door__arrow { transform: translateX(3px); }

@media (min-width: 861px) {
  .doors__pair[data-hot="partner"] .door--partner, .doors__pair[data-hot="home"] .door--home { flex-grow: 29; }
  .doors__pair[data-hot="partner"] .door--home, .doors__pair[data-hot="home"] .door--partner { flex-grow: 21; }
}
@media (hover: hover) and (pointer: fine) {
  .door:hover .door__arrow, .door:focus-visible .door__arrow { transform: translateX(6px); }
  .door:hover .door__img, .door:focus-visible .door__img { opacity: 0.62; }
}
@media (prefers-reduced-motion: reduce) { .door__img, .door__arrow { transition: none; } }

/* phones and reduced motion: an ordinary block, no pin. The engine still writes inline height, cue opacity and transform. */
@media (max-width: 860px), (prefers-reduced-motion: reduce) {
  .doors { height: auto !important; }
  .doors__stage { top: auto; height: auto; overflow: visible; padding-block: calc(var(--bar-h) + var(--space-3)) var(--space-5); }
  .doors__q, .door { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
}
@media (min-width: 861px) and (prefers-reduced-motion: reduce) {
  .doors__stage { padding-top: calc(var(--bar-h) + var(--space-5)); }
  .doors__pair { min-height: 340px; }
}
@media (max-width: 860px) {
  .doors__stage { gap: var(--space-3); }
  .doors__pair { flex-direction: column; min-height: 0; gap: 0; }
  .door { flex: none; min-height: 280px; padding: 24px 20px; }
  .door--partner { border-radius: var(--radius) var(--radius) 0 0; }
  .door--home { border-radius: 0 0 var(--radius) var(--radius); }
  .door--home::before { border-left: 0; border-top: 1px solid color-mix(in srgb, var(--paper) 34%, transparent); }
  .door__who { font-size: 32px; max-width: 16ch; }
}
