/* Homepage hero: isometric estate field.
   Loaded only by index.html. All colour comes from the site tokens in styles.css
   except the four categorical group hues, which live in hero-estate.js because
   the canvas needs them as numbers. */

.hero-estate {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: clamp(1.4rem, 3vw, 2.2rem);
}

/* the copy and the field share this band; the control sits under both */
.hero-estate .hero-editorial {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* without this the eyebrow pill stretches to the column width */
  align-items: flex-start;
}

.estate-controls-row {
  position: relative;
  z-index: 2;
  width: min(1180px, 92vw);
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
}

.hero-estate .estate-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  cursor: crosshair;
  /* let a vertical swipe still scroll the page over the hero */
  touch-action: pan-y;
}

.hero-estate .estate-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    var(--bg) 20%,
    rgba(250, 247, 242, 0.74) 46%,
    rgba(250, 247, 242, 0) 74%
  );
}

/* .container and .hero-editorial are the same element here, so constraining it
   would shrink the container and its auto margins would re-centre the copy.
   Constrain the children instead and the gutter is preserved. */
.hero-estate .hero-editorial {
  position: relative;
  z-index: 2;
}

.hero-estate .hero-editorial > * {
  max-width: min(640px, 62%);
}

.hero-estate .hero-editorial h1 {
  font-size: clamp(2.1rem, 3.4vw, 3.05rem);
  line-height: 1.06;
}

.hero-estate .hero-editorial .lede {
  font-size: 1.02rem;
}

.hero-estate h1 em {
  font-style: italic;
  color: var(--primary);
}

/* Segmented control: group the estate by one of seven dimensions.
   The JS does not build it where the field is hidden, so an unbuilt
   container must not render as an empty pill. */
.estate-controls:empty {
  display: none;
}

.estate-controls {
  position: relative;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  /* if it ever cannot fit, scroll it rather than wrap it */
  overflow-x: auto;
  scrollbar-width: none;
}

.estate-controls::-webkit-scrollbar {
  display: none;
}

.estate-controls .estate-ind {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: var(--primary);
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.25, 1),
    width 0.34s cubic-bezier(0.2, 0.8, 0.25, 1), height 0.2s ease;
}

.estate-controls button {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  flex: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  background: none;
  border: 0;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s;
}

.estate-controls button[aria-checked="true"] {
  color: #fff;
}

.estate-controls button:focus-visible {
  box-shadow: var(--ring);
}

@media (max-width: 900px) {
  .hero-estate .hero-editorial > * {
    max-width: none;
  }
}

/* Below this the field is more clutter than signal, and skipping it keeps the
   phone build cheap. The JS checks computed display and never starts a loop. */
@media (max-width: 760px) {
  .hero-estate {
    min-height: 0;
  }
  .hero-estate .estate-field,
  .hero-estate .estate-scrim {
    display: none;
  }
  .estate-controls {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .estate-controls .estate-ind {
    transition: none;
  }
}
