/* OMEGA / Queen Chat — Portal Edition (v2: integrated + premium animations)
   Goal: feel like a portal embedded in the page, not a square form.
   Brand: cyan #00E5FF + blue #00AAFF + bg #0B0E14.
   Typography: Space Grotesk (body), JetBrains Mono (mono).
*/

/* ===== STAGE — the section that hosts the chat ===== */
.omega-stage {
  position: relative;
  /* Site integration: pull up into hero, soft fade into adjacent sections */
  margin-top: -80px;
  padding: 120px 16px clamp(80px, 10vw, 140px);
  overflow: hidden;
  isolation: isolate;
  /* WEB.GLASS 2026-05-22 perf diet: reserve final rendered height so the
     async-mounted omega-chat widget + cosmic canvas don't shift content.
     Baseline CLS = 0.819 (catastrophic) was largely driven by this section
     inflating from 0px to ~760px after JS boot. Height = header(~140) +
     chat composer + messages min-height(320) + padding(120 + 80..140). */
  min-height: 760px;
  /* Transparent layer over body's #0B0E14 — no hard color block */
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,170,255,0.08), transparent 70%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(0,229,255,0.05), transparent 70%);
  /* Soft fade top/bottom so adjacent sections bleed through */
  mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
}

/* ===== COSMIC WEBGL BACKGROUND — single Three.js canvas =====
   Replaces backdrop+bee-glow+hash-stream+hex-mesh+particles.
   All ambient motion is now rendered by js/queen-cosmic-bg.js.
*/
.omega-stage__cosmic {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: block;
}

/* When Queen is speaking, the cosmic core handles its own pulse via the JS API
   (QueenCosmicBG.setMode('speaking')). No CSS animation needed here. */

.omega-stage__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.omega-stage__header {
  text-align: center;
  margin-bottom: clamp(28px, 4vw, 44px);
  position: relative;
}

.omega-stage__eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #00E5FF;
  margin: 0 0 14px;
  text-transform: uppercase;
  opacity: 0.85;
}

.omega-stage__title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: #fff;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 0%, #BCE8FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.omega-stage__sub {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: rgba(255,255,255,0.6);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ===== VOICE TOGGLE — speaker icon in header ===== */
.omega-voice-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,0.22);
  background: rgba(0,229,255,0.05);
  color: #00E5FF;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.omega-voice-toggle:hover {
  background: rgba(0,229,255,0.14);
  border-color: rgba(0,229,255,0.55);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0,229,255,0.35);
}
.omega-voice-toggle:focus-visible {
  outline: 2px solid #00E5FF;
  outline-offset: 2px;
}
.omega-voice-toggle svg { width: 16px; height: 16px; }
.omega-voice-toggle[data-on="false"] { color: rgba(255,255,255,0.35); border-color: rgba(255,255,255,0.15); background: transparent; }
.omega-voice-toggle[data-on="true"]::after {
  /* tiny live dot when speaking */
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #00E5FF;
  box-shadow: 0 0 6px #00E5FF;
  opacity: 0;
  transition: opacity .2s;
}
body.queen-speaking .omega-voice-toggle[data-on="true"]::after { opacity: 1; animation: omegaVoiceDotBlink 1s ease-in-out infinite; }
@keyframes omegaVoiceDotBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ===== CHAT ROOT — the glass portal ===== */
#omega-chat-root {
  position: relative;
  display: block;
  border-radius: 24px 24px 32px 32px;
  background:
    linear-gradient(180deg, rgba(15,22,36,0.72) 0%, rgba(10,14,24,0.85) 100%);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow:
    0 30px 80px -20px rgba(0,170,255,0.18),
    0 10px 30px -10px rgba(0,0,0,0.5),
    inset 0 0 60px 0 rgba(0,170,255,0.04);
  overflow: hidden;
}

/* Soft top-edge highlight — like rim light on glass. No full border ring. */
#omega-chat-root::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.08) 0%,
    rgba(0,229,255,0.06) 30%,
    rgba(0,170,255,0.02) 60%,
    rgba(0,0,0,0) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* ===== MESSAGES ===== */
.omega-chat__messages {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px 16px;
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.25) transparent;
}

.omega-chat__messages::-webkit-scrollbar { width: 6px; }
.omega-chat__messages::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.25); border-radius: 6px; }
.omega-chat__messages::-webkit-scrollbar-track { background: transparent; }

/* empty state — suggestion pills */
.omega-chat__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 260px;
  text-align: center;
  gap: 18px;
}

.omega-chat__empty-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  max-width: 360px;
  line-height: 1.5;
}

.omega-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 520px;
}

