/* /home-energy/ — Kestrel Home Energy: photos with tappable hotspots that open explainer cards over the image.
   Shared bar/order/foot styles come from /assets/css/demo.css. */
@font-face { font-family: "Sora"; src: url(/assets/fonts/sora-variable.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

.he-page {
  --pg-bg: #f4f6f2; --pg-ink: #0f2a2e; --teal: #0f766e; --sun: #f6c343; --muted: #4c6266;
  --bar-bg: #0f2a2e; --bar-fg: #eef5f3; --tag: #f6c343; --btn-bg: #f6c343; --btn-fg: #0f2a2e;
  --order-bg: #0f2a2e; --order-fg: #eef5f3;
  --f-display: "Sora", system-ui, sans-serif; --h-weight: 600;
}
.he-page h1, .he-page h2, .he-page h3 { letter-spacing: -.03em; }
.he-page .dm-bar__name { font-family: "Sora", sans-serif; font-weight: 700; letter-spacing: -.01em; }
.he-page .dm-bar__name b { font-weight: 300; }
.he-page .dm-kicker, .he-page .dm-eyebrow { color: var(--teal); }

/* Hero */
.he-hero { padding: clamp(56px, 9vw, 110px) 0 clamp(20px, 4vw, 40px); }
.he-hero h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); margin: .9rem 0 1rem; }
.he-hero h1 em { font-style: normal; color: var(--teal); }
.he-lead { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--muted); max-width: 40rem; margin: 0; }
.he-progress { display: flex; align-items: center; gap: .9rem; margin-top: 1.8rem; font: 500 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.he-progress__bar { width: min(220px, 40vw); height: 6px; border-radius: 99px; background: rgba(15, 42, 46, .1); overflow: hidden; }
.he-progress__bar i { display: block; height: 100%; width: var(--done, 0%); background: linear-gradient(90deg, var(--teal), #22b8a8); border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.he-progress.is-done .he-progress__txt { color: var(--teal); }

/* Figure sections */
.he-fig { padding: clamp(40px, 6vw, 80px) 0; }
.he-fig:nth-of-type(even) { background: #ebf0ec; }
.he-fig__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.he-fig--flip .he-fig__grid { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.he-fig--flip .he-fig__copy { order: 2; }
.he-fig--portrait .he-fig__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.he-fig--portrait .he-img { max-width: 560px; justify-self: center; width: 100%; }
.he-fig__copy h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin: .7rem 0 1rem; }
.he-fig__copy > p { color: var(--muted); margin: 0; font-size: 1.08rem; }
.he-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 1.6rem; margin: 1.6rem 0 1.4rem; }
.he-stats dt { font: 600 1.35rem/1.1 "Sora", sans-serif; letter-spacing: -.02em; }
.he-stats dd { margin: .3rem 0 0; font-size: .82rem; color: var(--muted); max-width: 9rem; }
.he-hint { display: flex; align-items: center; gap: .6rem; margin: 0; font: 500 .72rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.he-dot-mini { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--teal); position: relative; }
.he-dot-mini::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--teal); }

/* The picture */
.he-img { position: relative; margin: 0; }
.he-frame { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: var(--ar); box-shadow: 0 30px 70px -40px rgba(15, 42, 46, .6); isolation: isolate; }
.he-frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1); transform-origin: var(--fx, 50%) var(--fy, 50%); }
.he-img.is-open img { transform: scale(1.06); }
/* Spotlight: everything dims except a soft circle round the chosen point */
.he-dim { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), transparent 0 9%, rgba(6, 20, 22, .55) 22%); }
.he-img.is-open .he-dim { opacity: 1; }

