/* Hero animation stage. Sizes follow the stage width through container units. */
.hero-anim { padding: 8px 16px 32px; }
.hero-card {
  --ink: #18223a;
  --ink-dim: rgba(24, 34, 58, 0.62);
  --glass: rgba(255, 255, 255, 0.78);
  --line: rgba(24, 48, 96, 0.1);
  --accent: #2563eb;
  position: relative;
  max-width: 928px; /* The text column of .container. */
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(120% 95% at 45% 42%, #ffffff 0%, #f6f8fc 55%, #eaf0f8 100%);
  border: 1px solid #e2e8f2;
  box-shadow: 0 22px 50px -28px rgba(30, 50, 90, 0.35);
  color: var(--ink);
  container-type: inline-size;
  font-family: "Inter", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.hero-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 82vh;
  width: 100%;
  overflow: hidden;
  user-select: none;
}
.hero-stage canvas.hero-gl,
.hero-stage canvas.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Loading */
.hero-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim);
  transition: opacity 0.4s;
}
.hero-loading i {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.18); border-top-color: var(--accent);
  animation: hero-spin 0.9s linear infinite;
}
.hero-anim.ready .hero-loading { opacity: 0; pointer-events: none; }
.hero-anim.failed .hero-loading { opacity: 1; }
.hero-anim.failed .hero-loading i { display: none; }
@keyframes hero-spin { to { transform: rotate(360deg); } }

/* Caption: a row above the stage, so it never covers the scene. */
.hero-caption {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; row-gap: 2px;
  min-height: 64px; padding: 16px 22px 6px; box-sizing: border-box;
  pointer-events: none;
}
.hero-caption > * { opacity: 0; transform: translateY(6px); transition: opacity 0.45s ease, transform 0.45s ease; }
.hero-caption.show > * { opacity: 1; transform: none; }
.hero-caption .hc-title { margin: 0; font-size: clamp(17px, 1.9cqw, 23px); line-height: 1.25; font-weight: 700; text-align: left; color: var(--ink); }

