/* FOCAL homepage: "Reach the homes that need you next" map-to-3D scene.
 * Pairs with /js/home-scene.js (loader), /js/home-scene-3d.js (scene) and
 * /js/home-beats.js (the copy column's beats).
 *
 * Three layouts (2026-10-07):
 *  - At rest (no JS, reduced motion, no WebGL, slow device, ?mode=still):
 *    the copy and its five beats as plain text on void, a still of the last
 *    frame, and the typeset sample record. Nothing animates or hides.
 *  - Live, desktop (1024px+ and landscape): a 100vh stage pins over a run
 *    of scroll. The copy column pins on the left and its beats take turns
 *    with the scene's stages; the record docks on the right.
 *  - Live, stacked (phones, tall tablets): the copy sits ABOVE the scene in
 *    the page and never fades out (Bryan, 10-07: a fast flick used to skip
 *    it, and re-reading meant replaying the scene). The scene pins and
 *    plays; the record follows it in the page, the leader running down
 *    into it.
 * The stacked query must match js phone(): (max-width: 1023px), (max-aspect-ratio: 9/10).
 */
.homes3d {
  --h3d-void: #0E0829;
  --h3d-linen: #E5E0DC;
  --h3d-peri: #ABC1EE;
  --h3d-green: #19D25C;
  --h3d-green4: #34FE76;
  --h3d-pad: clamp(1rem, 2.2vw, 1.75rem);
  --h3d-run: 240vh;
  position: relative;
  background: var(--h3d-void);
  color: var(--h3d-linen);
}
.h3d-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- copy */
.homes3d__copy { position: relative; z-index: 3; }
.h3d-copy__in { max-width: 72rem; margin: 0 auto; padding: 4.5rem 1.25rem 3rem; }
@media (min-width: 768px) { .h3d-copy__in { padding: 6rem 2rem 4rem; } }
.h3d-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: #F4F1ED;
  margin: 0;
  max-width: 18ch;
  text-wrap: balance;
}
.h3d-lead {
  margin: 0.9rem 0 0;
  max-width: 30rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.15rem, 1.5vw, 1.3rem);
  line-height: 1.4;
  color: rgba(229, 224, 220, 0.9);
}

/* the five beats, at rest and stacked: a list with ticks on void */
.beats--h3d { margin-top: 2rem; }
.beats--h3d .beats__list { border-top: 1px solid rgba(171, 193, 238, 0.18); }
.beats--h3d .beat { padding: 1.1rem 0 1.2rem; border-bottom: 1px solid rgba(171, 193, 238, 0.14); }
.beats--h3d .beat__k { color: rgba(229, 224, 220, 0.62); }
.beats--h3d .beat__k span { color: rgba(229, 224, 220, 0.42); }
.beats--h3d .beat__k::before { border-color: rgba(229, 224, 220, 0.42); }
.beats--h3d .beat__t {
  margin-top: 0.6rem !important;
  font-size: 1.0625rem; line-height: 1.58; color: rgba(229, 224, 220, 0.84);
  text-wrap: pretty;
}
html.beats-live .beats--h3d .beat.is-on .beat__k { color: #F4F1ED; }
html.beats-live .beats--h3d .beat.is-on .beat__k::before { background: var(--h3d-green4); border-color: var(--h3d-green4); box-shadow: 0 0 0 3px rgba(52, 254, 118, 0.18), 0 0 10px rgba(52, 254, 118, 0.5); }

@media (min-width: 900px) {
  /* at rest on a wide screen: title and lead beside the list */
  .h3d-copy__col { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); column-gap: 4rem; align-items: start; }
  .h3d-copy__col > .h3d-title, .h3d-copy__col > .h3d-lead { grid-column: 1; }
  .h3d-copy__col > .beats--h3d { grid-column: 2; grid-row: 1 / span 3; margin-top: 0.4rem; }
}

