/* Split hero with the interactive 3D building (hero.media = "3d").
   Loaded only when that mode is on; overrides the centred video hero. */

.hero.hero-3d {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  grid-template-areas:
    "content stage"
    "content caption";
  align-items: center;
  align-content: center;
  gap: 1rem;
  text-align: left;
  padding: 5.5rem 0 2rem;
  background:
    radial-gradient(ellipse 60% 70% at 72% 52%, #f3f2ec 0%, rgba(243, 242, 236, 0) 70%),
    linear-gradient(180deg, #e9eae3 0%, #e5e7df 100%);
}

.hero-3d .hero-media {
  position: relative;
  inset: auto;
  grid-area: stage;
  height: min(80vh, 780px);
  min-height: 420px;
}

.hero-3d .hero-media-overlay {
  display: none;
}

.hero-3d .hero-content {
  grid-area: content;
  align-items: flex-start;
  max-width: none;
  margin: 0;
  padding-left: max(var(--content-padding), calc((100vw - var(--max-width)) / 2 + var(--content-padding)));
  padding-right: 0;
}

.hero-3d .hero-name {
  /* Sized for the three-line "AEC Technology / Leadership & / AI Advisory". */
  font-size: clamp(2rem, 3.6vw, 3.4rem);
}

.hero-3d .hero-social {
  justify-content: flex-start;
}

.hero-3d .hero-social-link {
  color: var(--text-muted);
}

.hero-3d .hero-social-link:hover {
  color: var(--text-primary);
}

/* The base hint is white-with-shadow for legibility over video. */
.hero-3d .hero-scroll-hint,
.hero-3d .hero-scroll-hint-action {
  color: var(--text-secondary);
  text-shadow: none;
}

/* Caption under the model (hero.modelCaption) */
.hero3d-caption {
  grid-area: caption;
  align-self: start;
  max-width: 60ch;
  margin: 0 auto;
  padding: 0 var(--content-padding);
  font-size: var(--text-caption);
  line-height: 1.55;
  color: var(--text-secondary);
  text-align: center;
  text-wrap: pretty;
}

.hero3d-caption strong {
  color: var(--text-primary);
}

/* Stage */
.hero3d {
  position: absolute;
  inset: 0;
}

.hero3d-poster,
.hero3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Beats `.hero-media img { object-fit: cover }`; contain mirrors the
   viewer's own fit, so poster and canvas line up. */
.hero-media .hero3d-poster {
  object-fit: contain;
  transition: opacity 0.8s ease;
  pointer-events: none; /* faded out, it must not swallow hover/drag */
}

.hero3d-canvas {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s ease;
  cursor: grab;
  touch-action: pan-y; /* vertical swipes still scroll the page */
  outline: none;
}

.hero3d-canvas:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: -2px;
  border-radius: 12px;
}

.hero3d-ready .hero3d-canvas {
  opacity: 1;
}

.hero3d-ready .hero3d-poster {
  opacity: 0;
}

/* Interaction hint, gone after the first touch */
.hero3d::after {
  content: "Hover a floor for details · Click a pin for street views";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.75rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-overline);
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.hero3d-ready::after {
  opacity: 1;
}

.hero3d-ready.hero3d-touched::after {
  opacity: 0;
}

@media (pointer: coarse) {
  .hero3d::after {
    content: "Tap a floor or pin for details";
  }
}

/* "Turn to explore" bubble: placed by hero3d.js above the roof, tail down */
.hero3d-bubble {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem 0.5rem 0.75rem;
  background: var(--text-primary);
  color: #fff;
  border-radius: 999px;
  font-family: var(--font-body, inherit);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(26, 26, 26, 0.18);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero3d-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-radius: 0 0 3px 0;
  transform: translateX(-50%) rotate(45deg);
}

.hero3d-bubble svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.hero3d-ready .hero3d-bubble {
  opacity: 1;
  transform: translate(-50%, -100%);
  transition-delay: 0.6s;
  animation: hero3d-bob 2.8s ease-in-out 1.4s infinite;
}

.hero3d-ready .hero3d-bubble.hero3d-bubble-gone {
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-6px);
  transition-delay: 0s;
  animation: none;
}

@keyframes hero3d-bob {
  0%, 100% { transform: translate(-50%, -100%); }
  50% { transform: translate(-50%, -100%) translateY(-5px); }
}

/* Street-level view pins: hero3d.js sets transform to the anchor's screen point */
.hero3d-pin {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.hero3d-ready .hero3d-pin {
  opacity: 1;
  pointer-events: auto;
}

.hero3d-ready .hero3d-pin.hero3d-pin-away {
  opacity: 0;
  pointer-events: none;
}

.hero3d-pin-dot {
  position: absolute;
  left: -15px;
  top: -15px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--text-primary), 0 6px 16px rgba(26, 26, 26, 0.25);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.hero3d-pin-dot svg {
  width: 16px;
  height: 16px;
}

/* Soft pulse so the pins read as clickable */
.hero3d-pin-dot::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: hero3d-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes hero3d-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  80%, 100% { transform: scale(1.9); opacity: 0; }
}

.hero3d-pin:hover .hero3d-pin-dot,
.hero3d-pin:focus-visible .hero3d-pin-dot {
  transform: scale(1.12);
  background: var(--text-primary);
  color: #fff;
}

.hero3d-pin:focus-visible {
  outline: none;
}

