/* fx-house.css - "the property" (services section scene, lane H, 2026-11-11; re-cut 2026-11-17: it plays by itself).
   Every rule is scoped under html.fx-house (added by js/fx-house.js only when the scene is on), so config fx.house:false
   or ?fx=0 gives back the plain section exactly. The stage's box is reserved here, before the scene builds: no layout shift.
   Nothing sticks and nothing is sized for scroll room: the section is as tall as its content.
   Wide (>= 1024): the head on the left, the stage on the right, then the seven divisions below in the round-1 card grid.
   Narrow: the head, the stage full-bleed, then the cards. Pause / Play / Replay sits on the stage's top-right corner. */

/* ---------- tokens (the scene's only values; the canvas reads these) ---------- */
html.fx-house #services {
  --hx-ink: var(--c-white);         /* resting line */
  --hx-hot: var(--c-yellow);        /* the active part, one at a time */
  --hx-dim: var(--c-muted);         /* everything else while a part is active */
  --hx-grid: var(--c-surface);      /* ground grid, minor */
  --hx-grid-2: var(--c-line);       /* ground grid, every 10 m */
  --hx-ground: var(--c-line-2);     /* property lines, street */
  --hx-hair: 1.15;                  /* edge width, CSS px */
  --hx-hair-hot: 1.6;               /* the active part's edges */
  --hx-fine: .65;                   /* detail width (tile courses, joints, cells) */
  --hx-dim-a: .62;                  /* how far the inactive parts dim */
  --hx-detail-a: .5;                /* detail lines against edges */
  --hx-draw: 2.8s;                  /* first-entry draw-on */
  --hx-redraw: .7s;                 /* an activated part redraws in yellow */
  --hx-pitch: 31;                   /* camera elevation, deg (stays above the 22.6 deg roof pitch: no roof plane ever hides another) */
  --hx-dpr: 2;                      /* canvas resolution cap */
  --hx-dpr-phone: 1.5;
  --hx-stage-wide: clamp(22rem, 58svh, 36rem);        /* the stage beside the head (>= 1024) */
  --hx-stage-narrow: min(clamp(16rem, 62vw, 28rem), 85svh);   /* full-bleed under the head; never taller than a short screen */
  --hx-gap: clamp(2.5rem, 5vw, 4.5rem);               /* head / stage to the cards */
  --hx-cut: clamp(4rem, 14svh, 9rem);   /* the stage's sheared corners (the photo frames' cut, at the L's lean) */
  --hx-mark-w: 4.5rem;
}

/* ---------- the scene's box: the stage (the canvas; .hx-tag only carries the callout's type tokens) + its control ---------- */
html.fx-house #services .hx-scene { position: relative; }
html.fx-house #services .hx-stage { position: relative; height: var(--hx-stage-narrow); background: var(--c-black); contain: layout paint; }
html.fx-house #services .hx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
html.fx-house #services .hx-tag {
  position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; white-space: nowrap;
  font-family: var(--f-display); font-weight: var(--wght-ui); font-stretch: var(--wdth-ui); font-size: var(--t-xs);
  letter-spacing: var(--tr-label); text-transform: uppercase; line-height: 1; color: var(--c-yellow);
  background: var(--c-black); padding: var(--s-1) var(--s-2); display: none;   /* never shown: the scene sets the name from these tokens */
}
/* the control sits on the stage's top-right corner (the one corner the shear leaves square), never over the copy */
html.fx-house #services .scene-ctl--house { position: absolute; top: var(--s-3); right: var(--s-3); z-index: 2; }

/* ---------- the seven divisions keep the round-1 card grid (site.css .svc-grid); the active one's title gets a yellow mark ---------- */
html.fx-house #services .svc h3 { position: relative; }
html.fx-house #services .svc h3::before {
  content: ""; position: absolute; left: 0; top: calc(var(--s-2) * -1 - var(--rule)); width: var(--hx-mark-w); height: var(--rule);
  background: var(--c-yellow); transform-origin: 0 50%; transform: scaleX(0); transition: transform var(--d-ui) var(--e-out);
}
html.fx-house #services .svc.hx-on h3::before { transform: scaleX(1); }

/* ---------- wide: the head on the left, the stage on the right, the divisions below ---------- */
@media (min-width: 1024px) {
  html.fx-house #services > .wrap {
    display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); grid-template-areas: "head stage" "list list";
    column-gap: clamp(2rem, 4vw, 4.5rem); row-gap: var(--hx-gap); align-items: center;
  }
  html.fx-house #services .sec__head { grid-area: head; margin-bottom: 0; }
  html.fx-house #services .hx-scene { grid-area: stage; }
  html.fx-house #services .svc-grid { grid-area: list; }
  html.fx-house #services .hx-stage {
    height: var(--hx-stage-wide);
    clip-path: polygon(calc(var(--hx-cut) * var(--tan)) 0, 100% 0, 100% calc(100% - var(--hx-cut)), calc(100% - var(--hx-cut) * var(--tan)) 100%, 0 100%, 0 var(--hx-cut));
  }
}

/* ---------- narrow: the head, the stage full-bleed, then the cards ---------- */
@media (max-width: 1023px) {
  html.fx-house #services .hx-scene { margin: 0 calc(var(--pad-x) * -1) var(--hx-gap); }
  html.fx-house #services .hx-stage { box-shadow: 0 var(--hair) 0 var(--c-line), 0 calc(var(--hair) * -1) 0 var(--c-line); }
}