.omega-chat__suggestion {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #BCE8FF;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.22);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}

/* Spotlight — radial cyan glow follows cursor (set via --mx/--my CSS vars in JS) */
.omega-chat__suggestion::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(0,229,255,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
  border-radius: inherit;
}

.omega-chat__suggestion:hover {
  background: rgba(0,229,255,0.14);
  border-color: rgba(0,229,255,0.55);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px -4px rgba(0,229,255,0.45);
}
.omega-chat__suggestion:hover::after { opacity: 1; }
.omega-chat__suggestion > * { position: relative; z-index: 1; }

.omega-chat__suggestion:focus-visible {
  outline: 2px solid #00E5FF;
  outline-offset: 2px;
}

.omega-chat__empty-footer {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,229,255,0.55);
}

/* ===== BUBBLES ===== */
.omega-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
}

.omega-msg--user { align-self: flex-end; align-items: flex-end; }
.omega-msg--omega { align-self: flex-start; align-items: flex-start; }

.omega-msg__author {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0 6px;
}

.omega-msg__bubble {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 12px 16px;
  border-radius: 16px 24px 4px 24px;
  word-wrap: break-word;
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.omega-msg--user .omega-msg__bubble {
  background: linear-gradient(135deg, rgba(0,229,255,0.18), rgba(0,170,255,0.12));
  border: 1px solid rgba(0,229,255,0.32);
  color: #E8F8FF;
  box-shadow: 0 4px 16px -8px rgba(0,229,255,0.4);
  border-radius: 24px 16px 24px 4px;
  animation: userBubbleAppear 700ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* User bubble cosmic appear — slide-in + scale-up + cyan border flash settling */
@keyframes userBubbleAppear {
  0% {
    opacity: 0;
    transform: translate3d(16px, 0, 0) scale(0.95);
    border-color: rgba(0,229,255,0.0);
    box-shadow: 0 0 0 rgba(0,229,255,0);
  }
  40% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    border-color: rgba(0,229,255,0.55);
    box-shadow: 0 0 22px rgba(0,229,255,0.32), 0 4px 16px -8px rgba(0,229,255,0.4);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    border-color: rgba(0,229,255,0.32);
    box-shadow: 0 4px 16px -8px rgba(0,229,255,0.4);
  }
}

.omega-msg--omega .omega-msg__bubble {
  background: linear-gradient(135deg, rgba(15,30,60,0.55), rgba(10,20,40,0.65));
  border: 1px solid rgba(0,170,255,0.25);
  color: #ECF6FF;
  box-shadow: 0 4px 16px -8px rgba(0,170,255,0.3);
  animation: materializeBubble 700ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Materialization — light-from-darkness reveal: cyan dot expanding into full bubble */
@keyframes materializeBubble {
  0% {
    opacity: 0;
    transform: scale(0.1);
    filter: blur(20px) brightness(2);
    box-shadow: 0 0 40px rgba(0,229,255,0.8);
  }
  60% {
    opacity: 0.9;
    transform: scale(1.02);
    filter: blur(2px) brightness(1.2);
    box-shadow: 0 0 24px rgba(0,229,255,0.4);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) brightness(1);
    box-shadow: 0 0 12px rgba(0,229,255,0.15);
  }
}

/* Premium Queen bubble entrance fallback (kept for is-awaiting overlay compat) */
@keyframes omegaBubbleIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.96); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0)   scale(1);    filter: blur(0); }
}
@keyframes omegaUserBubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Queen bubble while waiting (typing dots present) — cyan ring pulse */
.omega-msg--omega.is-awaiting .omega-msg__bubble {
  box-shadow:
    0 0 0 1px rgba(0,229,255,0.4),
    0 0 24px rgba(0,229,255,0.18),
    0 4px 16px -8px rgba(0,170,255,0.3);
  animation: omegaBubbleIn 500ms cubic-bezier(0.2, 0.9, 0.3, 1), omegaAwaitRing 1.8s ease-in-out infinite;
}
@keyframes omegaAwaitRing {
  0%,100% { box-shadow: 0 0 0 1px rgba(0,229,255,0.4), 0 0 24px rgba(0,229,255,0.18), 0 4px 16px -8px rgba(0,170,255,0.3); }
  50%     { box-shadow: 0 0 0 1px rgba(0,229,255,0.6), 0 0 36px rgba(0,229,255,0.32), 0 4px 16px -8px rgba(0,170,255,0.3); }
}