/* Hotspot: ring + dot, a ripple that breathes, pops in when the photo scrolls into view */
.he-spot {
  position: absolute; left: var(--x); top: var(--y); width: 44px; height: 44px; translate: -50% -50%; z-index: 3;
  border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center;
  scale: 0; transition: scale .5s cubic-bezier(.3, 1.6, .5, 1) calc(var(--i) * 110ms + 150ms);
}
.he-img.is-in .he-spot { scale: 1; }
.he-spot::before, .he-spot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 4px 14px rgba(0, 0, 0, .35); background: rgba(15, 42, 46, .28); backdrop-filter: blur(2px); }
.he-spot::after { background: none; box-shadow: none; border-color: rgba(255, 255, 255, .9); animation: he-ripple 2.4s cubic-bezier(.2, .6, .3, 1) infinite; animation-delay: calc(var(--i) * .35s); }
@keyframes he-ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.3); opacity: 0; } }
.he-spot__dot { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 10px rgba(246, 195, 67, .9); animation: he-breathe 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .35s); transition: background .3s, transform .3s; }
@keyframes he-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.he-spot:hover::before, .he-spot:focus-visible::before { background: rgba(15, 118, 110, .75); transform: scale(1.12); transition: transform .25s, background .25s; }
.he-spot:focus-visible { outline: none; }
.he-spot:focus-visible::before { box-shadow: 0 0 0 3px var(--sun); }
/* explored spots turn teal with a tick; the open one grows */
.he-spot.is-seen .he-spot__dot { background: #7ce0d3; box-shadow: none; animation: none; }
.he-spot.is-seen::after { animation: none; opacity: 0; }
.he-spot[aria-expanded="true"]::before { background: var(--teal); transform: scale(1.25); }
.he-spot[aria-expanded="true"] .he-spot__dot { background: #fff; animation: none; }
.he-img.is-open .he-spot:not([aria-expanded="true"]) { opacity: .55; }

/* The overlay card, placed beside the chosen point */
.he-card {
  position: absolute; z-index: 5; width: min(340px, 78%); padding: 1.1rem 1.2rem 1rem; border-radius: 18px;
  background: rgba(250, 252, 250, .92); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55); color: var(--pg-ink);
  left: var(--cx); top: var(--cy); transform-origin: var(--ox, left) var(--oy, top);
  animation: he-card-in .45s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes he-card-in { from { opacity: 0; transform: scale(.88) translateY(8px); } to { opacity: 1; transform: none; } }
.he-card[hidden] { display: none; }
.he-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.he-card__n { font: 500 .68rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.he-card__x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(15, 42, 46, .08); color: var(--pg-ink); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.he-card__x:hover { background: rgba(15, 42, 46, .16); }
.he-card h3 { font-size: 1.3rem; margin: 0 0 .5rem; }
.he-card p { margin: 0 0 .8rem; font-size: .95rem; line-height: 1.55; color: #26403f; }
.he-card strong { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem; border-radius: 99px; background: rgba(246, 195, 67, .28); font: 600 .82rem "Sora", sans-serif; }
.he-card strong::before { content: "⚡"; font-size: .8rem; }
.he-card__body > * { animation: he-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.he-card__body > :nth-child(2) { animation-delay: .06s; } .he-card__body > :nth-child(3) { animation-delay: .12s; }
@keyframes he-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.he-card__nav { display: flex; justify-content: space-between; margin-top: .9rem; padding-top: .7rem; border-top: 1px solid rgba(15, 42, 46, .1); }
.he-card__nav button { border: 0; background: none; font: 600 .82rem "Sora", sans-serif; color: var(--teal); cursor: pointer; padding: .2rem .1rem; }
.he-card__nav button:hover { text-decoration: underline; }

/* Phones: stack, and the card becomes a sheet along the bottom of the photo */
@media (max-width: 900px) {
  .he-fig__grid, .he-fig--portrait .he-fig__grid, .he-fig--flip .he-fig__grid { grid-template-columns: minmax(0, 1fr); }
  .he-fig--flip .he-fig__copy { order: 0; }
  .he-stats { gap: 1rem; }
  .he-stats dt { font-size: 1.1rem; }
  /* the card slides up from under the photo, overlapping its bottom edge, and pushes the page down */
  .he-card { position: relative; left: auto !important; top: auto !important; width: auto; margin: -34px 10px 0; animation-name: he-sheet-in; }
  @keyframes he-sheet-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
  .he-card p { font-size: .9rem; }
  .he-spot { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .he-spot::after, .he-spot__dot { animation: none; }
  .he-spot { scale: 1; transition: none; }
  .he-frame img { transition: none; }
}

.he-survey { background: #ebf0ec; }
.he-page .dm-order .dm-btn { --btn-bg: #f6c343; --btn-fg: #0f2a2e; }

/* Own fonts (not the studio's Hanken Grotesk / IBM Plex Mono): body text and labels */
.he-page { --f-body: "Sora", system-ui, sans-serif; --f-mono: "Sora", system-ui, sans-serif; }
