@layer legacy {
/* ---------- Day to night scroll hero ---------- */
.sdn { position: relative; height: 380vh; --sdn-top: 88px; }
.sdn-stage { position: sticky; top: var(--sdn-top); height: calc(100svh - var(--sdn-top)); overflow: hidden; }
.sdn-bg { position: absolute; inset: 0; background: #C9D7EA; }

/* Scene: same aspect as the photos and bottom aligned, so overlay percentages match the image. */
.sdn-scene { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 140vw; aspect-ratio: 2000 / 848; --s: 1; }
@media (min-width: 768px) { .sdn-scene { width: 100vw; } }
.sdn-photos { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18%); mask-image: linear-gradient(to bottom, transparent 0, #000 18%); }
.sdn-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.sdn-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Energy flows: a round-cap dot pattern marching along each path */
@keyframes sdn-flow { to { stroke-dashoffset: -96; } }
.sdn-flow { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 9; stroke-dasharray: 0.1 24; animation: sdn-flow 1.6s linear infinite; }
.sdn-flow-amber { stroke: #ffb21f; }
.sdn-flow-green { stroke: #5be38a; }
.sdn-glow-amber { filter: drop-shadow(0 0 7px rgba(255, 178, 31, 0.9)); }
.sdn-glow-green { filter: drop-shadow(0 0 7px rgba(91, 227, 138, 0.9)); }
@keyframes sdn-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.sdn-node { animation: sdn-pulse 1.8s ease-in-out infinite; }
.sdn-leader { stroke: #fff; stroke-opacity: 0.9; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0.1 13; filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6)); }
.sdn-leader { fill: none; stroke-linejoin: round; }
.sdn-leaders { display: none; }
@media (min-width: 1024px) { .sdn-leaders { display: inline; } }

/* Cards */
.sdn-cards { position: absolute; inset: 0; display: none; pointer-events: none; }
@media (min-width: 1024px) { .sdn-cards { display: block; } }
.sdn-anchor { position: absolute; width: 0; height: 0; }
.sdn-anchor > div { position: absolute; left: 0; bottom: 0; width: 176px; transform: translateX(-50%) scale(var(--s, 1)); transform-origin: 50% 100%; }
.sdn-card { border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(11, 26, 43, 0.7); color: #fff; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding: 12px 14px; text-align: left; }
.sdn-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.7); line-height: 1.3; }
.sdn-label span { text-transform: none; letter-spacing: 0; color: rgba(255, 255, 255, 0.6); }
.sdn-value { margin-top: 4px; font-size: 20px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.sdn-bar { margin-top: 8px; height: 6px; width: 100%; border-radius: 999px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.sdn-bar > div { height: 100%; border-radius: 999px; }
.sdn-mode { margin-top: 4px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1; }
.sdn-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ffb21f; }
.sdn-time { margin-top: 6px; font-size: 12px; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.sdn-mobile-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 448px; margin: 24px auto 0; }
@media (min-width: 1024px) { .sdn-mobile-cards { display: none; } }

/* Copy */
.sdn-copy { position: relative; z-index: 20; max-width: 1024px; margin: 0 auto; padding: 32px 24px 0; text-align: center; }
.sdn-stack { display: grid; }
.sdn-stack > * { grid-area: 1 / 1; }
.sdn-h { font-size: clamp(2rem, 4.6vw, 3.75rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; margin: 0; }
.sdn-sub { max-width: 36rem; margin: 16px auto 0; font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.6; opacity: 0.9; }
.sdn-cta { margin-top: 24px; }
#sdn-night { position: relative; }
#sdn-night .sdn-cta { position: absolute; left: 0; right: 0; top: 100%; }
.sdn-cta a { display: inline-flex; align-items: center; gap: 12px; border-radius: 999px; background: #4EAE6C; color: #07130d; font-weight: 600; font-size: 16px; padding: 12px 12px 12px 28px; transition: background 0.2s; }
.sdn-cta a:hover { background: #3d9a5a; }
.sdn-cta a span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #07130d; color: #fff; }

/* Proof strip under the scene */
.proof-strip { background: var(--ivory); padding: 40px 0 8px; }
.proof-strip .hero-stats { margin: 0 auto; max-width: 1100px; padding: 28px 24px; border-top: 0; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  .sdn { height: auto; }
  .sdn-stage { position: relative; }
  .sdn-flow, .sdn-node { animation: none; }
}

/* Original hero copy block, now the day headline */
.sdn-orig { text-align: center; }
.sdn-orig .hero-badge { margin-bottom: 14px; padding: 6px 14px; }
.sdn-orig h1 { font-size: clamp(1.9rem, min(4.2vw, 6.2vh), 3.4rem); font-weight: 600; line-height: 1.04; letter-spacing: -0.03em; margin: 0 0 14px; color: inherit; }
.sdn-orig h1 .accent { color: var(--green-bright); }
.sdn-orig .hero-sub { color: inherit; opacity: 0.9; max-width: 640px; margin: 0 auto 18px; font-size: clamp(0.95rem, 1.3vw, 1.05rem); line-height: 1.5; }
.sdn-orig .btn-ghost { color: inherit; }
.sdn-orig .hero-micro { color: inherit; opacity: 0.7; margin-top: 12px; font-size: 12px; }
.sdn-actions-row { display: flex; align-items: center; justify-content: center; gap: 16px 20px; flex-wrap: wrap; }
.sdn-orig .hero-postcode { margin: 0; max-width: 440px; width: 100%; }
.sdn-orig .hero-actions { gap: 12px; flex-wrap: nowrap; }
@media (max-width: 760px) { .sdn-orig .hero-micro { display: block; } .sdn-copy { padding-top: 20px; } }

/* Original hero copy, unchanged, above the pinned scene. Same sky colour as the first frame so the two read as one. */
.sdn-intro { background: #C9D7EA; color: #13233B; padding: 44px 24px 28px; }
.sdn-intro .sdn-orig { max-width: 900px; margin: 0 auto; }
.sdn-intro .sdn-orig h1 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); }
.sdn-intro .sdn-orig .hero-sub { font-size: clamp(1rem, 1.4vw, 1.1rem); }
.sdn-intro .hero-micro { margin-top: 14px; }
.sdn-orig .hero-sub { opacity: 1; color: #2c3b52; }
.sdn-orig .hero-micro { opacity: 1; color: #55657c; }
.sdn-orig .btn-ghost { color: #13233B; }
@media (max-width: 760px) { .sdn-intro { padding: 32px 16px 20px; } }

/* Desktop: pull the scene up under the intro copy so the house shows on first load. The intro stays above the empty sky. */
.sdn-intro { position: relative; z-index: 3; }
@media (min-width: 1024px) {
  .sdn { margin-top: calc(-1 * var(--sdn-pull)); }
}
.sdn-copy { max-width: 1200px; }
.sdn-copy .sdn-h { font-size: clamp(1.8rem, 3.9vw, 3.2rem); }
.sdn-accent { color: #2E7C55; }

/* Night shift in green */
.sdn-accent-night { color: #5be38a; }

/* Transparent header over the hero (home page only, set by the script) */
:root { --hdr: 88px; }
@media (max-width: 1100px) { :root { --hdr: 71px; } }
body.home-hero .site-header { position: fixed; left: 0; right: 0; top: 0; --hdr-rgb: 255, 255, 255; --hdr-a: 0; background: rgba(var(--hdr-rgb), var(--hdr-a)); -webkit-backdrop-filter: blur(calc(var(--hdr-a) * 48px)); backdrop-filter: blur(calc(var(--hdr-a) * 48px)); border-bottom-color: transparent; transition: background-color 0.3s ease; }
body.home-hero .site-header.is-solid { border-bottom-color: rgba(10, 26, 20, 0.06); }

/* Stage fills the whole screen; copy clears the header */
.sdn { --sdn-top: 0px; }
.sdn-copy { padding-top: calc(var(--hdr) + 32px); }
.sdn-intro { padding-top: calc(var(--hdr) + 44px); }
@media (max-width: 760px) { .sdn-intro { padding-top: calc(var(--hdr) + 24px); } .sdn-copy { padding-top: calc(var(--hdr) + 20px); } }

/* Headline block centred between the menu bar and the roof-top Solar card, on any screen */
.sdn-copy.is-zoned { position: absolute; left: 0; right: 0; top: var(--hdr); height: var(--zone); max-width: none; padding: 8px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sdn-copy.is-zoned .sdn-stack { width: 100%; max-width: 1100px; }
.sdn-stack > * { align-self: center; }
.sdn-copy .sdn-h { font-size: clamp(1.6rem, min(3.9vw, 5.4vh), 3.2rem); }
.sdn-orig .hero-postcode { max-width: 520px; }
.sdn-actions-row { justify-content: center; }
.sdn-cta { margin-top: 18px; }
.sdn-cta a { padding: 9px 9px 9px 24px; font-size: 15px; }
.sdn-cta a span { width: 32px; height: 32px; }
.sdn-copy .sdn-sub { margin-top: 12px; line-height: 1.5; }
@media (max-height: 780px) and (min-width: 1024px) { .sdn-copy .sdn-sub { font-size: 0.95rem; } .sdn-cta { margin-top: 12px; } }

/* The intro's sky colour stops where the pulled-up scene begins, so the day headline underneath stays visible. */
:root { --sdn-pull: 0px; }
@media (min-width: 1024px) { :root { --sdn-pull: max(0px, calc(100svh - 42.4vw)); } }
.sdn-intro { background: linear-gradient(to bottom, #C9D7EA calc(100% - var(--sdn-pull)), rgba(201, 215, 234, 0) calc(100% - var(--sdn-pull))); }

/* Hero headings: always white at 80% opacity (no colour changes while scrolling) */
.sdn-copy .sdn-sub { opacity: 1; }
.sdn-copy .sdn-h, .sdn-copy .sdn-sub { text-shadow: 0 1px 2px rgba(7, 16, 40, 0.3), 0 2px 22px rgba(7, 16, 40, 0.5); }
.sdn-accent { color: rgba(124, 240, 166, 0.8); }
.sdn-accent-night { color: rgba(91, 227, 138, 0.8); }
.sdn-scrim { position: absolute; left: 0; right: 0; top: 0; height: 46%; z-index: 1; pointer-events: none; }
.sdn-scrim > div { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10, 24, 52, 0.66) 0%, rgba(10, 24, 52, 0.42) 50%, rgba(10, 24, 52, 0) 100%); }

/* Menu links only (not the phone number or the button): white while the hero sky is dark */
body.home-hero .site-header .nav-item > button, body.home-hero .site-header .nav-item > a { transition: color 0.3s ease; }
body.home-hero .site-header.hdr-dark:not(.is-solid) .nav-item > button,
body.home-hero .site-header.hdr-dark:not(.is-solid) .nav-item > a { color: #fff; }

/* Phone number: dark green on light backgrounds, light green only while the hero scene is behind the bar */
body.home-hero .site-header .header-phone { color: #1B5E3F; transition: color 0.3s ease; }
body.home-hero .site-header.hdr-dark:not(.is-solid) .header-phone { color: #7CF0A6; }
/* Room above the proof strip so, at its stop, the scene has fully left the screen and the menu bar sits over plain page */
.proof-strip { padding-top: calc(var(--hdr) + 36px); }

/* Proof strip: dark gradient card */
.proof-strip .hero-stats {
  background: linear-gradient(135deg, #0F3D2E 0%, #0d2b3a 55%, #0b1a2b 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(11, 26, 43, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.proof-strip .hero-stat-num, .proof-strip .hero-stat-num .accent { color: #ffffff; }
.proof-strip .hero-stat-num .accent { color: #7CF0A6; }
.proof-strip .hero-stat-label { color: rgba(255, 255, 255, 0.72); }

/* Seam fix: overlap the scene under the intro by 2px so sub-pixel rounding never exposes the page background */
@media (min-width: 1024px) { .sdn { margin-top: calc(-1 * var(--sdn-pull) - 2px); } }
.sdn-intro { background-color: transparent; }

/* Testimonial portrait: keep the face centred when the card crops */
.review-photo { object-position: 50% 30%; }
}