/* Queen bubble settled — ambient cyan breathing until next user message */
.omega-msg--omega.is-settled .omega-msg__bubble {
  animation: queenBubbleBreathe 4s ease-in-out infinite;
}
@keyframes queenBubbleBreathe {
  0%, 100% {
    border-color: rgba(0,170,255,0.18);
    box-shadow: 0 4px 16px -8px rgba(0,170,255,0.3);
  }
  50% {
    border-color: rgba(0,229,255,0.32);
    box-shadow: 0 0 18px rgba(0,229,255,0.14), 0 4px 16px -8px rgba(0,170,255,0.3);
  }
}

/* typing dots */
.omega-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  height: 16px;
}
.omega-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #00E5FF;
  opacity: 0.6;
  animation: omegaTypingDot 1.2s ease-in-out infinite;
}
.omega-typing span:nth-child(2) { animation-delay: .15s; }
.omega-typing span:nth-child(3) { animation-delay: .30s; }

@keyframes omegaTypingDot {
  0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.0); opacity: 1; }
}

/* ===== PROOF BADGES ===== */
.omega-msg__proofs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 6px 0;
}

.omega-proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #00E5FF;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.32);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  text-decoration: none;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  animation: omegaBadgeIn 380ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.omega-proof-badge:nth-child(1) { animation-delay: 80ms; }
.omega-proof-badge:nth-child(2) { animation-delay: 200ms; }

@keyframes omegaBadgeIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Minted receipt — diagonal cyan shimmer sweeps once on appear */
.omega-proof-badge::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -50%;
  right: -50%;
  bottom: -100%;
  background: linear-gradient(135deg, transparent 35%, rgba(0,229,255,0.4) 50%, transparent 65%);
  transform: translateY(-100%);
  animation: badgeShimmer 2.5s ease-out forwards;
  animation-delay: 600ms;
  pointer-events: none;
  z-index: 0;
}
.omega-proof-badge:nth-child(2)::before { animation-delay: 760ms; }
@keyframes badgeShimmer {
  to { transform: translateY(200%); }
}
.omega-proof-badge > * { position: relative; z-index: 1; }

.omega-proof-badge:hover {
  background: rgba(0,229,255,0.14);
  border-color: rgba(0,229,255,0.6);
  box-shadow: 0 0 16px rgba(0,229,255,0.3), inset 0 0 8px rgba(0,229,255,0.1);
  transform: translateY(-1px);
}

.omega-proof-badge__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #00E5FF;
  color: #0B0E14;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

/* SVG check-draw animation */
.omega-proof-badge__check svg { width: 10px; height: 10px; }
.omega-proof-badge__check svg path {
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  animation: omegaCheckDraw 300ms ease-out forwards;
  animation-delay: 320ms;
}
.omega-proof-badge:nth-child(2) .omega-proof-badge__check svg path { animation-delay: 440ms; }
@keyframes omegaCheckDraw {
  to { stroke-dashoffset: 0; }
}

.omega-proof-badge--pending .omega-proof-badge__check {
  background: transparent;
  border: 1px solid rgba(0,229,255,0.5);
  color: transparent;
  animation: omegaProofPulse 1.2s ease-in-out infinite;
}

@keyframes omegaProofPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,229,255,0.5); }
  50%     { box-shadow: 0 0 0 5px rgba(0,229,255,0); }
}

.omega-msg__latency {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: rgba(0,229,255,0.65);
  text-shadow: 0 0 8px rgba(0,229,255,0.4);
  padding: 2px 6px;
  letter-spacing: 0.08em;
  margin-top: 4px;
  animation: latencyAppear 600ms ease 300ms backwards;
}
@keyframes latencyAppear {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== ERROR BANNER ===== */
.omega-chat__error {
  position: relative;
  z-index: 1;
  margin: 0 24px 12px;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #FFB4B4;
  background: rgba(255,80,80,0.06);
  border: 1px solid rgba(255,80,80,0.32);
  border-radius: 10px;
}

/* ===== COMPOSER — pill portal ===== */
.omega-chat__composer {
  position: relative;
  z-index: 1;
  padding: 12px 16px 18px;
  border-top: 1px solid rgba(0,229,255,0.10);
  background: linear-gradient(180deg, transparent 0%, rgba(0,170,255,0.04) 100%);
}

/* Composer + ALL its descendants — kill any global focus outline.
   The aurora glow underneath is the only focus signal we want. */
.omega-chat__inputwrap,
.omega-chat__inputwrap *,
.omega-chat__input,
.omega-chat__input:focus,
.omega-chat__input:focus-visible,
.omega-chat__send,
.omega-chat__send:focus,
.omega-chat__send:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}

