/* The hero (a WebGL hologram of the office with live name tags) and "Step inside", where the
   hologram hands over to a real screenshot of the demo office. */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-h) + 96px) 0 clamp(56px, 11vh, 128px);
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 68% 42%, rgb(108 240 200 / 0.09), transparent 70%),
    radial-gradient(40% 40% at 20% 100%, rgb(70 120 255 / 0.06), transparent 70%),
    var(--bg);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  display: block;
}

/* Without WebGL the hero falls back to a dimmed shot of the real office. */
.hero.no-webgl {
  background: linear-gradient(90deg, var(--bg) 25%, rgb(6 8 11 / 0.55)), url("../../shots/office/lobby-wide.jpg") 70% 50% / cover;
}

.hero.no-webgl .hero-canvas,
.hero.no-webgl .hero-hud {
  display: none;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(6 8 11 / 0.92) 0%, rgb(6 8 11 / 0.55) 34%, transparent 62%),
    linear-gradient(0deg, var(--bg) 0%, transparent 28%),
    linear-gradient(180deg, rgb(6 8 11 / 0.6) 0%, transparent 22%);
}

.hero-copy {
  position: relative;
}

.hero-title {
  margin: 22px 0 26px;
  font-size: clamp(3rem, 7.2vw, 7.4rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hero-title .line > span {
  display: inline-block;
}

.hero-sub {
  max-width: 34rem;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.5vw, 1.3rem);
  line-height: 1.5;
}

/* Hero entrance is pure CSS, so the headline never waits on a script. */
.motion .hero-in {
  animation: hero-rise 1.2s var(--ease-out) both;
  animation-delay: calc(0.3s + var(--i) * 0.1s);
}

.motion .hero-title .hero-in {
  animation-name: hero-mask;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
  }
}

@keyframes hero-mask {
  from {
    transform: translateY(108%) rotate(2deg);
  }
}

/* Name tags that follow the crew in the 3D scene (positioned by js/hero-hud.js). */
.hero-hud {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.hud-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid rgb(108 240 200 / 0.28);
  border-radius: 999px;
  background: rgb(6 9 13 / 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
  will-change: transform;
}

.hud-tag.is-on {
  opacity: 1;
}

.hud-tag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 22px;
  background: linear-gradient(rgb(108 240 200 / 0.5), transparent);
}

.hud-avatar {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 600;
}

.hud-who {
  color: var(--text);
}

.hud-what::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 0.9em;
  margin-left: 3px;
  vertical-align: -0.1em;
  background: currentColor;
  animation: caret 1s steps(1) infinite;
}

.hud-tag.is-waiting {
  border-color: rgb(255 181 71 / 0.5);
}

.hud-tag.is-waiting .hud-avatar {
  background: rgb(255 181 71 / 0.16);
  color: var(--wait);
}

.hud-tag.is-waiting .hud-what {
  color: var(--wait);
}

.hud-tag.is-waiting::after {
  background: linear-gradient(rgb(255 181 71 / 0.6), transparent);
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

/* Step inside */
.reveal {
  position: relative;
  padding-top: clamp(96px, 16vh, 180px);
}

.reveal-head {
  display: grid;
  gap: 20px;
}

.reveal-head h2 {
  max-width: 14ch;
}

.reveal-stage {
  position: relative;
  width: min(1440px, 100% - 48px);
  margin: clamp(48px, 7vh, 88px) auto 0;
  perspective: 1600px;
}

.reveal-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    0 50px 140px -30px rgb(0 0 0 / 0.8),
    0 0 90px -20px rgb(108 240 200 / 0.22);
  transform-origin: 50% 0%;
}

.reveal-frame img {
  width: 100%;
}

.frame-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0 solid var(--accent);
  opacity: 0.9;
}

.frame-corner.tl {
  top: 14px;
  left: 14px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.frame-corner.tr {
  top: 14px;
  right: 14px;
  border-top-width: 2px;
  border-right-width: 2px;
}

.frame-corner.bl {
  bottom: 14px;
  left: 14px;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.frame-corner.br {
  bottom: 14px;
  right: 14px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 18%;
  background: linear-gradient(180deg, transparent, rgb(108 240 200 / 0.14) 85%, rgb(108 240 200 / 0.6) 100%);
  opacity: 0;
  pointer-events: none;
}

/* Callouts: a marker on the screenshot and a label beside it. Positions come from --x / --y. */
.callouts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.callout {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
}

.callout-dot {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: rgb(6 8 11 / 0.6);
  box-shadow: 0 0 0 6px rgb(108 240 200 / 0.12), 0 0 24px var(--accent-glow);
}

.callout-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.callout-label {
  position: absolute;
  display: block;
  left: 22px;
  top: -18px;
  width: max-content;
  max-width: 230px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgb(8 11 15 / 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.86rem;
  line-height: 1.35;
}

.callout-label strong {
  display: block;
  font-weight: 600;
}

.callout-label span {
  color: var(--muted);
}

.callout.flip .callout-label {
  left: auto;
  right: 22px;
}

@media (max-width: 900px) {
  .hero {
    align-items: flex-end;
    padding-top: calc(var(--nav-h) + 40vh);
  }

  .hero-shade {
    background:
      linear-gradient(0deg, var(--bg) 8%, rgb(6 8 11 / 0.85) 42%, transparent 72%),
      linear-gradient(180deg, rgb(6 8 11 / 0.6) 0%, transparent 22%);
  }

  .reveal-stage {
    width: calc(100% - 32px);
  }

  /* On small screens the callouts become a plain list under the screenshot. */
  .callouts {
    display: grid;
    gap: 10px;
    margin-top: 18px;
  }

  .callout {
    position: static;
  }

  .callout-dot {
    display: none;
  }

  .callout-label {
    position: static;
    width: auto;
    max-width: none;
  }
}