/* --------------------------------------------------------------- stage */
.homes3d__track { position: relative; }
.homes3d__stage { position: relative; margin: 0; background: var(--h3d-void); overflow: hidden; }
.homes3d__run { display: none; }
.homes3d__fig { position: relative; margin: 0; }
html.homes3d-live .homes3d:not(.is-still) .homes3d__fig { position: static; }
.homes3d__still { display: block; }
/* live: the scene paints the stage, so the still (loading=lazy) is never fetched */
html.homes3d-live .homes3d:not(.is-still):not(.is-still-pinned) .homes3d__still { display: none; }
.homes3d__still img { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- dock */
/* at rest: the record over the still on a wide screen, under it on a narrow one */
.homes3d__dock { position: relative; z-index: 3; }
@media (min-width: 1024px) and (min-aspect-ratio: 9/10) {
  .homes3d__dock { position: absolute; left: 0; right: 0; bottom: 0; height: calc(100vw * 0.625); pointer-events: none; }
  .homes3d__dock-in { position: relative; height: 100%; }
  .homes3d__card { position: absolute; left: calc(50% + 13.5vw); top: 50%; width: min(25rem, 31vw); transform: translateY(-50%); pointer-events: auto; }
}
@media (max-width: 1023px), (max-aspect-ratio: 9/10) {
  .homes3d__dock-in { padding: 1.25rem 1rem 3rem; }
  .homes3d__card { max-width: 30rem; margin: 0 auto; }
}

/* ---------------------------------------------------------------- live */
/* desktop: copy and record pin beside the stage */
@media (min-width: 1024px) and (min-aspect-ratio: 9/10) {
  html.homes3d-live .homes3d:not(.is-still) .homes3d__copy { position: absolute; inset: 0; pointer-events: none; }
  html.homes3d-live .homes3d:not(.is-still) .h3d-copy__in {
    position: sticky; top: 0; height: 100vh; max-width: none; padding: 0; box-sizing: border-box;
    display: flex; align-items: center;
  }
  /* a pool of void behind the column, so no street or roof runs through the
     type; it sits in the stage under the HUD, so the HUD stays crisp */
  html.homes3d-live .homes3d:not(.is-still) .homes3d__stage::after {
    content: ""; position: absolute; z-index: 1; inset: 0 auto 0 0; width: calc(50% - 8vw); pointer-events: none;
    background: linear-gradient(90deg, rgba(14, 8, 41, 0.9), rgba(14, 8, 41, 0.78) 62%, rgba(14, 8, 41, 0));
  }
  html.homes3d-live .homes3d:not(.is-still) .h3d-copy__col {
    position: relative; display: block;
    width: min(26rem, 31vw);
    margin-left: max(clamp(1.5rem, 4vw, 4rem), calc(50% - 13.5vw - min(26rem, 31vw)));
  }
  /* the beats take turns only with the beats script in play (beats-live);
     without it the column is the plain list, which fits the pinned screen */
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d { --beats-mode: pin; margin-top: 2.25rem; }
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d .beats__index button { pointer-events: auto; }
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d .beats__rail { display: block; }
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d .beats__list { display: grid; border: 0; margin-top: 1.5rem; }
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d .beat { grid-area: 1 / 1; padding: 0; border: 0; }
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d .beat__k { color: var(--h3d-green4); }
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d .beat__k span { color: rgba(52, 254, 118, 0.7); }
  html.homes3d-live.beats-live .homes3d:not(.is-still) .beats--h3d .beat__t { font-size: 1.1875rem; line-height: 1.55; color: rgba(244, 241, 237, 0.92); }
  html.homes3d-live.beats-live:not(.beats-ready) .homes3d:not(.is-still) .beats--h3d .beat:not(:first-child) { visibility: hidden; }

  html.homes3d-live .homes3d:not(.is-still) .homes3d__stage { position: sticky; top: 0; height: 100vh; }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__run { display: block; height: var(--h3d-run); }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__dock { inset: 0; height: auto; }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__dock-in { position: sticky; top: 0; height: 100vh; }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__card { max-height: calc(100vh - 4rem); }
}
/* the homes column's index runs across, above its beat (desktop: no label row) */
.beats--h3d .beats__label { display: none; }
.beats--h3d .beats__index { display: flex; gap: 1.05rem; padding: 0 0 0.85rem; }
.beats--h3d .beats__index::before,
.beats--h3d .beats__index::after { left: 0; top: auto; bottom: 0; height: 1px; }
.beats--h3d .beats__index::before { right: 0; width: auto; background: rgba(229, 224, 220, 0.2); }
.beats--h3d .beats__index::after { width: calc(100% * var(--beats-p, 0)); background: var(--h3d-green4); box-shadow: 0 0 8px rgba(52, 254, 118, 0.6); }
.beats--h3d .beats__index button { width: auto; padding: 0.3rem 0 0.3rem 0.85rem; font-size: 0.64rem; letter-spacing: 0.15em; color: rgba(229, 224, 220, 0.5); }
.beats--h3d .beats__index button span { display: none; }
.beats--h3d .beats__index button::before { left: 0; background: var(--h3d-void); border-color: rgba(229, 224, 220, 0.45); width: 6px; height: 6px; }
.beats--h3d .beats__index button:hover { color: #F4F1ED; }
.beats--h3d .beats__index li.is-past button::before { background: rgba(229, 224, 220, 0.55); border-color: transparent; }
.beats--h3d .beats__index li.is-on button { color: var(--h3d-green4); }
.beats--h3d .beats__index li.is-on button::before { background: var(--h3d-green4); border-color: var(--h3d-green4); box-shadow: 0 0 0 3px rgba(52, 254, 118, 0.16), 0 0 10px rgba(52, 254, 118, 0.55); }

/* stacked: copy above in the page, the scene pins, the record follows */
@media (max-width: 1023px), (max-aspect-ratio: 9/10) {
  .homes3d { --h3d-run: 180svh; }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__stage { position: sticky; top: 0; height: 100vh; height: 100svh; }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__run { display: block; height: 180vh; height: var(--h3d-run); }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__dock { margin-top: -1px; }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__dock-in { padding-top: 0; }
  /* the leader comes down out of the scene into this port on the card's edge */
  html.homes3d-live .homes3d:not(.is-still) .homes3d__card::after {
    content: ""; position: absolute; top: -4px; right: 26px; width: 7px; height: 7px;
    background: var(--h3d-void); border: 1.4px solid var(--h3d-green4); border-radius: 50%; box-sizing: border-box;
  }
  .h3d-copy__in { padding-bottom: 2.25rem; }
}
/* While the stage is pinned the site header steps out of it (js/home-scene.js). */
html.homes3d-pinned .site-header:not(:focus-within) { transform: translateY(-100%); }

/* pinned still: the scene gave up after the reader had reached it */
.homes3d.is-still-pinned .homes3d__still { position: absolute; inset: 0; z-index: 1; }
.homes3d.is-still-pinned .homes3d__still img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }

/* autoplay comparison mode: no scroll run */
html.homes3d-live .homes3d.is-autoplay .homes3d__run { display: none; }

/* ---------------------------------------------------------------- record */
.homes3d__card {
  --in: 1;
  position: relative;
  box-sizing: border-box;
  background: rgba(14, 8, 41, 0.94);
  color: var(--h3d-linen);
  border: 1px solid rgba(171, 193, 238, 0.3);
  padding: 1.05rem 1.2rem 0.95rem;
  font-family: Inter, system-ui, sans-serif;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(14, 8, 41, 0.6);
}
/* HUD corner brackets, the stage's own */
.h3d-card__c { position: absolute; width: 12px; height: 12px; border: 0 solid var(--h3d-green4); pointer-events: none; }
.h3d-card__c--tl { top: -5px; left: -5px; border-width: 1.5px 0 0 1.5px; }
.h3d-card__c--tr { top: -5px; right: -5px; border-width: 1.5px 1.5px 0 0; }
.h3d-card__c--bl { bottom: -5px; left: -5px; border-width: 0 0 1.5px 1.5px; }
.h3d-card__c--br { bottom: -5px; right: -5px; border-width: 0 1.5px 1.5px 0; }
.h3d-k {
  display: block; margin: 0;
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.17em; text-transform: uppercase; line-height: 1.3;
  color: rgba(229, 224, 220, 0.6);
}
.homes3d__card p { margin: 0; }
.h3d-card__kicker {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(229, 224, 220, 0.6);
}
.h3d-card__tag { color: var(--h3d-green4); letter-spacing: 0.14em; }
.h3d-card__id { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 0.6rem; }
.h3d-card__addr {
  font-family: "Source Serif 4", Georgia, serif; font-weight: 600;
  font-size: 1.55rem; line-height: 1.1; letter-spacing: 0.01em; color: #F4F1ED;
}
.h3d-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.3rem !important;
  font-size: 0.76rem; color: rgba(229, 224, 220, 0.7); font-variant-numeric: tabular-nums;
}
.h3d-card__meta i { width: 3px; height: 3px; background: rgba(171, 193, 238, 0.55); }
.h3d-card__rank { flex: none; text-align: right; }
.h3d-card__rank-n { display: block; margin-top: 0.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h3d-card__rank-n b {
  font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 2.1rem; line-height: 1;
  color: var(--h3d-green4); text-shadow: 0 0 18px rgba(52, 254, 118, 0.35);
}
.h3d-card__rank-n span { margin-left: 0.3rem; font-size: 0.8rem; font-weight: 600; color: rgba(229, 224, 220, 0.55); }
.h3d-card__sec { padding: 0.75rem 0; border-top: 1px solid rgba(171, 193, 238, 0.16); }
.h3d-card__head { padding-bottom: 0.85rem; }
.h3d-card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.h3d-card__val { font-size: 0.8rem; font-weight: 600; color: #F4F1ED; font-variant-numeric: tabular-nums; }
.h3d-card__val--g { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--h3d-green4); }

/* percentile meter: a tick scale, filled to the home's place on it */
.h3d-meter {
  position: relative; display: block; height: 7px; margin-top: 0.55rem;
  background: repeating-linear-gradient(90deg, rgba(229, 224, 220, 0.22) 0 1px, transparent 1px 4%);
  border-bottom: 1px solid rgba(229, 224, 220, 0.22);
}
.h3d-meter i {
  position: absolute; left: 0; top: 0; bottom: -1px; width: calc(99% * var(--in));
  background: repeating-linear-gradient(90deg, rgba(52, 254, 118, 0.9) 0 1px, transparent 1px 4%);
  border-bottom: 1px solid var(--h3d-green4);
}
.h3d-meter i::after {
  content: ""; position: absolute; right: -1px; top: -3px; bottom: -1px; width: 2px;
  background: var(--h3d-green4); box-shadow: 0 0 8px rgba(52, 254, 118, 0.8);
}

/* permit history: a dated line, the HVAC gap lit */
.h3d-tl { position: relative; height: 4.1rem; margin: 0.45rem 0.2rem 0; }
.h3d-tl__line, .h3d-tl__gap { position: absolute; top: 50%; height: 1px; }
.h3d-tl__line { left: 0; right: 0; background: rgba(229, 224, 220, 0.32); transform-origin: left; transform: scaleX(var(--in)); }
.h3d-tl__gap {
  left: calc(var(--a) * 100%); right: 0; height: 2px; margin-top: -0.5px;
  background: var(--h3d-green4); box-shadow: 0 0 8px rgba(52, 254, 118, 0.55);
  transform-origin: left; transform: scaleX(clamp(0, calc(var(--in) * 2 - 1), 1));
}
.h3d-tl ol { list-style: none; margin: 0; padding: 0; }
.h3d-tl li {
  position: absolute; left: calc(var(--x) * 100%); top: 50%; width: 0;
  font-variant-numeric: tabular-nums;
}
.h3d-tl li::before {
  content: ""; position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; box-sizing: border-box;
  background: var(--h3d-void); border: 1px solid rgba(229, 224, 220, 0.7);
}
.h3d-tl li b, .h3d-tl li span {
  position: absolute; left: 0; transform: translateX(-50%); white-space: nowrap; display: block;
}
.h3d-tl li b { top: 0.55rem; font-size: 0.7rem; font-weight: 600; color: #F4F1ED; }
.h3d-tl li span { top: 1.4rem; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(229, 224, 220, 0.58); }
.h3d-tl li.is-up b { top: auto; bottom: 1.35rem; }
.h3d-tl li.is-up span { top: auto; bottom: 0.55rem; }
.h3d-tl li:first-child b, .h3d-tl li:first-child span { transform: none; left: -3px; }
.h3d-tl li:last-child b, .h3d-tl li:last-child span { transform: none; left: auto; right: -3px; }
.h3d-tl li.is-key::before { background: var(--h3d-green4); border-color: var(--h3d-green4); box-shadow: 0 0 8px rgba(52, 254, 118, 0.7); }
.h3d-tl li.is-key b, .h3d-tl li.is-key span { color: var(--h3d-green4); }
.h3d-tl li.is-now::before { border-style: dashed; border-color: rgba(229, 224, 220, 0.5); }

/* reasons, with signal strength as pips */
.h3d-card__why ul { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.h3d-card__why li { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.32rem 0; font-size: 0.83rem; line-height: 1.38; color: #F4F1ED; }
.h3d-pips { flex: none; display: inline-flex; gap: 2px; margin-top: 0.22rem; }
.h3d-pips i { width: 3px; height: 10px; background: rgba(229, 224, 220, 0.2); }
.h3d-pips i:nth-child(-n + 5) { background: rgba(229, 224, 220, 0.2); }
.h3d-pips[style*="--n:5"] i,
.h3d-pips[style*="--n:4"] i:nth-child(-n + 4),
.h3d-pips[style*="--n:3"] i:nth-child(-n + 3),
.h3d-pips[style*="--n:2"] i:nth-child(-n + 2),
.h3d-pips[style*="--n:1"] i:nth-child(1) { background: var(--h3d-green4); box-shadow: 0 0 5px rgba(52, 254, 118, 0.45); }
/* the block: its homes in a row, the target ringed, three neighbors lit */
.h3d-block { display: flex; gap: 3px; margin-top: 0.4rem; }
.h3d-block i { width: 7px; height: 7px; box-sizing: border-box; border: 1px solid rgba(229, 224, 220, 0.32); }
.h3d-block i.is-on { background: var(--h3d-green4); border-color: var(--h3d-green4); box-shadow: 0 0 6px rgba(52, 254, 118, 0.55); }
.h3d-block i.is-t { border-color: var(--h3d-green4); outline: 1px solid rgba(52, 254, 118, 0.5); outline-offset: 2px; }

.h3d-card__next { padding-bottom: 0.2rem; }
.h3d-card__next-value {
  display: flex; align-items: center; gap: 0.55rem; margin-top: 0.3rem;
  font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 1.3rem; color: #F4F1ED;
}
.h3d-card__next-value svg { width: 1.05rem; height: 1.05rem; color: var(--h3d-green4); flex: none; }
.h3d-card__cap { margin-top: 0.55rem !important; font-size: 0.7rem; line-height: 1.4; color: rgba(229, 224, 220, 0.55); }

/* live desktop: the record docks as the scene reaches it (--in from the scene) */
@media (min-width: 1024px) and (min-aspect-ratio: 9/10) {
  html.homes3d-live .homes3d:not(.is-still) .homes3d__card {
    opacity: var(--in);
    transform: translate(calc((1 - var(--in)) * 18px), -50%);
    clip-path: inset(-14px calc((1 - var(--in)) * 100%) -14px -14px);
  }
  html.homes3d-live .homes3d:not(.is-still):not(.is-still-pinned) .homes3d__card { --in: 0; }
  html.homes3d-live .homes3d:not(.is-still) .homes3d__card .h3d-card__sec,
  html.homes3d-live .homes3d:not(.is-still) .homes3d__card .h3d-card__cap {
    opacity: clamp(0, calc(var(--in) * 2.4 - 0.5 - var(--i, 0) * 0.22), 1);
  }
  /* shorter screens: the same record, tighter */
  @media (max-height: 820px) {
    .homes3d__card { padding: 0.85rem 1.05rem 0.8rem; }
    .h3d-card__sec { padding: 0.55rem 0; }
    .h3d-card__head { padding-bottom: 0.65rem; }
    .h3d-card__addr { font-size: 1.35rem; }
    .h3d-card__rank-n b { font-size: 1.8rem; }
    .h3d-tl { height: 3.7rem; }
    .h3d-card__why li { padding: 0.22rem 0; font-size: 0.8rem; }
  }
}

/* ------------------------------------------------------ canvas + overlays */
.homes3d__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0;
}
.h3d-leader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.h3d-leader path { fill: none; stroke: rgba(229, 224, 220, 0.72); stroke-width: 1; }
.h3d-leader circle { fill: var(--h3d-void); stroke: var(--h3d-green4); stroke-width: 1.4; }

.h3d-hud {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  font-family: Inter, system-ui, sans-serif; font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.17em; text-transform: uppercase; line-height: 1;
  color: var(--h3d-ink); opacity: var(--h3d-hud, 0);
  font-variant-numeric: tabular-nums;
}
.homes3d__stage { --h3d-ink: #E5E0DC; --h3d-accent: #34FE76; }
.h3d-hud > div { position: absolute; display: flex; align-items: center; gap: 1.1rem; }
.h3d-tl-hud { top: var(--h3d-pad); left: var(--h3d-pad); }
.h3d-tr { top: var(--h3d-pad); right: var(--h3d-pad); }
.h3d-bl { bottom: var(--h3d-pad); left: var(--h3d-pad); }
.h3d-br { bottom: var(--h3d-pad); right: var(--h3d-pad); }
.h3d-hud span { opacity: 0.78; }
.h3d-sq {
  width: 6px; height: 6px; background: var(--h3d-accent, var(--h3d-green)); opacity: 1 !important;
  animation: h3d-blink 1.6s ease-in-out infinite;
}
@keyframes h3d-blink { 50% { opacity: 0.35; } }
.h3d-scale { display: inline-flex; align-items: center; gap: 0.5rem; }
.h3d-scale i {
  display: block; height: 5px; border: 1px solid currentColor; border-top: 0; opacity: 0.7;
  transition: width 0.12s linear;
}
.h3d-step { color: var(--h3d-accent); opacity: 1 !important; }
.h3d-tag {
  padding: 0.3rem 0.5rem; border: 1px solid currentColor; opacity: 0.7 !important; letter-spacing: 0.16em;
}
.h3d-c { position: absolute; width: 14px; height: 14px; border: 0 solid var(--h3d-ink); opacity: 0.45; }
.h3d-c--tl { top: calc(var(--h3d-pad) * 0.45); left: calc(var(--h3d-pad) * 0.45); border-width: 1px 0 0 1px; }
.h3d-c--tr { top: calc(var(--h3d-pad) * 0.45); right: calc(var(--h3d-pad) * 0.45); border-width: 1px 1px 0 0; }
.h3d-c--bl { bottom: calc(var(--h3d-pad) * 0.45); left: calc(var(--h3d-pad) * 0.45); border-width: 0 0 1px 1px; }
.h3d-c--br { bottom: calc(var(--h3d-pad) * 0.45); right: calc(var(--h3d-pad) * 0.45); border-width: 0 1px 1px 0; }
/* desktop: the copy column owns the left edge, so the HUD keeps to the right */
@media (min-width: 1024px) and (min-aspect-ratio: 9/10) {
  .h3d-bl { left: auto; right: var(--h3d-pad); bottom: calc(var(--h3d-pad) + 1.9rem); }
}
@media (max-width: 1023px), (max-aspect-ratio: 9/10) {
  .h3d-bl, .h3d-c { display: none !important; }

  .h3d-hud > div { gap: 0.8rem; }
  .h3d-br { top: calc(var(--h3d-pad) + 1.4rem); bottom: auto; right: var(--h3d-pad); }
}

/* narrow phones: the numbered status needs the top row; the scale bar stays */
@media (max-width: 480px) { .h3d-tr [data-k="zoom"] { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .h3d-sq { animation: none; }
}