.omega-chat__inputwrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 8px 8px 18px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  transition: background 600ms cubic-bezier(0.2, 0.9, 0.3, 1),
              border-color 600ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Focus — barely-visible border lift + ambient aurora underneath.
   NO ring, NO box-shadow on the wrap itself. The glow comes from ::before. */
.omega-chat__inputwrap:focus-within {
  border-color: rgba(0,229,255,0.18);
  background: rgba(0,229,255,0.025);
}

/* Aurora — soft volumetric glow that BLOOMS OUTWARD from below.
   This is the ONLY visual signal of focus. No movement. Just presence. */
.omega-chat__inputwrap::before {
  content: '';
  position: absolute;
  left: -20%;
  right: -20%;
  top: -30%;
  bottom: -60%;
  background:
    radial-gradient(ellipse 50% 80% at 30% 90%, rgba(0,229,255,0.28), transparent 65%),
    radial-gradient(ellipse 50% 80% at 70% 90%, rgba(0,170,255,0.22), transparent 65%),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(136,240,255,0.15), transparent 70%);
  filter: blur(36px);
  opacity: 0;
  transition: opacity 900ms cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
  z-index: -1;
}
.omega-chat__inputwrap:focus-within::before {
  opacity: 1;
}

.omega-chat__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.95rem;
  color: #fff;
  padding: 8px 0;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.omega-chat__input::placeholder {
  color: rgba(255,255,255,0.32);
}

.omega-chat__send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #00E5FF 0%, #00AAFF 100%);
  color: #0B0E14;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 16px -4px rgba(0,229,255,0.55);
  position: relative;
  z-index: 1;
}

.omega-chat__send::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,255,0.5), transparent 70%);
  opacity: 0;
  transition: opacity .25s;
  z-index: -1;
}

.omega-chat__send:not(:disabled):hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 22px -4px rgba(0,229,255,0.7);
}
.omega-chat__send:not(:disabled):hover::before { opacity: 1; }

.omega-chat__send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.omega-chat__send svg { width: 18px; height: 18px; }

/* SEND ANIMATION — staggered ripple rings expanding outward */
.omega-chat__send.is-sending {
  animation: omegaSendPress 280ms ease-out;
}
.omega-chat__send.is-sending::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  animation: omegaSendRings 700ms ease-out;
}
@keyframes omegaSendPress {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
@keyframes omegaSendRings {
  0%   { box-shadow: 0 0 0 0 rgba(0,229,255,0.55), 0 0 0 0 rgba(0,229,255,0.4), 0 0 0 0 rgba(0,229,255,0.25); }
  33%  { box-shadow: 0 0 0 16px rgba(0,229,255,0), 0 0 0 8px rgba(0,229,255,0.3), 0 0 0 0 rgba(0,229,255,0.25); }
  66%  { box-shadow: 0 0 0 32px rgba(0,229,255,0), 0 0 0 24px rgba(0,229,255,0), 0 0 0 12px rgba(0,229,255,0.15); }
  100% { box-shadow: 0 0 0 64px rgba(0,229,255,0), 0 0 0 48px rgba(0,229,255,0), 0 0 0 32px rgba(0,229,255,0); }
}

/* COSMIC WARP — particles fly outward from send button on submit */
.cosmic-warp {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  width: 0;
  height: 0;
}
.warp-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 3px;
  background: #00E5FF;
  border-radius: 50%;
  box-shadow: 0 0 8px #00E5FF, 0 0 16px rgba(0,229,255,0.5);
  animation: warpParticleFly 800ms ease-out forwards;
}
@keyframes warpParticleFly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(0); opacity: 0; }
}

/* BEAM — vertical line firing up from composer to reply on send */
.omega-beam {
  position: absolute;
  left: 50%;
  bottom: 60px;
  width: 2px;
  height: 320px;
  transform: translateX(-50%) scaleY(0);
  transform-origin: bottom center;
  background: linear-gradient(to top, #00E5FF, rgba(0,229,255,0.5) 40%, transparent 100%);
  filter: blur(0.5px);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 14px rgba(0,229,255,0.7);
}
.omega-beam.beam-fire {
  animation: omegaBeamFire 600ms cubic-bezier(.2,.9,.3,1) forwards;
}
@keyframes omegaBeamFire {
  0%   { transform: translateX(-50%) scaleY(0);   opacity: 0; }
  35%  { transform: translateX(-50%) scaleY(1);   opacity: 1; }
  100% { transform: translateX(-50%) scaleY(1);   opacity: 0; }
}

.omega-chat__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 0 6px;
}

.omega-chat__counter {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.32);
}