/* End card: the overview figure once the animation has played. */
.hero-teaser {
  position: absolute; inset: 0;
  display: grid; place-items: center; padding: 3cqw 4cqw;
  background: radial-gradient(120% 95% at 45% 42%, #ffffff 0%, #f6f8fc 60%, #eef2f8 100%);
  opacity: 0; visibility: hidden;
}
.hero-teaser img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: 10px; box-shadow: 0 18px 40px -24px rgba(30, 50, 90, 0.45);
  transform: scale(var(--zoom, 1));
}
.hero-replay {
  position: absolute; right: 18px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(24, 48, 96, 0.14);
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 16px -10px rgba(30, 50, 90, 0.5);
}
.hero-replay::before { content: "\21bb"; font-size: 15px; line-height: 1; }
.hero-replay:hover { background: #fff; }
.hero-replay:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* iPhone 17 Pro, landscape, seen from the screen side. */
.hero-phone {
  --w: clamp(190px, 23cqw, 290px);
  position: absolute; left: 0; top: 0;
  width: var(--w); aspect-ratio: 150 / 71.9;
  visibility: hidden;
  will-change: transform, opacity;
  filter: drop-shadow(0 26px 30px rgba(30, 45, 80, 0.32));
}
.hero-phone-body {
  position: absolute; inset: 0;
  border-radius: calc(var(--w) * 0.118);
  padding: calc(var(--w) * 0.0125);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 22%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.35)),
    linear-gradient(90deg, #f0925a, #c9612f 45%, #e98a52 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 180, 0.5), inset 0 0 0 calc(var(--w) * 0.004) rgba(120, 50, 20, 0.6);
}
.hero-screen {
  position: relative; width: 100%; height: 100%;
  border-radius: calc(var(--w) * 0.106);
  overflow: hidden; background: #000;
  box-shadow: 0 0 0 calc(var(--w) * 0.009) #050505;
}
/* The camera app in landscape: a 4:3 view between the island side and the shutter side. */
.hero-view {
  position: absolute; top: 0; bottom: 0; left: 50%;
  aspect-ratio: 4 / 3; transform: translateX(-50%);
  overflow: hidden; background: #111;
}
.hero-feed {
  position: absolute; inset: 0;
  background-image: url("photos.webp");
  background-repeat: no-repeat;
  transform-origin: 50% 50%;
}
.hero-lidar {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(124, 236, 255, 0.22) 0 1px, transparent 1px calc(var(--w) * 0.03)),
    repeating-linear-gradient(90deg, rgba(124, 236, 255, 0.22) 0 1px, transparent 1px calc(var(--w) * 0.03)),
    linear-gradient(180deg, rgba(255, 70, 70, 0.26), rgba(255, 196, 70, 0.18) 38%, rgba(70, 220, 255, 0.22) 68%, rgba(90, 80, 255, 0.3));
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 22%, transparent 34%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 22%, transparent 34%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  animation: hero-sweep 2.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes hero-sweep {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to { -webkit-mask-position: -50% 0; mask-position: -50% 0; }
}
.hero-reticle { position: absolute; inset: 24% 28%; }
.hero-reticle i { position: absolute; width: 16%; height: 22%; border: 1.5px solid rgba(255, 214, 10, 0.9); }
.hero-reticle i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.hero-reticle i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.hero-reticle i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.hero-reticle i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.hero-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.hero-progress {
  position: absolute; left: 22%; right: 22%; bottom: 6%;
  height: calc(var(--w) * 0.007); border-radius: 999px; background: rgba(255, 255, 255, 0.28); overflow: hidden;
}
.hero-progress b { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
.hero-island {
  position: absolute; left: 1.6%; top: 50%; transform: translateY(-50%);
  width: 4.6%; height: 33%; border-radius: 999px; background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.hero-ui-left, .hero-ui-right {
  position: absolute; top: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9em;
  font-size: calc(var(--w) * 0.024); font-weight: 600; color: #fff; letter-spacing: 0.02em;
}
.hero-ui-left { left: 7.5%; width: 10%; }
.hero-ui-right { right: 2%; width: 14%; }
.hero-rec { display: flex; flex-direction: column; align-items: center; gap: 0.45em; }
.hero-rec i { width: 0.7em; height: 0.7em; border-radius: 50%; background: #ff453a; animation: hero-blink 1s steps(2) infinite; }
.hero-rec b { font-variant-numeric: tabular-nums; font-weight: 600; padding: 0.15em 0.45em; border-radius: 0.35em; background: #ff3b30; }
.hero-tag { padding: 0.2em 0.55em; border-radius: 999px; background: rgba(124, 236, 255, 0.2); color: #c9f7ff; font-size: 0.86em; }
.hero-shutter {
  width: calc(var(--w) * 0.088); aspect-ratio: 1; border-radius: 50%;
  border: calc(var(--w) * 0.0065) solid #fff; display: grid; place-items: center;
}
.hero-shutter i { width: 44%; height: 44%; border-radius: 22%; background: #ff3b30; }
.hero-count { display: flex; flex-direction: column; align-items: center; line-height: 1.2; color: rgba(255, 255, 255, 0.7); font-size: 0.86em; font-weight: 500; }
.hero-count b { color: #fff; font-size: 1.18em; font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes hero-blink { 50% { opacity: 0.2; } }
/* Buttons: the side button and Camera Control on top, the Action button and volume below. */
.hero-key { position: absolute; height: calc(var(--w) * 0.012); border-radius: 3px; background: linear-gradient(180deg, #f29a64, #b9572a); }
.hk-side, .hk-camera { top: calc(var(--w) * -0.008); }
.hk-action, .hk-up, .hk-down { bottom: calc(var(--w) * -0.008); }
.hk-side { left: 22%; width: 10%; }
.hk-camera { left: 58%; width: 9%; background: linear-gradient(180deg, #8f8f96, #4a4a50); }
.hk-action { left: 16%; width: 4.5%; }
.hk-up { left: 25%; width: 7%; }
.hk-down { left: 35%; width: 7%; }

/* Panels */
.hero-panel {
  position: absolute; right: 2.2cqw; bottom: calc(54px + 2.2cqw);
  width: clamp(250px, 27cqw, 330px);
  pointer-events: none;
}
.hp {
  position: absolute; right: 0; bottom: 0; width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -16px rgba(30, 50, 90, 0.35);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  font-size: 12.5px; line-height: 1.45;
}
.hero-anim.show-instruction .hp-instruction,
.hero-anim.show-training .hp-training { opacity: 1; transform: none; }
.hp-head { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); display: flex; align-items: center; gap: 10px; }
.hp-head b { color: var(--ink); font-size: 13px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.hp-legend { display: flex; flex-direction: column; gap: 3px; margin: 10px 0 12px; }
.hp-legend span { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); }
.hp-legend span::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.hp-legend b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.hp-card { display: grid; grid-template-columns: 38% 1fr; gap: 10px; align-items: start; opacity: 0; transition: opacity 0.3s; min-height: 92px; }
.hp-card.on { opacity: 1; }
.hp-goal { width: 100%; border-radius: 8px; background-image: url("goals.webp"); background-size: 100% 600%; background-repeat: no-repeat; box-shadow: 0 0 0 1px rgba(24, 48, 96, 0.12); }
.hp-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--tag, #333); }
.hp-text { margin: 6px 0 0; color: var(--ink); font-size: 12.5px; line-height: 1.45; min-height: 3em; }
.hp-prog { flex: 1; height: 3px; border-radius: 2px; background: rgba(24, 48, 96, 0.1); overflow: hidden; }
.hp-prog b { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #12b886); transform-origin: left; transform: scaleX(0); }
.hp-rollout { margin: 10px 0 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.hp-rollout p {
  margin: 5px 0 0; color: var(--ink); font-size: 12px; line-height: 1.4; min-height: 2.8em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hp-bars { display: grid; gap: 5px; }
.hp-bar { display: grid; grid-template-columns: 52px 1fr 46px; align-items: center; color: var(--ink-dim); font-size: 12px; }
.hp-bars i { height: 5px; border-radius: 3px; background: rgba(24, 48, 96, 0.08); overflow: hidden; }
.hp-bars b { display: block; height: 100%; border-radius: 3px; transform-origin: left; transform: scaleX(0); transition: transform 0.18s ease, background 0.18s; }
.hp-bars em { font-style: normal; text-align: right; color: var(--ink); font-size: 11.5px; font-variant-numeric: tabular-nums; }
[data-bar="prog"] { background: linear-gradient(90deg, #2563eb, #4dabf7); }
[data-bar="safe"] { background: linear-gradient(90deg, #0ca678, #38d9a9); }
[data-bar="stop"] { background: linear-gradient(90deg, #f08c00, #fcc419); }
.hp-training.bad-prog [data-bar="prog"], .hp-training.bad-safe [data-bar="safe"] { background: linear-gradient(90deg, #e03131, #ff8787); }
.hp-verdict {
  display: inline-block; margin-top: 9px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: rgba(37, 99, 235, 0.1); color: #1d4ed8;
  transition: background 0.2s, color 0.2s;
}
.hp-verdict:empty { visibility: hidden; }
.hp-verdict[data-tone="bad"] { background: rgba(224, 49, 49, 0.1); color: #c92a2a; }
.hp-verdict[data-tone="goal"] { background: rgba(12, 166, 120, 0.12); color: #087f5b; }

/* Chapters */
.hero-chapters {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px 12px;
  border-top: 1px solid #e6ebf3;
  background: rgba(255, 255, 255, 0.7);
}
.hero-play {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(24, 48, 96, 0.16); background: #fff;
  cursor: pointer; position: relative;
}
.hero-play::before, .hero-play::after {
  content: ""; position: absolute; top: 9px; width: 3px; height: 10px; border-radius: 1px; background: var(--ink);
}
.hero-play::before { left: 10px; }
.hero-play::after { left: 15px; }
.hero-play.paused::before { left: 11px; width: 0; height: 0; border-radius: 0; background: none; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--ink); top: 8px; }
.hero-play.paused::after { display: none; }
.finished .hero-play::before {
  content: "\21bb"; left: 0; top: 0; width: 100%; height: 100%; border: 0; background: none;
  display: grid; place-items: center; font-size: 15px; line-height: 1; color: var(--ink);
}
.hero-chapter {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  padding: 4px 6px; border: 0; background: none; cursor: pointer;
  color: var(--ink-dim); font: inherit; font-size: 12px; font-weight: 600; text-align: left;
}
.hero-chapter span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s; }
.hero-chapter.active span { color: var(--ink); }
.hero-chapter i { display: block; height: 3px; border-radius: 2px; background: rgba(24, 48, 96, 0.1); overflow: hidden; }
.hero-chapter b { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.hero-chapter:hover span { color: var(--ink); }
.hero-play:focus-visible, .hero-chapter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


@media (max-width: 700px) {
  .hero-anim { padding: 0; }
  .hero-card { border-radius: 0; }
  .hero-stage { aspect-ratio: 0.66; max-height: none; }
  .hero-caption { min-height: 52px; padding: 14px 16px 4px; column-gap: 10px; }
  .hero-phone { --w: min(50cqw, 230px); }
  .hero-teaser { padding: 16px; }
  .hero-panel { position: relative; left: auto; right: auto; bottom: auto; width: auto; height: 172px; margin: 0 12px 10px; }
  .hp-verdict { display: none; }
  .hp-rollout { margin: 8px 0 7px; padding-top: 7px; }
  .hp { padding: 11px 13px; font-size: 12px; }
  .hp-legend { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0; }
  .hp-legend b { margin-left: 2px; }
  .hp-card { min-height: 78px; }
  .hero-chapter { font-size: 11px; padding: 4px 3px; }
}
