:root {
  /* mapped onto the site's tokens (styles.css) so the header's theme
     toggle carries through; hues are the house palette */
  --black: var(--un-black);
  --ink: var(--un-text);
  --paper: var(--un-background);
  --white: #f4f4f2;
  --muted: var(--un-grey);
  --line: var(--cardline);
  --yellow: var(--un-yellow);
  --red: var(--un-chili);
  --blue: var(--un-lavender);
  --teal: var(--un-teal);
  --green: var(--un-palm);
  --step-color: var(--yellow);
  /* plan inks flip with the theme — hardcoded darks vanish on dark paper */
  --plan-wall: #2d3138;
  --plan-label: #464b53;
  --plan-tag: rgba(24, 24, 23, 0.4);
  --plan-grid: rgba(24, 24, 23, 0.045);
}
:root[data-theme="dark"] {
  --plan-wall: #c9ced8;
  --plan-label: #b3bac4;
  --plan-tag: rgba(244, 244, 242, 0.45);
  --plan-grid: rgba(244, 244, 242, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plan-wall: #c9ced8;
    --plan-label: #b3bac4;
    --plan-tag: rgba(244, 244, 242, 0.45);
    --plan-grid: rgba(244, 244, 242, 0.06);
  }
}
/* the site topbar scrolls away on this immersive page — its sticky
   position would fight the pinned floor plan's own geometry */
html .topbar { position: relative; }

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}



a {
  color: inherit;
}



.support-bar {
  position: relative;
  z-index: 19;
  padding: 8px 24px;
  color: var(--black);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.support-bar p {
  margin: 0;
}

.support-bar a {
  margin-inline: 5px;
}

.story-header {
  position: relative;
  padding: clamp(56px, 7vw, 96px) 24px clamp(28px, 3.5vw, 44px);
  color: var(--ink);
  background: var(--paper);
}
/* the drafting grid lives on its own layer BEHIND the content, so the
   dissolve only ever touches the grid — never the text */
.story-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(24, 24, 23, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 24, 23, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
  pointer-events: none;
}

.header-grid {
  position: relative;
  width: min(1000px, 100%);
  margin: 0 auto;
}
.header-text { grid-column: 1; grid-row: 1; }

/* the byline rides the site's .article-meta look; just space it here */
.header-credit { margin: 14px 0 0; max-width: 62ch; }

/* "How we made this" — shared accordion from the site stylesheet; ink
   rule like other utility contexts */
.made-section { max-width: 1000px; margin: 0 auto; padding: 8px 24px 56px; }
.made-section .madebox { --c: var(--c-confinement); --cui: var(--c-confinement); }

.visual-date {
  margin: 0;
  color: var(--muted);
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 600;
}

h1 {
  margin: 0;
  max-width: 570px;
  font-family: var(--f-disp);
  font-size: clamp(34px, 4.6vw, 68px);
  font-weight: 600;
  line-height: 1.02;
  text-wrap: balance;
  letter-spacing: 0;
}

.dek {
  margin: 0.45em 0 0;
  max-width: 52ch;
  font-family: var(--f-body);
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.content-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--f-ui);
  font-size: 13px;
}

.scrolly {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(480px, 0.96fr) minmax(360px, 0.72fr);
  gap: clamp(48px, 7vw, 110px);
  padding: 0 clamp(24px, 4vw, 60px);
}

.visual-column {
  position: relative;
}

.visual-sticky {
  position: sticky;
  top: 18px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px 0;
}

.visual-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--black);
}

.visual-meta h2 {
  margin: 3px 0 0;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}


.floorplan {
  position: relative;
  width: min(100%, calc((100vh - 310px) * 1.06));
  aspect-ratio: 1.06;
  min-height: 0;
  margin: 16px auto 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--plan-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--plan-grid) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
}

.plan {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
  opacity: 0;
  pointer-events: none;
}

/* a move reads bigger than a restyle: the old home leaves the frame,
   a beat of empty paper, then the next home arrives */
.plan.is-home {
  opacity: 1;
  animation: planIn 640ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.plan-leaving {
  animation: planOut 420ms ease-in both;
}

@keyframes planOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.88) translateY(14px); }
}