.omega-chat__counter--warn { color: #FFB347; }

.omega-chat__hint {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(0,229,255,0.45);
  text-transform: uppercase;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .omega-stage { margin-top: -40px; padding: 80px 12px 64px; min-height: 620px; }
  .omega-chat__messages { padding: 20px 16px 12px; min-height: 260px; max-height: 60vh; }
  .omega-chat__composer { padding: 10px 12px 14px; }
  .omega-chat__inputwrap { padding-left: 14px; border-radius: 22px; }
  .omega-chat__send { width: 36px; height: 36px; }
  .omega-msg { max-width: 92%; }
  .omega-msg__bubble { font-size: 0.9rem; padding: 10px 14px; }
  .omega-voice-toggle { width: 32px; height: 32px; }
}

@media (max-width: 390px) {
  .omega-stage__title { font-size: 1.75rem; }
  .omega-chat__suggestions { gap: 6px; }
  .omega-chat__suggestion { padding: 6px 10px; font-size: 11px; }
}

/* ===== REDUCED MOTION =====
   Cosmic WebGL bg already self-disables animation (renders single static frame)
   when prefers-reduced-motion: reduce. Here we tame the remaining DOM animations.
*/
@media (prefers-reduced-motion: reduce) {
  .omega-typing span,
  .omega-msg--user .omega-msg__bubble,
  .omega-msg--omega .omega-msg__bubble,
  .omega-msg--omega.is-settled .omega-msg__bubble,
  .omega-proof-badge,
  .omega-proof-badge::before,
  .omega-proof-badge--pending .omega-proof-badge__check,
  .omega-msg__latency,
  .omega-chat__inputwrap::before,
  .omega-beam,
  .warp-particle,
  .cosmic-warp {
    animation: none !important;
  }
  .omega-proof-badge { opacity: 1; transform: none; }
  .omega-proof-badge::before { display: none; }
  .omega-proof-badge__check svg path { stroke-dashoffset: 0; }
  .omega-chat__suggestion::after { display: none; }
  .cosmic-warp { display: none !important; }
}

/* ===== LIVE WAVEFORM — pulses inside Queen's bubble while she speaks ===== */
.omega-msg__waveform {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 32px;
  margin-top: 12px;
  opacity: 0.85;
  border-radius: 6px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,229,255,0.04) 50%, transparent 100%);
}
@media (prefers-reduced-motion: reduce) {
  .omega-msg__waveform { display: none; }
}

/* ===== COSMIC CURSOR — cyan glow ring + trail, active ONLY inside #omega-demo ===== */
.cosmic-cursor,
.cosmic-cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 200ms ease;
  will-change: transform, opacity;
}
.cosmic-cursor {
  width: 24px;
  height: 24px;
  border: 1.5px solid #00E5FF;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.3), transparent 70%);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.6), inset 0 0 8px rgba(0, 229, 255, 0.3);
}
.cosmic-cursor-trail {
  width: 12px;
  height: 12px;
  background: #00E5FF;
  border-radius: 50%;
  box-shadow: 0 0 8px #00E5FF;
  filter: blur(2px);
}
.cosmic-cursor.is-active,
.cosmic-cursor-trail.is-active {
  opacity: 1;
}
#omega-demo,
#omega-demo *,
#omega-demo button,
#omega-demo textarea,
#omega-demo a {
  cursor: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .cosmic-cursor,
  .cosmic-cursor-trail { display: none; }
  #omega-demo,
  #omega-demo *,
  #omega-demo button,
  #omega-demo textarea,
  #omega-demo a { cursor: auto !important; }
}
@media (pointer: coarse) {
  .cosmic-cursor,
  .cosmic-cursor-trail { display: none; }
  #omega-demo,
  #omega-demo *,
  #omega-demo button,
  #omega-demo textarea,
  #omega-demo a { cursor: auto !important; }
}

/* ===== COSMIC SOUND TOGGLE — speaker-with-bars in header (sibling of voice toggle) ===== */
.omega-sound-toggle {
  position: absolute;
  top: 0;
  right: 44px; /* sits left of .omega-voice-toggle (36px + 8px gap) */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0,229,255,0.22);
  background: rgba(0,229,255,0.05);
  color: #00E5FF;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s, color .2s;
}
.omega-sound-toggle:hover {
  background: rgba(0,229,255,0.14);
  border-color: rgba(0,229,255,0.55);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0,229,255,0.35);
}
.omega-sound-toggle:focus-visible {
  outline: 2px solid #00E5FF;
  outline-offset: 2px;
}
.omega-sound-toggle svg { width: 18px; height: 18px; }
.omega-sound-toggle.is-muted {
  color: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.15);
  background: transparent;
}
.omega-sound-toggle.is-muted .sound-wave { display: none; }
