/* Philadelphia housing timeline — house-styled rebuild of Matthew and
   Bella's piece. Page chrome rides the site tokens (so the theme toggle
   works); each era keeps its own accent hue for the stage and rail. */

.pht-header { padding: clamp(56px, 7vw, 96px) 24px clamp(20px, 3vw, 36px); }
.pht-header .header-credit { margin-top: 26px; }
.pht-wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.pht-header h1 {
  margin: 0.2em 0 0;
  max-width: 640px;
  font-family: var(--f-disp);
  font-size: clamp(34px, 4.6vw, 68px);
  font-weight: 600;
  line-height: 1.02;
  text-wrap: balance;
}
.pht-dek {
  margin: 0.45em 0 0;
  max-width: 62ch;
  font-family: var(--f-body);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--un-grey);
  text-wrap: pretty;
}

.pht-shell { max-width: 1200px; margin: 0 auto; padding: 0 28px 30px; }

/* ── sticky stage: era year, morphing title, skyline ───────────────── */
.pht-stage {
  position: sticky;
  top: 72px; /* clear the site topbar — same offset the voices rail uses */
  z-index: 5;
  padding-top: 10px;
  background: var(--un-background);  padding-bottom: 12px;
}
.pht-morph { display: block; width: 100%; height: auto; max-height: 22vh; }
.pht-title {
  font-family: var(--f-disp);
  font-weight: 600;
  fill: var(--un-text);
  text-anchor: middle;
  dominant-baseline: middle;
}
.pht-progress {
  height: 3px;
  margin-top: 6px;
  background: color-mix(in srgb, var(--un-text) 12%, transparent);
}
#progress-fill {
  width: 0;
  height: 100%;
  background: var(--active-accent, var(--un-yellow));
  transition: width 120ms linear;
}

/* ── the eras ──────────────────────────────────────────────────────── */
.pht-sections { list-style: none; margin: 0; padding: 0; }
.timeline-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
  padding: clamp(44px, 6vw, 84px) 0;
  border-top: 1px solid var(--hairline);
}
.timeline-section:first-child { border-top: 0; }
.section-copy { max-width: 64ch; }
.section-copy h2 {
  margin: 6px 0 0;
  font-family: var(--f-disp);
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 600;
  line-height: 1.05;
}
.section-period {
  margin: 6px 0 18px;
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--un-grey);
  font-variant-numeric: tabular-nums;
}
.section-copy p {
  margin: 0 0 1.25em;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
}

/* era figures: photos, charts, models — quiet frames, no tilt */
.era-figure { margin: 0; min-width: 0; }
.era-figure img { width: 100%; display: block; }
.era-caption {
  margin-top: 9px;
  font-family: var(--f-ui);
  font-size: 13px;
  line-height: 1.5;
  color: var(--un-grey);
}
.model-viewer-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--cardline);
  background: var(--surface);
  touch-action: none;
  cursor: grab;
  overflow: hidden;
}
.model-viewer-frame:active { cursor: grabbing; }
.model-viewer-frame canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.model-status {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--un-grey);
}
.model-viewer-frame:not([data-state]) [data-loading],
.model-viewer-frame[data-state="loading"] [data-loading] { display: flex; }
.model-viewer-frame[data-state="error"] [data-error] { display: flex; }
.model-hint {
  margin-top: 6px;
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--un-grey);
}

/* PDF link card, in the site's card grammar */
.pdf-link-frame {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--cardline);
  background: var(--surface);
  text-decoration: none;
  color: var(--un-text);
}
.pdf-corner-label {
  display: inline-block;
  padding: 2px 8px;
  background: var(--section-accent, var(--un-chili));
  color: #fff;
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 700;
}
.pdf-preview-title {
  display: block;
  margin: 12px 0 8px;
  font-family: var(--f-head);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.pdf-source-label {
  display: block;
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--un-grey);
}
.pdf-open-link {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pht-frame { width: 100%; border: 0; display: block; }

.pht-made { max-width: 1200px; margin: 0 auto; padding: 8px 28px 56px; }
.pht-made .madebox { --c: var(--un-text); --cui: var(--un-text); }

@media (max-width: 900px) {
  .pht-wrap, .pht-shell, .pht-made { padding-inline: 20px; }
  .timeline-section { grid-template-columns: 1fr; align-items: start; }
  .pht-morph { max-height: 24vh; }
}
