:root {
  color-scheme: dark;
  --ink: #f8f3ea;
  --muted: rgba(248, 243, 234, 0.64);
  --line: rgba(176, 229, 255, 0.42);
  --hot: #9eeaff;
  --hot-2: #f1ff9b;
  --glass: rgba(5, 12, 16, 0.48);
  --glass-strong: rgba(4, 8, 10, 0.72);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #030405;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.stage-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #030405;
}

.stage-shell::before {
  content: "";
  position: absolute;
  inset: -4%;
  z-index: -6;
  background: url("/assets/signal-main.jpg") center / cover no-repeat;
  filter: blur(26px) saturate(0.9) brightness(0.52);
  transform: scale(1.08);
}

.stage-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(158, 234, 255, 0.28) 18.5% 19.2%, transparent 20% 48%, rgba(241, 255, 155, 0.22) 49% 49.8%, transparent 50.4%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 7px);
  mix-blend-mode: screen;
}

.stage-shell.is-meet-glitching::after {
  animation: meetRealityBridge 520ms ease-out both;
}

.stage-shell.is-meet-glitching-back::after {
  animation-duration: 430ms;
}

.stage-shell.is-meet-glitching .scene-media.is-active {
  animation: meetFrameBlend 520ms ease-out both;
}

.stage-shell.is-meet-glitching-back .scene-media.is-active {
  animation-duration: 430ms;
}

.stage-shell.is-gated .hotspot-layer,
.stage-shell.is-gated .micro-button {
  opacity: 0 !important;
  pointer-events: none !important;
}

.scene-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(var(--drift-x, 0), var(--drift-y, 0), 0) scale(1.035);
  transition: opacity 180ms ease, visibility 180ms ease, transform 500ms ease-out, filter 500ms ease-out;
  user-select: none;
}

.scene-media.is-active {
  opacity: 1;
  visibility: visible;
}

.scene-image {
  z-index: -5;
  filter: saturate(0.96) contrast(1.06) brightness(0.98);
  animation: sceneBreath 9s ease-in-out infinite alternate;
}

.scene-video {
  z-index: -4;
  background: #030405;
}

#reverseVideo {
  z-index: -4;
}

#holdFrame {
  z-index: -4;
}

#phoneHomeVideo,
#phoneHomeReverseVideo,
#phoneHomeHoldFrame {
  z-index: -4;
}

.scene-vignette,
.scene-scanlines,
.scene-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-vignette {
  z-index: -3;
  background:
    radial-gradient(circle at 35% 32%, rgba(166, 222, 255, 0.14), transparent 22rem),
    radial-gradient(circle at 71% 45%, rgba(241, 255, 155, 0.09), transparent 18rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.08) 46%, rgba(0, 0, 0, 0.48)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.2) 68%, rgba(0, 0, 0, 0.34));
}

.scene-scanlines {
  z-index: -2;
  opacity: 0.09;
  background-image: linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 100% 5px;
  mix-blend-mode: screen;
}

.scene-noise {
  z-index: -1;
  opacity: 0.12;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 11px),
    linear-gradient(23deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 7px);
  mix-blend-mode: screen;
}

.scene-topbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(86px, 0.42fr) 1fr minmax(68px, 0.42fr);
  align-items: start;
  pointer-events: none;
}

.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 45%, rgba(154, 255, 116, 0.13), transparent 20rem),
    radial-gradient(circle at 26% 22%, rgba(158, 234, 255, 0.1), transparent 18rem),
    linear-gradient(180deg, rgba(1, 4, 6, 0.14), rgba(1, 4, 6, 0.66));
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.entry-panel {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  max-height: calc(100svh - 48px);
  overflow: auto;
  border: 1px solid rgba(154, 255, 116, 0.34);
  border-radius: 3px;
  padding: 20px 20px 22px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(154, 255, 116, 0.1), transparent 44%),
    repeating-linear-gradient(0deg, rgba(154, 255, 116, 0.04) 0 1px, transparent 1px 7px),
    rgba(2, 9, 7, 0.6);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.58), inset 0 0 42px rgba(154, 255, 116, 0.07);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.74);
  cursor: default;
}

.entry-panel::before,
.entry-panel::after {
  content: "";
  position: absolute;
  height: 1px;
  left: 12px;
  right: 12px;
  background: linear-gradient(90deg, transparent, rgba(241, 255, 155, 0.56), transparent);
}