.hero3d-pin:focus-visible .hero3d-pin-dot {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text-primary);
}

.hero3d-pin-label {
  position: absolute;
  left: 22px;
  top: 0;
  transform: translateY(-50%) translateX(-4px);
  padding: 0.35rem 0.65rem;
  background: var(--text-primary);
  color: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero3d-pin-flip .hero3d-pin-label {
  left: auto;
  right: 22px;
  transform: translateY(-50%) translateX(4px);
}

.hero3d-pin-label::after {
  content: " \2192  View";
  font-weight: 400;
  opacity: 0.75;
}

.hero3d-pin:hover .hero3d-pin-label,
.hero3d-pin:focus-visible .hero3d-pin-label {
  opacity: 1;
  transform: translateY(-50%);
}

/* Lightbox (native <dialog>, appended to <body>) */
.hero3d-lightbox {
  position: fixed;
  inset: 0;
  margin: auto; /* the site's global reset zeroes the UA dialog centring */
  width: min(1100px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg, 12px);
  background: #111;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.hero3d-lightbox::backdrop {
  background: rgba(16, 16, 16, 0.72);
  backdrop-filter: blur(3px);
}

.hero3d-lightbox[open] {
  animation: hero3d-lightbox-in 0.25s ease;
}

@keyframes hero3d-lightbox-in {
  from { opacity: 0; transform: scale(0.97); }
}

.hero3d-lightbox-fig {
  margin: 0;
}

.hero3d-lightbox-img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
}

.hero3d-lightbox-cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 0.85rem 1.1rem 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.hero3d-lightbox-cap strong {
  color: #fff;
  font-family: var(--font-display, inherit);
}

.hero3d-lightbox-count {
  margin-left: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.hero3d-lightbox-close,
.hero3d-lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.7);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hero3d-lightbox-close:hover,
.hero3d-lightbox-nav:hover {
  background: rgba(17, 17, 17, 0.92);
}

.hero3d-lightbox-close:focus-visible,
.hero3d-lightbox-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.hero3d-lightbox-close {
  top: 12px;
  right: 12px;
}

.hero3d-lightbox-nav {
  top: calc(50% - 40px);
}

.hero3d-lightbox-prev {
  left: 12px;
}

.hero3d-lightbox-next {
  right: 12px;
}

/* Floor metrics card */
.hero3d-card {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 268px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(26, 26, 26, 0.14);
  padding: 0.9rem 1rem;
  font-size: var(--text-caption);
  color: var(--text-secondary);
  backdrop-filter: blur(6px);
}

.hero3d-card-eyebrow {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.1rem;
}

.hero3d-card-use {
  font-family: var(--font-mono);
  font-size: var(--text-overline);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

.hero3d-card-rows {
  display: grid;
  gap: 0.2rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
}

.hero3d-card-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.hero3d-card-k {
  color: var(--text-muted);
  text-transform: capitalize;
}

.hero3d-card-v {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hero3d-card-feats {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}

.hero3d-card-feats li {
  position: relative;
  padding-left: 0.9rem;
  line-height: 1.45;
}

.hero3d-card-feats li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.hero3d-card-foot {
  margin: 0.6rem 0 0;
  font-size: var(--text-overline);
  color: var(--text-muted);
  line-height: 1.4;
}

.hero3d-card-foot strong {
  color: var(--text-secondary);
}

/* Scroll mode (html.motion-3d): the canvas and its overlays live in a fixed
   layer behind the page content (z-index -1, see motion.css); motion/motion.js moves the building through
   it. Opacity and visibility are set inline per scroll frame. */
.hero3d-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.hero3d-layer .hero3d-canvas {
  touch-action: pan-y;
}

/* Between the interactive rests the building is scenery: no input, no pins. */
.hero3d-layer.hero3d-passive .hero3d-canvas {
  pointer-events: none;
}

.hero3d-ready.hero3d-passive .hero3d-pin,
.hero3d-passive .hero3d-bubble,
.hero3d-chip-on .hero3d-bubble {
  opacity: 0;
  pointer-events: none;
}

.hero3d-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(26, 26, 26, 0.12);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero3d-chip svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.hero3d-chip-on .hero3d-chip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Floor plans (scroll story): street-view pins hide while a plan is open;
   room labels are placed by hero3d.js once the floors above have lifted. */
.hero3d-ready.hero3d-planmode .hero3d-pin {
  opacity: 0;
  pointer-events: none;
}

.hero3d-plan-labels {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero3d-plan-labels.is-on {
  opacity: 1;
}

.hero3d-plan-label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.hero3d-plan-label.is-unit {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Stacked on narrow screens: text first, building below */
@media (max-width: 900px) {
  .hero.hero-3d {
    grid-template-columns: 1fr;
    grid-template-areas: "content" "stage" "caption";
    text-align: center;
    padding-top: 6rem;
  }
  .hero-3d .hero-content {
    align-items: center;
    padding: 0 var(--content-padding);
  }
  .hero-3d .hero-social {
    justify-content: center;
  }
  .hero-3d .hero-media {
    height: 58vh;
    min-height: 340px;
  }
  .hero3d-card {
    width: min(268px, calc(100% - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero3d-poster,
  .hero3d-canvas,
  .hero3d-bubble {
    transition: none;
  }
  .hero3d-ready .hero3d-bubble,
  .hero3d-pin-dot::before,
  .hero3d-lightbox[open] {
    animation: none;
  }
}
