/* ============================================================
   Residential 3D tour hero: the three cards as tour stops
   Three hero cards become stops on a 3D tour walkthrough.
   A gold route runs along the card edges, a Matterport-style
   navigation disc glides stop to stop, and each stop wakes up.
   Everything is scoped under .tour-route.
   ============================================================ */

.tour-route {
  --tr-gold: #f3c66d;
  --tr-gold-deep: #c48d26;
  --tr-station: 44px;
  --tr-cream: 245, 241, 232;
}

/* No JS: the rail and the control stay out of the way and the
   cards render exactly like the original hero metrics. */
.tour-route__rail,
.tour-route__toggle {
  display: none;
}

/* Side by side, the stations hang half their height above the cards:
   push the row down so they keep clear of the hero buttons. */
.tour-route.is-ready:not(.is-vertical) {
  margin-top: calc(var(--tr-station) / 2 + 4px);
}

.tour-route.is-ready .tour-route__rail {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* ---------- cards ---------- */

.tour-route.is-ready > .tour-route__stop.hero__metric {
  --a: 0;
  position: relative;
  /* side padding eases down on narrow rows so longer titles stay on one line */
  padding: calc(var(--tr-station) / 2 + 12px) clamp(14px, 2vw, 18px) 16px;
  align-content: start;
}

.tour-route.is-ready > .tour-route__stop::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  border: 1px solid rgba(243, 198, 109, 0.62);
  background:
    radial-gradient(120% 85% at 50% 0%, rgba(243, 198, 109, 0.17), rgba(243, 198, 109, 0) 62%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.07), rgba(255, 253, 248, 0));
  box-shadow:
    0 0 0 1px rgba(243, 198, 109, 0.08),
    0 0 34px rgba(196, 141, 38, 0.2),
    0 24px 46px rgba(3, 9, 4, 0.34);
  opacity: var(--a);
  pointer-events: none;
}

.tour-route.is-ready > .tour-route__stop strong {
  color: var(--tr-gold-deep);
  color: color-mix(in srgb, var(--tr-gold) calc(var(--a) * 100%), var(--tr-gold-deep));
}

.tour-route.is-ready > .tour-route__stop span {
  color: rgba(var(--tr-cream), calc(0.72 + 0.2 * var(--a)));
}

/* direct child only: the text-wrap shorthand would reset .tr-keep's nowrap */
.tour-route.is-ready > .tour-route__stop > span {
  text-wrap: pretty;
}

.tour-route.is-ready > .tour-route__stop strong {
  text-wrap: balance;
}

/* Hyphenated words ("follow-up") never split across lines. */
.tour-route__stop .tr-keep {
  display: inline;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  white-space: nowrap;
}

/* ---------- route line ---------- */

.tour-route__line,
.tour-route__visited,
.tour-route__trail {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 2px;
}

.tour-route__line {
  height: 1px;
  background: linear-gradient(90deg,
    rgba(243, 198, 109, 0) 0,
    rgba(243, 198, 109, 0.46) 34px,
    rgba(243, 198, 109, 0.46) calc(100% - 34px),
    rgba(243, 198, 109, 0) 100%);
}

.tour-route__line::after {
  content: "";
  position: absolute;
  inset: -2px 0;
  background: inherit;
  filter: blur(3px);
  opacity: 0.7;
}

.tour-route__visited {
  height: 1.5px;
  margin-top: -0.25px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg,
    rgba(243, 198, 109, 0) 0,
    rgba(250, 216, 140, 0.95) 34px,
    rgba(255, 226, 160, 1) 100%);
  box-shadow: 0 0 8px rgba(243, 198, 109, 0.55);
  opacity: 0;
}

.tour-route__trail {
  width: 96px;
  height: 2px;
  margin-top: -0.5px;
  transform-origin: 100% 50%;
  background: linear-gradient(90deg, rgba(255, 244, 222, 0), rgba(255, 246, 228, 0.95));
  box-shadow: 0 0 10px rgba(255, 226, 160, 0.5);
  opacity: 0;
}

/* ---------- navigation disc ---------- */

.tour-route__disc {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0 2.4px, rgba(255, 255, 255, 0) 3.6px),
    radial-gradient(circle, rgba(255, 255, 255, 0.36) 0, rgba(255, 255, 255, 0.14) 72%);
  box-shadow:
    inset 0 0 0 1.6px rgba(255, 255, 255, 0.96),
    0 0 0 3px rgba(255, 255, 255, 0.09),
    0 0 14px rgba(255, 255, 255, 0.5),
    0 0 34px rgba(243, 198, 109, 0.48);
  opacity: 0;
  will-change: transform, opacity;
}

/* ---------- stations ---------- */

.tour-route__station {
  --a: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--tr-station);
  height: var(--tr-station);
  margin: calc(var(--tr-station) / -2) 0 0 calc(var(--tr-station) / -2);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 26%, #24331f 0, #121e12 58%, #0b140b 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 10px 24px rgba(2, 8, 3, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.tour-route__station::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(243, 198, 109, 0.95);
  box-shadow:
    0 0 0 4px rgba(243, 198, 109, 0.1),
    0 0 26px rgba(243, 198, 109, 0.46),
    inset 0 0 14px rgba(243, 198, 109, 0.16);
  opacity: var(--a);
  pointer-events: none;
}

.tour-route__ripple {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 12px rgba(243, 198, 109, 0.35);
  opacity: 0;
  pointer-events: none;
}