.entry-panel::before {
  top: 9px;
}

.entry-panel::after {
  bottom: 9px;
}

.entry-code {
  margin-bottom: 0.7rem;
  color: rgba(154, 255, 116, 0.86);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.entry-meta {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.95rem;
  color: rgba(248, 243, 234, 0.56);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.entry-panel h1 {
  margin: 0 0 0.8rem;
  color: rgba(241, 255, 155, 0.92);
  font-size: clamp(1.7rem, 3.2vw, 2.55rem);
  line-height: 0.9;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.redaction-lines {
  display: grid;
  gap: 7px;
  margin-bottom: 1rem;
}

.redaction-lines i {
  display: block;
  height: 11px;
  background: linear-gradient(90deg, #010302 0 60%, transparent 60% 66%, #010302 66% 100%);
  box-shadow: inset 0 0 0 1px rgba(154, 255, 116, 0.05);
}

.redaction-lines i:nth-child(2) {
  width: 88%;
}

.redaction-lines i:nth-child(3) {
  width: 72%;
}

.entry-panel p {
  margin: 0 0 1.1rem;
  border: 1px solid rgba(154, 255, 116, 0.18);
  padding: 1rem 1.05rem;
  color: rgba(181, 255, 134, 0.92);
  background: rgba(0, 0, 0, 0.18);
  font-family: "Snell Roundhand", "Segoe Script", "Bradley Hand", cursive;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.62;
  text-align: center;
}

.entry-warning {
  margin: -0.2rem 0 1rem;
  color: #ff715d;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
}

.entry-button {
  min-height: 38px;
  width: 100%;
  border: 1px solid rgba(154, 255, 116, 0.46);
  border-radius: 2px;
  padding: 0 14px;
  color: rgba(241, 255, 155, 0.95);
  background: rgba(154, 255, 116, 0.07);
  box-shadow: 0 0 28px rgba(154, 255, 116, 0.14), inset 0 0 22px rgba(154, 255, 116, 0.08);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  grid-column: 2;
  justify-self: center;
  display: grid;
  gap: 4px;
  text-align: center;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.78),
    0 0 16px rgba(154, 255, 116, 0.58),
    0 0 34px rgba(154, 255, 116, 0.24);
}

.brand-mark span {
  color: rgba(181, 255, 134, 0.98);
  font-family: "Snell Roundhand", "Segoe Script", "Bradley Hand", cursive;
  font-size: clamp(2rem, 5.6vw, 3.5rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: 0;
  text-transform: none;
}

.brand-mark small {
  color: rgba(235, 255, 222, 0.82);
  font-size: clamp(0.54rem, 1.4vw, 0.72rem);
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.caption-kicker,
.panel-line {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.back-button,
.micro-button {
  min-height: 32px;
  border: 1px solid rgba(176, 229, 255, 0.34);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(3, 11, 16, 0.28);
  box-shadow: 0 0 28px rgba(158, 234, 255, 0.08);
  cursor: pointer;
  opacity: 0.72;
  pointer-events: auto;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.micro-button {
  grid-column: 3;
  justify-self: end;
  padding: 0 10px;
}

.back-button {
  justify-self: start;
  min-height: 44px;
  min-width: 86px;
  border-color: rgba(241, 255, 155, 0.72);
  padding: 0 18px;
  color: rgba(241, 255, 155, 0.96);
  background:
    linear-gradient(135deg, rgba(241, 255, 155, 0.18), rgba(3, 11, 16, 0.46)),
    rgba(3, 11, 16, 0.54);
  box-shadow: 0 0 36px rgba(241, 255, 155, 0.16), 0 14px 40px rgba(0, 0, 0, 0.36);
  font-size: 0.68rem;
  opacity: 0.96;
}

.back-button:hover,
.back-button:focus-visible {
  border-color: rgba(241, 255, 155, 0.98);
  outline: none;
  background:
    linear-gradient(135deg, rgba(241, 255, 155, 0.24), rgba(3, 11, 16, 0.5)),
    rgba(3, 11, 16, 0.66);
}

.back-button.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hotspot-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 1;
  pointer-events: none;
}

.hotspot-layer.is-closed {
  opacity: 1;
  pointer-events: none;
}

.stage-shell:not(.is-gated):not(.is-in-scene) .hotspot-layer {
  opacity: 1 !important;
  pointer-events: none;
}

.stage-shell.is-in-scene .hotspot-layer {
  opacity: 0 !important;
  pointer-events: none !important;
}

.action-hotspot {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(176, 229, 255, 0.32);
  border-radius: 999px;
  padding: 0 12px 0 8px;
  color: var(--ink);
  background: rgba(3, 9, 12, 0.34);
  box-shadow: 0 15px 44px rgba(0, 0, 0, 0.24), 0 0 36px rgba(158, 234, 255, 0.08);
  cursor: pointer;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  transition: opacity 240ms ease, transform 180ms ease, border-color 180ms ease;
}

.action-hotspot:hover,
.action-hotspot:focus-visible {
  border-color: rgba(176, 229, 255, 0.8);
  outline: none;
  transform: translate(-50%, -50%) scale(1.04);
}

.hotspot-dot {
  width: 14px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, var(--hot) 22% 58%, rgba(158, 234, 255, 0.08) 62%);
  box-shadow: 0 0 20px rgba(158, 234, 255, 0.88);
  animation: hotspotPulse 2.2s ease-in-out infinite;
}

.hotspot-label {
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hotspot-listen {
  left: 73%;
  top: 42%;
}

.hotspot-memory {
  left: 24%;
  top: 54%;
}

.hotspot-future {
  left: 57%;
  top: 72%;
}

.hotspot-phone {
  left: 58%;
  top: 58%;
}

.hotspot-fly {
  left: 72%;
  top: 67%;
}

.hotspot-alien {
  left: 43%;
  top: 70%;
}

.hotspot-alien .hotspot-dot {
  background: radial-gradient(circle, #fff 0 16%, #b5ff86 20% 58%, rgba(181, 255, 134, 0.08) 62%);
  box-shadow: 0 0 24px rgba(181, 255, 134, 0.86);
}

.hotspot-lookup {
  left: 50%;
  top: 55%;
}

.caption-stack {
  position: fixed;
  left: clamp(18px, 5vw, 52px);
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 11;
  width: min(360px, calc(100vw - 36px));
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms ease, transform 420ms ease;
  pointer-events: none;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.84);
}

.caption-stack.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.caption-stack h1 {
  margin: 0 0 0.55rem;
  max-width: 360px;
  font-size: clamp(1.45rem, 3.8vw, 2.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.caption-stack p {
  margin: 0;
  color: rgba(248, 243, 234, 0.82);
  font-size: clamp(0.92rem, 2vw, 1.1rem);
  line-height: 1.5;
}

.caption-kicker {
  margin-bottom: 0.8rem;
  color: var(--hot-2);
}

.earth-warning {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: grid;
  place-items: center;
  padding: max(92px, calc(72px + env(safe-area-inset-top))) 24px 28px;
  pointer-events: none;
}

.earth-warning-flash {
  position: absolute;
  left: 50%;
  top: max(14px, env(safe-area-inset-top));
  width: min(660px, calc(100vw - 28px));
  border: 1px solid rgba(255, 70, 54, 0.92);
  padding: 0.9rem 1rem 0.82rem;
  color: rgba(255, 238, 234, 0.99);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 9px),
    rgba(118, 0, 0, 0.88);
  box-shadow: 0 0 64px rgba(255, 28, 20, 0.48), inset 0 0 36px rgba(255, 28, 20, 0.22);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: 0;
}

.earth-warning-card {
  width: min(560px, calc(100vw - 42px));
  min-height: min(270px, 42svh);
  display: grid;
  align-content: center;
  gap: 1rem;
  border: 1px solid rgba(255, 55, 36, 0.62);
  border-radius: 3px;
  padding: 26px 26px 28px;
  background:
    linear-gradient(135deg, rgba(255, 55, 36, 0.13), transparent 48%),
    repeating-linear-gradient(0deg, rgba(255, 55, 36, 0.045) 0 1px, transparent 1px 7px),
    rgba(12, 2, 2, 0.86);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.72), 0 0 70px rgba(255, 24, 18, 0.24);
  text-align: center;
  transform: translateY(10px) scale(0.98);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: auto;
}

.earth-warning-card span {
  display: block;
  margin-bottom: 0.85rem;
  color: rgba(255, 85, 68, 0.96);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.earth-warning-card p {
  margin: 0;
  color: rgba(255, 230, 224, 0.95);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 760;
  line-height: 1.52;
}

.earth-warning-back {
  justify-self: center;
  min-height: 44px;
  min-width: min(260px, 100%);
  border: 1px solid rgba(255, 116, 99, 0.72);
  border-radius: 3px;
  padding: 0 18px;
  color: rgba(255, 238, 234, 0.98);
  background: rgba(255, 55, 36, 0.18);
  box-shadow: 0 0 34px rgba(255, 28, 20, 0.2), inset 0 0 22px rgba(255, 28, 20, 0.09);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: auto;
}

.earth-warning-back:focus-visible,
.earth-warning-back:hover {
  outline: none;
  border-color: rgba(255, 210, 204, 0.92);
  background: rgba(255, 55, 36, 0.28);
}

.earth-warning.is-truth .earth-warning-flash,
.earth-warning.is-home .earth-warning-flash {
  border-color: rgba(154, 255, 116, 0.88);
  color: rgba(235, 255, 222, 0.99);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 9px),
    rgba(16, 78, 24, 0.86);
  box-shadow: 0 0 58px rgba(154, 255, 116, 0.34), inset 0 0 36px rgba(154, 255, 116, 0.16);
}

.earth-warning.is-truth .earth-warning-card,
.earth-warning.is-home .earth-warning-card {
  border-color: rgba(154, 255, 116, 0.48);
  background:
    linear-gradient(135deg, rgba(154, 255, 116, 0.12), transparent 48%),
    repeating-linear-gradient(0deg, rgba(154, 255, 116, 0.042) 0 1px, transparent 1px 7px),
    rgba(2, 12, 5, 0.86);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.72), 0 0 66px rgba(154, 255, 116, 0.17);
}

.earth-warning.is-truth .earth-warning-card span,
.earth-warning.is-home .earth-warning-card span {
  color: rgba(185, 255, 144, 0.96);
}

.earth-warning.is-truth .earth-warning-back,
.earth-warning.is-home .earth-warning-back {
  border-color: rgba(154, 255, 116, 0.6);
  color: rgba(235, 255, 222, 0.98);
  background: rgba(154, 255, 116, 0.12);
  box-shadow: 0 0 34px rgba(154, 255, 116, 0.18), inset 0 0 22px rgba(154, 255, 116, 0.07);
}

.earth-warning.is-home .earth-warning-flash {
  border-color: rgba(176, 229, 255, 0.82);
  color: rgba(232, 250, 255, 0.99);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 9px),
    rgba(8, 46, 58, 0.84);
  box-shadow: 0 0 58px rgba(158, 234, 255, 0.3), inset 0 0 36px rgba(158, 234, 255, 0.14);
}

.earth-warning.is-home .earth-warning-card {
  border-color: rgba(176, 229, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(176, 229, 255, 0.12), transparent 48%),
    repeating-linear-gradient(0deg, rgba(176, 229, 255, 0.04) 0 1px, transparent 1px 7px),
    rgba(2, 9, 13, 0.84);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.72), 0 0 66px rgba(158, 234, 255, 0.16);
}

.earth-warning.is-home .earth-warning-card span {
  color: rgba(176, 229, 255, 0.96);
}

.earth-warning.is-reset .earth-warning-flash {
  width: min(760px, calc(100vw - 28px));
  border-color: rgba(255, 28, 20, 0.98);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 8px),
    rgba(144, 0, 0, 0.92);
  box-shadow: 0 0 82px rgba(255, 28, 20, 0.58), inset 0 0 44px rgba(255, 28, 20, 0.26);
}

.earth-warning.is-reset .earth-warning-card {
  border-color: rgba(255, 28, 20, 0.72);
}

.earth-warning.is-flashing .earth-warning-flash {
  animation: warningFlash 900ms steps(2, end) both;
}

.earth-warning.is-solid .earth-warning-flash {
  opacity: 1;
}

.earth-warning.is-solid .earth-warning-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 360ms ease, transform 360ms ease;
}

.holo-panel {
  position: fixed;
  z-index: 15;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(158, 234, 255, 0.16), transparent 42%),
    var(--glass);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 0 38px rgba(158, 234, 255, 0.08);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.holo-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.agent-panel {
  left: clamp(14px, 4vw, 44px);
  right: clamp(14px, 50vw, 44vw);
  bottom: calc(28px + env(safe-area-inset-bottom));
  min-height: 300px;
}

.alien-call-panel {
  border-radius: 4px;
  border-color: rgba(154, 255, 116, 0.42);
  background:
    linear-gradient(135deg, rgba(154, 255, 116, 0.13), transparent 42%),
    repeating-linear-gradient(0deg, rgba(154, 255, 116, 0.035) 0 1px, transparent 1px 7px),
    rgba(2, 10, 8, 0.72);
  box-shadow: 0 26px 92px rgba(0, 0, 0, 0.5), inset 0 0 42px rgba(154, 255, 116, 0.08);
}

.alien-call-panel .panel-line strong {
  color: rgba(181, 255, 134, 0.95);
}

.alien-call-controls {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.alien-call-controls button {
  min-height: 42px;
  border: 1px solid rgba(154, 255, 116, 0.42);
  border-radius: 3px;
  color: rgba(235, 255, 222, 0.96);
  background: rgba(154, 255, 116, 0.1);
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.alien-call-controls button:disabled {
  cursor: default;
  opacity: 0.38;
}

.alien-call-controls button:not(:disabled):hover,
.alien-call-controls button:not(:disabled):focus-visible {
  border-color: rgba(181, 255, 134, 0.9);
  outline: none;
}

.alien-hangup-button {
  border-color: rgba(255, 113, 93, 0.44) !important;
  color: rgba(255, 224, 218, 0.96) !important;
  background: rgba(255, 55, 36, 0.13) !important;
}

.memory-panel {
  left: clamp(14px, 8vw, 90px);
  top: 48%;
  width: min(360px, calc(100vw - 28px));
}

.future-panel {
  right: clamp(14px, 6vw, 70px);
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: min(370px, calc(100vw - 28px));
}

.panel-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.panel-line strong {
  color: var(--hot-2);
  font-size: 0.58rem;
}

.holo-panel p,
.messages p {
  margin: 0;
  color: rgba(248, 243, 234, 0.82);
  line-height: 1.55;
}

.messages {
  min-height: 114px;
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 0.6rem;
  padding-right: 4px;
}

.agent-message,
.user-message,
.system-message {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(176, 229, 255, 0.24);
  border-radius: 8px;
  padding: 0.68rem 0.78rem;
  background: rgba(1, 7, 10, 0.3);
}

.user-message {
  justify-self: end;
  color: #11150f;
  background: rgba(241, 255, 155, 0.82);
  border-color: rgba(241, 255, 155, 0.74);
}

.system-message {
  color: var(--muted);
}

.agent-form {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  margin-top: 0.8rem;
}

.agent-form input,
.agent-form button {
  min-height: 40px;
  border: 1px solid rgba(176, 229, 255, 0.34);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(1, 7, 10, 0.36);
}

.agent-form input {
  min-width: 0;
  padding: 0 13px;
  outline: none;
}

.agent-form button {
  cursor: pointer;
  font-weight: 900;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes sceneBreath {
  from {
    filter: saturate(0.9) contrast(1.04) brightness(0.92);
  }
  to {
    filter: saturate(1.04) contrast(1.1) brightness(1.02);
  }
}

@keyframes hotspotPulse {
  50% {
    opacity: 0.58;
    transform: scale(0.76);
  }
}

@keyframes realityTear {
  0% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateX(0);
  }
  12% {
    opacity: 0.75;
    clip-path: inset(12% 0 70% 0);
    transform: translateX(-11px);
  }
  30% {
    opacity: 0.42;
    clip-path: inset(54% 0 30% 0);
    transform: translateX(14px);
  }
  48% {
    opacity: 0.8;
    clip-path: inset(31% 0 45% 0);
    transform: translateX(-7px);
  }
  68% {
    opacity: 0.5;
    clip-path: inset(4% 0 82% 0);
    transform: translateX(9px);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

@keyframes meetRealityBridge {
  0% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateX(0);
  }
  18% {
    opacity: 0.48;
    clip-path: inset(20% 0 58% 0);
    transform: translateX(-5px);
  }
  38% {
    opacity: 0.74;
    clip-path: inset(0 0 0 0);
    transform: translateX(4px);
  }
  62% {
    opacity: 0.36;
    clip-path: inset(44% 0 30% 0);
    transform: translateX(-3px);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

@keyframes meetFrameBlend {
  0% {
    filter: saturate(1) contrast(1.08) brightness(0.98);
    transform: translate3d(var(--drift-x, 0), var(--drift-y, 0), 0) scale(1.035);
  }
  18% {
    filter: saturate(1.22) contrast(1.18) hue-rotate(8deg) brightness(0.96);
    transform: translate3d(calc(var(--drift-x, 0) - 4px), var(--drift-y, 0), 0) scale(1.043);
  }
  38% {
    filter: saturate(0.88) contrast(1.28) hue-rotate(-8deg) brightness(1.04);
    transform: translate3d(calc(var(--drift-x, 0) + 5px), calc(var(--drift-y, 0) - 2px), 0) scale(1.048);
  }
  62% {
    filter: saturate(1.28) contrast(1.12) brightness(1.1);
    transform: translate3d(calc(var(--drift-x, 0) - 2px), calc(var(--drift-y, 0) + 2px), 0) scale(1.045);
  }
  100% {
    filter: saturate(1) contrast(1.08) brightness(1);
    transform: translate3d(var(--drift-x, 0), var(--drift-y, 0), 0) scale(1.035);
  }
}

@keyframes warningFlash {
  0%,
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  14%,
  30%,
  54%,
  78% {
    opacity: 1;
    filter: brightness(1.25) saturate(1.35);
    transform: translateX(-50%) scale(1.02);
  }
  22%,
  42%,
  66% {
    opacity: 0.36;
    filter: brightness(1.8) saturate(1.6);
    transform: translateX(calc(-50% + 7px)) scale(1);
  }
}

@media (max-width: 760px) {
  .scene-image,
  .scene-video {
    object-fit: cover;
    object-position: 48% 44%;
  }

  .hotspot-listen {
    left: 74%;
    top: 43%;
  }

  .hotspot-memory {
    left: 23%;
    top: 51%;
  }

  .hotspot-future {
    left: 58%;
    top: 73%;
  }

  .hotspot-phone {
    left: 61%;
    top: 59%;
  }

  .hotspot-fly {
    left: 35%;
    top: 70%;
  }

  .hotspot-alien {
    left: 72%;
    top: 70%;
  }

  .hotspot-lookup {
    left: 50%;
    top: 54%;
  }

  .scene-topbar {
    grid-template-columns: minmax(96px, 0.48fr) 1fr minmax(72px, 0.48fr);
  }

  .back-button {
    min-height: 48px;
    min-width: 96px;
    padding: 0 18px;
    font-size: 0.72rem;
  }

  .agent-panel,
  .memory-panel,
  .future-panel {
    left: 14px;
    right: 14px;
    width: auto;
  }

  .agent-panel {
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-height: min(430px, calc(100svh - 92px));
    overflow: hidden;
  }

  .alien-call-controls {
    grid-template-columns: 1fr;
  }

  .messages {
    max-height: min(210px, 35svh);
  }

  .memory-panel {
    top: auto;
    bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .future-panel {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .caption-stack {
    bottom: calc(26px + env(safe-area-inset-bottom));
  }

  .caption-stack h1 {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .earth-warning {
    place-items: center;
    padding: max(82px, calc(64px + env(safe-area-inset-top))) 14px calc(28px + env(safe-area-inset-bottom));
  }

  .earth-warning-flash {
    top: max(10px, env(safe-area-inset-top));
    width: min(360px, calc(100vw - 20px));
    padding: 0.82rem 0.72rem 0.76rem;
    font-size: 0.6rem;
    line-height: 1.45;
    letter-spacing: 0.14em;
  }

  .earth-warning-card {
    width: min(360px, calc(100vw - 28px));
    min-height: min(245px, 37svh);
    padding: 20px 17px 21px;
  }

  .earth-warning-card p {
    font-size: 1rem;
  }

  .earth-warning-back {
    min-height: 48px;
    width: min(270px, 100%);
  }

  .entry-gate {
    place-items: start center;
    padding: max(84px, calc(64px + env(safe-area-inset-top))) 18px 18px;
  }

  .entry-panel {
    width: min(470px, calc(100vw - 36px));
    max-height: calc(100svh - 104px);
    padding: 18px 18px 20px;
  }

  .entry-panel h1 {
    font-size: clamp(1.55rem, 5.6vw, 2.45rem);
  }

  .entry-panel p {
    padding: 0.95rem;
    font-size: 1.04rem;
    line-height: 1.58;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
