/* House scan: the home page's section drawing in thermal colour.
   Self-contained so it can ship as a Duda HTML widget (see /guide/). */

.scan {
  /* iron-bow thermal ramp, coldest to hottest */
  --t0: #0B0A2A; --t1: #3B1F8F; --t2: #9C2E8E; --t3: #E1462C; --t4: #F7A21B; --t5: #FFE98A;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

/* ---- seasons ---------------------------------------------------------- */
.scan[data-season="july"] {
  --air: var(--t4); --attic: var(--t5); --room: #57248F; --leak: var(--t3);
  --glass: var(--t3); --wallleak: var(--t4); --duct: #2A1677; --ductleak: var(--t1);
  --unit: #2A1677; --crawl: #7A2A90; --soil-top: var(--t3); --soil-deep: #6A2590;
  --loop: #8E2C8E; --plume: var(--t5); --condenser: var(--t3);
}
.scan[data-season="january"] {
  --air: var(--t0); --attic: #22146C; --room: #C23A55; --leak: var(--t4);
  --glass: var(--t1); --wallleak: #F06A24; --duct: var(--t4); --ductleak: var(--t3);
  --unit: var(--t5); --crawl: var(--t1); --soil-top: #1E1260; --soil-deep: #6A2590;
  --loop: #5A2190; --plume: #0E0B33; --condenser: var(--t1);
}

/* ---- stage ------------------------------------------------------------ */
.scan__stage {
  position: relative;
  aspect-ratio: 1000 / 640;
  background: var(--t0);
  overflow: hidden;
  border-radius: 3px;
}
.scan__svg { display: block; width: 100%; height: 100%; }

.t { transition: fill .5s ease var(--d, 0ms), stroke .5s ease var(--d, 0ms); }
.t-air { fill: var(--air); }
.t-attic { fill: var(--attic); }
.t-room { fill: var(--room); }
.t-leak { fill: var(--leak); }
.t-glass { fill: var(--glass); }
.t-wallleak { fill: var(--wallleak); }
.t-duct { fill: var(--duct); }
.t-ductleak { fill: var(--ductleak); }
.t-unit { fill: var(--unit); }
.t-crawl { fill: var(--crawl); }
.t-loop { stroke: var(--loop); }
.t-plume { fill: var(--plume); }
.t-condenser { fill: var(--condenser); }
.st-soil-top { stop-color: var(--soil-top); transition: stop-color .5s ease 440ms; }
.st-soil-deep { stop-color: var(--soil-deep); }

.scan__halo path, .scan__lines path { vector-effect: non-scaling-stroke; }
.scan__halo { stroke: rgba(11, 10, 42, .5); }
.scan__halo path { stroke-width: 4.5px; }
.scan__halo path.k3 { stroke-width: 7px; }
.scan__halo path.k2 { stroke-width: 5.5px; }
.scan__lines { stroke: rgba(255, 255, 255, .92); }
.scan__lines path { stroke-width: 1.6px; }
.scan__lines path.k3 { stroke-width: 3.5px; }
.scan__lines path.k2 { stroke-width: 2.2px; }
.scan__halo path.k-fluff, .scan__lines path.k-fluff { stroke-width: 4px; }
.scan__halo path.k-fluff { stroke-opacity: 0; }
.scan__lines path.k-fluff { stroke-opacity: .55; }

.scan__mark { stroke: rgba(255, 255, 255, .9); transition: opacity .4s ease; }
.scan__mark-fill { fill: rgba(255, 255, 255, .9); stroke: none; }
.scan[data-season="july"] .scan__mark--january,
.scan[data-season="january"] .scan__mark--july { opacity: 0; }
.scan[data-season="july"] .scan__mark { stroke: rgba(11, 10, 42, .78); }
.scan[data-season="july"] .scan__mark-fill { fill: rgba(11, 10, 42, .78); }

.scan__sweep { fill: rgba(255, 255, 255, .7); opacity: 0; }
.scan.is-sweeping .scan__sweep { animation: scan-sweep .95s linear; }
@keyframes scan-sweep {
  0% { opacity: .9; transform: translateY(-8px); }
  92% { opacity: .9; }
  100% { opacity: 0; transform: translateY(646px); }
}

/* reticles, the imager's crosshair, numbered to match the list */
.scan__pin {
  position: absolute; left: var(--x); top: var(--y);
  width: 46px; height: 46px; margin: -23px 0 0 -23px; padding: 0;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer; color: #fff;
  filter: drop-shadow(0 0 2px rgba(11, 10, 42, .95));
}
.scan__ret { position: absolute; inset: 6px; width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.8; transition: transform .2s ease; }
.scan__pin .scan__num { position: relative; font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1; }
.scan__pin:hover .scan__ret { transform: scale(1.12); }
.scan__pin[aria-pressed="true"] .scan__ret { stroke-width: 3.6; transform: scale(1.16); }
.scan__pin[aria-pressed="true"] .scan__num {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: var(--t0); filter: none;
}
.scan__pin:focus-visible { outline: 3px solid #fff; outline-offset: 0; border-radius: 4px; }

/* the imager's on-screen reading box */
.scan__readout {
  position: absolute; left: 12px; top: 12px; margin: 0;
  padding: 6px 10px 5px; background: rgba(11, 10, 42, .82); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: clamp(15px, 1.6vw, 22px); line-height: 1;
  display: flex; gap: .5em; letter-spacing: .01em;
}
.scan__readout-zone { color: var(--t5); }
.scan[data-season="july"] .scan__readout-season[data-for="january"],
.scan[data-season="january"] .scan__readout-season[data-for="july"] { display: none; }

/* bar above the picture: season switch + colour key */
.scan__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.scan__key { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 700; color: var(--ink); }
.scan__key i { display: block; width: clamp(90px, 14vw, 160px); height: 10px; background: linear-gradient(90deg, var(--t0), var(--t1), var(--t2), var(--t3), var(--t4), var(--t5)); }
.scan__switch { display: inline-grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); border-radius: 3px; }
.scan__season {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; background: transparent; color: var(--ink);
  font: 700 1rem/1 var(--text); cursor: pointer;
}
.scan__season .ico { width: 20px; height: 20px; }
.scan__season[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.scan__season:focus-visible { outline: 3px solid var(--t3); outline-offset: 2px; }

/* ---- side panel: the numbered key to the picture ------------------------ */
.scan__side { padding-top: 56px; }
.scan__zones { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.scan__item { border-bottom: 1px solid var(--rule); }
.scan__zone {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; column-gap: 12px;
  width: 100%; padding: 12px 0; border: 0; background: none; color: var(--ink);
  text-align: left; cursor: pointer;
}
.scan__zone .scan__num {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 3px;
  background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1;
}
.scan__what { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.scan__where { font-size: .9375rem; font-weight: 600; color: var(--ink-soft); text-align: right; }
.scan__zone:focus-visible { outline: 3px solid var(--t3); outline-offset: -3px; }
.scan__zone[aria-expanded="true"] .scan__num { background: var(--t4); color: var(--t0); }

.scan__detail { display: none; padding: 0 0 18px 40px; font-size: 1rem; line-height: 1.55; }
.scan__detail p { margin: 0 0 .6em; }
.scan__item.is-open .scan__detail { display: block; }
.scan[data-season="july"] .scan__season-note[data-for="january"],
.scan[data-season="january"] .scan__season-note[data-for="july"] { display: none; }
.scan__season-note { font-weight: 600; }
.scan__go { font-weight: 700; color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }

@media (max-width: 960px) {
  .scan { grid-template-columns: 1fr; }
  .scan__side { padding-top: 0; }
}
@media (max-width: 560px) {
  .scan__pin { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .scan__ret { inset: 8px; width: 24px; height: 24px; }
  .scan__pin .scan__num { font-size: 14px; }
  .scan__pin[aria-pressed="true"] .scan__num { width: 18px; height: 18px; }
  .scan__readout { left: 8px; top: 8px; }
  .scan__season { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .t, .st-soil-top, .scan__mark { transition: none; }
  .scan.is-sweeping .scan__sweep { animation: none; }
}