@keyframes planIn {
  from { opacity: 0; transform: scale(0.88) translateY(-14px); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .plan.is-home, .plan-leaving { animation: none; }
}

.ph-tag {
  font-family: var(--f-ui, system-ui);
  font-size: 15px;
  font-style: italic;
  fill: var(--plan-tag);
}

.room {
  fill: var(--paper);
  stroke: var(--plan-wall);
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
  transition: fill 350ms ease, opacity 350ms ease;
}

/* ── motion layer: the plan performs the story ─────────────────────
   Blueprint before it's theirs; the house draws itself in when they
   buy it; calls accumulate; the ring closes; the home goes dark. */
.house-shell .door,
.house-shell .door-gap,
.house-shell .plan-labels {
  opacity: 1;
}

.door {
  fill: none;
  stroke: var(--plan-wall);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.room-porch { fill-opacity: 0.35; }

/* the apartment draws smaller inside the same frame; labels compensate for
   the zoomed-out viewBox so type stays readable */
.plan-apartment .plan-labels { font-size: 32px; }
.plan-apartment .hers-label { font-size: 46px; }

.door-gap {
  fill: var(--paper);
  stroke: none;
}

.plan-labels {
  fill: var(--plan-label);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3px;
  stroke-linejoin: round;
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
}








/* ── the camera moves, the house doesn't ─────────────────────────
   The same drawing all the way through — but the framing drifts with
   the story: closer as pressure builds, held tight through the calls
   and the shut-in pandemic year, pulled back at the flight, and left
   at a distance once the home is gone. Slow eases; never a snap. */
.house-shell {
  transition: opacity 900ms ease, filter 900ms ease,
    transform 1600ms cubic-bezier(0.3, 0, 0.2, 1);
  transform-box: view-box;
  transform-origin: 50% 50%;
}
.floorplan[data-state="beginning"] .house-shell { transform: scale(0.96); }
.floorplan[data-state="family"] .house-shell {
  transform: scale(1.04);
  transform-origin: 44% 40%;   /* toward the family side of the house */
}
.floorplan[data-state="pressure"] .house-shell {
  transform: scale(1.06);
  transform-origin: 47% 47%;
}
.floorplan[data-state="calls"] .house-shell {
  transform: scale(1.08);
  transform-origin: 50% 48%;
}
.floorplan[data-state="flight"] .house-shell {
  transform: scale(0.98);      /* the first pull-back — distance */
  transform-origin: 50% 55%;
}
.floorplan[data-state="pandemic"] .house-shell {
  transform: scale(1.07);      /* shut in again */
  transform-origin: 48% 45%;
}
.floorplan[data-state="protective"] .house-shell {
  transform: scale(1);
  transform-origin: 50% 50%;
}
.floorplan[data-state="removed"] .house-shell {
  transform: scale(0.88);      /* seen from far away now */
}
@media (prefers-reduced-motion: reduce) {
  .house-shell { transition: opacity 900ms ease, filter 900ms ease; transform: none !important; }
}
.floorplan[data-state="removed"] .house-shell {
  opacity: 0.3;
  filter: saturate(0.15);
}



.apartment-door {
  stroke: var(--teal);
  stroke-width: 5;
}

.hers-label {
  fill: var(--teal);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 20px;
}

/* ── outro: the stat gets a full-viewport beat ───────────────────── */


.hers-label {
  fill: var(--ink);
  font-family: var(--f-head);
  font-size: 22px;
  font-weight: 800;
  text-anchor: middle;
}

/* the 14 calls as a tally under the frame — a count, not locations.
   Builds during the escalation step, stays through the house era. */
.tally {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 300ms ease;
}
.floorplan[data-state="calls"] .tally { opacity: 1; }
.tally i {
    width: 1.5px;
    height: 16px;
    margin-right: 6.5px;
    border-radius: 1px;
    background: var(--red);
    opacity: 0;
    transform: scaleY(0.4);
    transform-origin: bottom;
    transition: opacity 260ms ease, transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
.tally i.on {
    opacity: 0.85;
    transform: scaleY(1);
  }
  .tally i:nth-child(5n) {
    margin-left: -27px;
    margin-right: 17px;
    transform: scaleY(0.4) rotate(64deg);
  }
  .tally i:nth-child(5n).on {
    transform: scaleY(1.4) rotate(64deg);
  }
@media (prefers-reduced-motion: reduce) { .tally i { transition: none; } }

.visual-status {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.visual-status p {
  margin: 0;
}

.progress-track {
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  background: #deddd6;
}

.progress-track span {
  display: block;
  width: 10%;
  height: 100%;
  background: var(--step-color);
  transition: width 350ms ease, background-color 350ms ease;
}

.plan-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.story-column {
  padding: 24vh 0 30vh;
}

.story-step {
  min-height: 76vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 0;
  opacity: 0.58;
  transition: opacity 350ms ease;
}

.story-step.active {
  opacity: 1;
}

.story-step h2 {
  margin: 10px 0 18px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.story-step p:last-child {
  margin: 0;
  font-family: var(--f-body);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.75;
  text-wrap: pretty;
}

.outro {
  padding: clamp(70px, 9vw, 120px) 24px;
  color: var(--ink);
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.outro-inner {
  width: min(860px, 100%);
  margin: 0 auto;
}

.outro h2 {
  margin: 0 0 18px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.outro-graf,
.outro-service {
  max-width: 62ch;
  margin: 0 0 1.55em;
  font-family: var(--f-body);
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.75;
  text-wrap: pretty;
}
.outro-service { margin-bottom: 0; }
.outro-service a { color: inherit; text-underline-offset: 3px; }





.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



@media (max-width: 820px) {
  .project-bar {
    grid-template-columns: auto 1fr auto;
    padding: 0 16px;
  }

  .news21-mark {
    display: none;
  }

  .unsettled-mark {
    justify-self: start;
  }

  .support-bar {
    padding-inline: 12px;
  }

  .story-header {
    padding-inline: 20px;
  }

  .header-grid {
    grid-template-columns: 1fr;
  }

  .content-note {
    grid-column: 1;
  }

  .content-note {
    margin-top: 4px;
  }

  .scrolly {
    --mobile-visual-height: 50vh;
    display: block;
    padding: 0;
  }

  .visual-column {
    position: sticky;
    z-index: 5;
    top: 0;
    height: var(--mobile-visual-height);
    min-height: 350px;
    pointer-events: none;
  }

  .visual-sticky {
    position: relative;
    top: auto;
    min-height: 0;
    height: 100%;
    padding: 14px 18px 16px;
    color: var(--white);
    background: var(--black);
  }

  .visual-meta {
    align-items: center;
    padding-bottom: 8px;
    border-color: #53534f;
  }

  .visual-meta h2 {
    max-width: 260px;
    font-size: 22px;
  }

  .visual-date {
    font-size: 13px;
  }

  .floorplan {
    flex: 1 1 auto;
    width: min(100%, 420px);
    min-height: 0;
    margin: 8px auto;
    background: var(--paper);
  }

  .visual-status,
  .plan-note {
    display: none;
  }

  .progress-track {
    margin-top: 3px;
    background: #44443f;
  }

  .story-column {
    position: relative;
    z-index: 4;
    margin-top: calc(var(--mobile-visual-height) * -1);
    padding: 0 18px 20vh;
  }

  .story-step {
    min-height: 110vh;
    margin: 0 auto;
    padding: calc(var(--mobile-visual-height) + 42px) 24px 64px;
    justify-content: flex-start;
    color: var(--ink);
    background: var(--paper);
    border-top: 6px solid var(--step-color);
    opacity: 0.68;
  }

  .story-step.active {
    opacity: 1;
  }

  .story-step h2 {
    font-size: 24px;
  }

  .story-step p:last-child {
    font-size: 17px;
  }
}

@media (max-width: 480px) {
  .scrolly {
    --mobile-visual-height: 47vh;
  }

  .project-link {
    font-size: 11px;
  }

  .support-bar span {
    display: none;
  }

  .support-bar a {
    display: inline-block;
  }

  h1 {
    font-size: 54px;
  }



  .dek {
    font-size: 19px;
  }

  .visual-column {
    min-height: 330px;
    height: var(--mobile-visual-height);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