.tour-route__icon,
.tour-route__progress {
  display: block;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-route__icon {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  stroke-width: 1.5;
}

.tour-route__icon .tr-thin {
  stroke-width: 1;
}

.tour-route__icon .tr-base {
  stroke: rgba(var(--tr-cream), 0.86);
  opacity: calc(0.72 - 0.56 * var(--a));
}

.tour-route__icon .tr-live {
  stroke: var(--tr-gold);
  opacity: var(--a);
  filter: drop-shadow(0 0 2.5px rgba(243, 198, 109, 0.6));
}

.tour-route__icon .tr-dots circle,
.tour-route__icon .tr-plan-dot {
  fill: currentColor;
  stroke: none;
}

.tour-route__icon .tr-base .tr-dots {
  color: rgba(var(--tr-cream), 0.86);
}

.tour-route__icon .tr-live .tr-dots,
.tour-route__icon .tr-plan-dot {
  color: var(--tr-gold);
}

.tour-route__icon .tr-plan-pulse {
  stroke-width: 0.8;
}

/* Shared icon parts for every page: filled accents, popping dots, pulse rings. */
.tour-route__icon .tr-base {
  color: rgba(var(--tr-cream), 0.86);
}

.tour-route__icon .tr-live {
  color: var(--tr-gold);
}

.tour-route__icon .tr-fill {
  fill: currentColor;
  stroke: none;
}

.tour-route__icon .tr-heavy {
  stroke-width: 1.9;
}

.tour-route__icon .tr-pop {
  transform-box: fill-box;
  transform-origin: center;
}

.tour-route__icon .tr-pulse {
  fill: none;
  stroke-width: 0.8;
  opacity: 0;
}

.tour-route__progress {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
  stroke-width: 1.6;
}

.tour-route__progress .tr-base {
  stroke: rgba(var(--tr-cream), 0.16);
  opacity: calc(1 - 0.4 * var(--a));
}

.tour-route__progress .tr-live {
  stroke: var(--tr-gold);
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  opacity: var(--a);
  filter: drop-shadow(0 0 3px rgba(243, 198, 109, 0.7));
}

.tour-route__badge {
  position: absolute;
  top: -4px;
  right: -5px;
  z-index: 2;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tr-gold);
  box-shadow: 0 0 0 2px #0f1a0f, 0 4px 12px rgba(243, 198, 109, 0.45);
  opacity: 0;
  transform: scale(0.4);
}

.tour-route__badge svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: #17350e;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- pause / play ---------- */

.tour-route.is-ready.is-animated .tour-route__toggle {
  display: grid;
}

.tour-route__toggle {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 19, 11, 0.36);
  color: rgba(var(--tr-cream), 0.74);
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 180ms ease, border-color 180ms ease, color 180ms ease;
}

.tour-route__toggle:hover,
.tour-route__toggle:focus-visible {
  opacity: 1;
  color: var(--tr-gold);
  border-color: rgba(243, 198, 109, 0.6);
}

.tour-route__toggle:focus-visible {
  outline: 2px solid var(--tr-gold);
  outline-offset: 3px;
}

.tour-route__toggle svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-route__toggle-play {
  display: none;
}

.tour-route__toggle-play path {
  fill: currentColor;
  stroke-width: 1.2;
}

.tour-route.is-paused .tour-route__toggle-pause {
  display: none;
}

.tour-route.is-paused .tour-route__toggle-play {
  display: block;
}

/* ---------- vertical route (stacked cards) ---------- */

.tour-route.is-vertical .tour-route__line {
  width: 1px;
  background: linear-gradient(180deg,
    rgba(243, 198, 109, 0) 0,
    rgba(243, 198, 109, 0.46) 28px,
    rgba(243, 198, 109, 0.46) calc(100% - 28px),
    rgba(243, 198, 109, 0) 100%);
}

.tour-route.is-vertical .tour-route__line::after {
  inset: 0 -2px;
}

.tour-route.is-vertical .tour-route__visited {
  width: 1.5px;
  margin: 0 0 0 -0.25px;
  transform-origin: 50% 0;
  background: linear-gradient(180deg,
    rgba(243, 198, 109, 0) 0,
    rgba(250, 216, 140, 0.95) 28px,
    rgba(255, 226, 160, 1) 100%);
}

.tour-route.is-vertical .tour-route__trail {
  width: 2px;
  height: 72px;
  margin: 0 0 0 -0.5px;
  transform-origin: 50% 100%;
  background: linear-gradient(180deg, rgba(255, 244, 222, 0), rgba(255, 246, 228, 0.95));
}

/* Side by side, the hero can run edge to edge: keep the card row at least
   16px off the screen edges, growing smoothly with the viewport. */
.tour-route.is-ready:not(.is-vertical) {
  max-width: calc(100% - 32px);
}

@media (max-width: 768px) {
  .tour-route {
    --tr-station: 40px;
  }

  .tour-route.is-ready {
    padding-left: calc(var(--tr-station) / 2 + 4px);
  }

  .tour-route.is-ready > .tour-route__stop.hero__metric {
    padding: 15px 16px 15px calc(var(--tr-station) / 2 + 14px);
    text-align: left;
    align-content: center;
  }

  .tour-route.is-ready > .tour-route__stop::before {
    background:
      radial-gradient(90% 120% at 0% 50%, rgba(243, 198, 109, 0.16), rgba(243, 198, 109, 0) 62%),
      linear-gradient(90deg, rgba(255, 253, 248, 0.06), rgba(255, 253, 248, 0));
  }
}

/* Phones: the hero runs edge to edge, so give the stack its own gutters
   (the stations hang 20px past the cards' left edge). */
@media (max-width: 600px) {
  .tour-route.is-ready {
    padding-left: calc(var(--tr-station) / 2 + 14px);
    padding-right: 14px;
  }
}

/* ---------- reduced motion: calm, fully readable, nothing moves ---------- */

.tour-route.is-static .tour-route__disc,
.tour-route.is-static .tour-route__trail,
.tour-route.is-static .tour-route__visited,
.tour-route.is-static .tour-route__ripple {
  display: none;
}
