/* ECHIVO — section: echo ("Meet Echo"). OWNED BY: web agent 5. All selectors scoped to #echo. */

#echo {
  --echo-orb: clamp(230px, 31vw, 450px);
  overflow: hidden;
  isolation: isolate;
}

/* ---------- Ambient background ---------- */
#echo .echo-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 46% at 27% 62%, rgba(79,179,255,0.16), transparent 70%),
    radial-gradient(26% 30% at 34% 54%, rgba(245,200,130,0.10), transparent 70%),
    radial-gradient(40% 40% at 78% 40%, rgba(157,123,255,0.06), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, #070b18 50%, var(--night) 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 82%, transparent 100%);
}
#echo .echo-bg::after { /* faint dot field */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.3px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(50% 55% at 30% 60%, #000 0%, transparent 100%);
          mask-image: radial-gradient(50% 55% at 30% 60%, #000 0%, transparent 100%);
  opacity: .5;
}

/* ---------- Header ---------- */
#echo .echo-head { text-align: center; max-width: 980px; margin: 0 auto clamp(40px, 7vh, 80px); }
#echo .echo-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  color: var(--sky);
}
#echo .echo-mini-orb {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3d6 0%, var(--gold) 26%, #3f93e6 64%, #0b2a5e 100%);
  box-shadow: 0 0 14px rgba(79,179,255,0.8);
}
#echo .echo-title { margin: 0; text-wrap: balance; }
#echo .echo-title__accent {
  background: linear-gradient(100deg, var(--sky) 0%, #bfe3ff 35%, var(--gold) 70%, #ffe6b8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#echo .echo-sub { margin: 20px 0 0; font-size: clamp(1rem, 1.3vw, 1.2rem); }

/* ---------- Stage ---------- */
#echo .echo-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 700px);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
#echo .echo-orbcol { display: flex; flex-direction: column; align-items: center; gap: clamp(36px, 5vh, 56px); }

/* ---------- Orb ---------- */
#echo .echo-orb {
  position: relative;
  width: var(--echo-orb); height: var(--echo-orb);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#echo .echo-orb__halo {
  position: absolute; inset: -38%; border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(79,179,255,0.42), rgba(79,179,255,0.14) 55%, transparent 100%),
    radial-gradient(closest-side at 38% 36%, rgba(245,200,130,0.30), transparent 70%);
  filter: blur(24px);
  pointer-events: none;
  will-change: transform, opacity; /* scaled every frame by the orb engine: own layer, so the blur is rasterised once */
}
#echo .echo-orb__fx {
  position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
  max-width: none;
  pointer-events: none;
}
#echo .echo-orb__core {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  isolation: isolate; transform: translateZ(0);
  background:
    radial-gradient(circle at 34% 30%, #fff1d2 0%, #f6cf8c 10%, var(--gold) 19%, #d69250 30%, #2f7fd6 52%, #164a99 70%, #071c45 92%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    inset -18px -26px 60px rgba(3,12,40,0.65),
    inset 10px 14px 40px rgba(255,236,200,0.25),
    0 0 80px rgba(79,179,255,0.35),
    0 30px 90px rgba(0,0,0,0.5);
  will-change: transform;
}
#echo .echo-orb__swirl {
  position: absolute; inset: -22%; border-radius: 50%;
  mix-blend-mode: overlay;
  filter: blur(18px);
}
#echo .echo-orb__swirl--a {
  background: conic-gradient(from 0deg, transparent 0deg, rgba(79,179,255,0.95) 50deg, transparent 120deg, rgba(245,200,130,0.85) 200deg, transparent 260deg, rgba(120,200,255,0.6) 320deg, transparent 360deg);
  animation: echo-spin 11s linear infinite;
  opacity: .9;
}
#echo .echo-orb__swirl--b {
  inset: -10%;
  background: conic-gradient(from 90deg, transparent 0deg, rgba(255,214,150,0.9) 40deg, transparent 110deg, rgba(157,123,255,0.55) 190deg, transparent 250deg, rgba(79,179,255,0.8) 300deg, transparent 360deg);
  animation: echo-spin 17s linear infinite reverse;
  opacity: .8;
  mix-blend-mode: soft-light;
  filter: blur(14px);
}
#echo .echo-orb__swirl--c {
  inset: 18% 10% 30% 22%;
  background: radial-gradient(closest-side, rgba(255,240,210,0.9), rgba(245,200,130,0.4) 50%, transparent);
  animation: echo-drift 7s ease-in-out infinite alternate;
  filter: blur(16px);
  opacity: .35;
  mix-blend-mode: screen;
}
#echo .echo-orb__spec {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(22% 14% at 35% 17%, rgba(255,255,255,0.7), transparent 70%),
    radial-gradient(55% 35% at 55% 108%, rgba(79,179,255,0.6), transparent 70%),
    radial-gradient(closest-side, transparent 86%, rgba(79,179,255,0.35) 96%, rgba(190,230,255,0.55) 100%);
  pointer-events: none;
}
@keyframes echo-spin { to { transform: rotate(360deg); } }
@keyframes echo-drift {
  0% { transform: translate(-6%, -4%) scale(1); }
  100% { transform: translate(10%, 12%) scale(1.25); }
}

/* ---------- Badges ---------- */
#echo .echo-badges {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  position: relative; z-index: 2;
}
#echo .echo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 13px; border-radius: 999px;
  font-size: var(--t-small); font-weight: 650; color: var(--text);
  white-space: nowrap;
  transition: transform .5s var(--ease-spring), border-color .3s;
}
#echo .echo-badge svg { color: var(--sky); flex: none; }
#echo .echo-badge:nth-child(2) svg { color: var(--gold); }
#echo .echo-badge:nth-child(3) svg { color: var(--mint); }
#echo .echo-badge:hover { transform: translateY(-3px); border-color: rgba(79,179,255,0.45); }

/* ---------- Chat + phone ---------- */
#echo .echo-chatwrap { position: relative; perspective: 1400px; }
#echo .echo-phone {
  --phone-w: 250px;
  position: absolute; right: 0; top: 50%;
  margin-top: calc(var(--phone-w) * -1.087);
  transform: rotate(9deg);
  z-index: 0;
  opacity: .92;
}
#echo .echo-chat {
  position: relative; z-index: 1;
  width: min(100%, 540px);
  border-radius: 30px;
  padding: 14px 14px 14px;
  background: linear-gradient(180deg, rgba(20,29,51,0.78), rgba(11,16,32,0.82));
  border-color: rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 40px 120px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(79,179,255,0.06);
  transform-style: preserve-3d;
}

#echo .echo-chat__top {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 14px 6px;
  border-bottom: 1px solid var(--hairline);
}
#echo .echo-chat__name { font-weight: 800; letter-spacing: .28em; text-transform: uppercase; font-size: .78rem; color: var(--sky); }
#echo .echo-chat__flag {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 650; color: var(--sky);
  background: rgba(79,179,255,0.10); border: 1px solid rgba(79,179,255,0.35);
}
#echo .echo-replay {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--hairline); background: rgba(255,255,255,0.04);
  color: var(--text-2);
  transition: color .2s, background .2s, transform .6s var(--ease-out);
}
#echo .echo-replay:hover { color: #fff; background: rgba(255,255,255,0.1); transform: rotate(-200deg); }
#echo .echo-replay:focus-visible, #echo .echo-orb:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

/* Avatar = tiny orb */
#echo .echo-avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff3d6 0%, var(--gold) 24%, #4a9ce8 62%, #0b2a5e 100%);
  box-shadow: 0 0 0 2px rgba(79,179,255,0.25), 0 0 18px rgba(79,179,255,0.45), inset -3px -4px 8px rgba(3,12,40,0.5);
}
#echo .echo-avatar--sm { width: 22px; height: 22px; }
#echo .echo-avatar { scale: var(--echo-pulse, 1); }

/* Log */
#echo .echo-log { display: flex; flex-direction: column; gap: 14px; padding: 18px 6px 18px; }
#echo .echo-msg { display: flex; gap: 10px; }
#echo .echo-msg--user { justify-content: flex-end; }
#echo .echo-bubble {
  display: inline-block; transform-origin: 100% 100%;
  padding: 10px 16px; border-radius: 20px 20px 6px 20px;
  font-weight: 600; font-size: .98rem; color: #fff6e6;
  background: linear-gradient(180deg, rgba(245,200,130,0.34), rgba(212,165,96,0.22));
  border: 1px solid rgba(245,200,130,0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 10px 30px -10px rgba(245,200,130,0.35);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#echo .echo-msg--user { transform-origin: 100% 100%; }
#echo .echo-msg--bot { align-items: flex-start; }
#echo .echo-msg__body { position: relative; flex: 1; min-width: 0; padding-top: 3px; }
#echo .echo-text { margin: 0 0 12px; font-size: 1rem; line-height: 1.45; color: var(--text); }
#echo .echo-w { display: inline-block; }

/* Typing dots */
#echo .echo-dots {
  position: absolute; left: 0; top: 2px;
  display: inline-flex; gap: 5px; align-items: center;
  padding: 9px 12px; border-radius: 14px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--hairline);
  opacity: 0;
}
#echo .echo-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--sky);
  animation: echo-dot 1s ease-in-out infinite;
}
#echo .echo-dots i:nth-child(2) { animation-delay: .15s; }
#echo .echo-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes echo-dot { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-4px); opacity: 1; } }

/* Route */
#echo .echo-route {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 6px; align-items: center;
}
#echo .echo-step { display: inline-flex; align-items: center; gap: 6px; }
#echo .echo-place {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  font-size: .86rem; font-weight: 650; white-space: nowrap;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
#echo .echo-place b {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .7rem; font-weight: 800; color: #1a1206;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(245,200,130,0.55);
}
#echo .echo-walk {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 7px; border-radius: 999px;
  font-size: .68rem; font-weight: 700; color: var(--sky);
  background: rgba(79,179,255,0.10);
  border: 1px dashed rgba(79,179,255,0.45);
  white-space: nowrap;
}

/* Perk card */
#echo .echo-perk {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px; border-radius: 18px;
  background: linear-gradient(120deg, rgba(255,138,91,0.14), rgba(245,200,130,0.08) 60%, rgba(255,255,255,0.04));
  border: 1px solid rgba(255,138,91,0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
#echo .echo-perk__icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--terracotta); background: rgba(255,138,91,0.16);
}
#echo .echo-perk__txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#echo .echo-perk__name { font-weight: 650; font-size: .92rem; }
#echo .echo-perk__deal {
  align-self: flex-start;
  padding: 3px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 800; letter-spacing: .02em;
  color: #1a1206; background: var(--gold);
}
#echo .echo-perk__shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
  transform: translateX(-120%);
}

/* Input bar */
#echo .echo-input {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color .3s, box-shadow .3s;
}
#echo .echo-input.is-typing { border-color: rgba(79,179,255,0.55); box-shadow: 0 0 0 4px rgba(79,179,255,0.10); }
#echo .echo-input__wave { color: var(--sky); flex: none; }
#echo .echo-input__field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; height: 24px; white-space: nowrap; overflow: hidden; }
#echo .echo-input__text { color: var(--text); font-size: .98rem; }
#echo .echo-input__ph { position: absolute; left: 0; color: var(--text-3); font-size: .98rem; transition: opacity .25s; }
#echo .echo-input.is-typing .echo-input__ph { opacity: 0; transition: none; }
#echo .echo-input__caret {
  width: 2px; height: 18px; margin-left: 1px; border-radius: 2px;
  background: var(--sky); opacity: 0;
}
#echo .echo-input.is-typing .echo-input__caret { opacity: 1; animation: echo-blink 1s steps(2) infinite; }
@keyframes echo-blink { 50% { opacity: 0; } }
#echo .echo-input__send {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3); background: rgba(255,255,255,0.06);
  transition: background .3s, color .3s, box-shadow .3s;
}
#echo .echo-input.has-text .echo-input__send { background: var(--gold); color: #1a1206; box-shadow: 0 6px 20px rgba(245,200,130,0.45); }

/* ---------- Responsive ---------- */
@media (min-width: 1100px) {
  #echo .echo-chatwrap { padding-right: 170px; }
}
@media (max-width: 1099px) {
  #echo .echo-phone { display: none; }
  #echo .echo-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 540px); }
}
@media (max-width: 1000px) {
  #echo { --echo-orb: clamp(200px, 56vw, 300px); }
  #echo .echo-stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 48px; }
  #echo .echo-chatwrap { width: 100%; display: flex; justify-content: center; }
}
@media (max-width: 520px) {
  #echo .echo-chat { border-radius: 26px; padding: 12px 10px; }
  #echo .echo-log { padding: 16px 4px; gap: 12px; }
  #echo .echo-text { font-size: .95rem; }
  #echo .echo-place { font-size: .8rem; padding: 5px 10px 5px 5px; gap: 6px; }
  #echo .echo-place b { width: 18px; height: 18px; font-size: .65rem; }
  #echo .echo-avatar { width: 26px; height: 26px; }
  #echo .echo-badge { padding: 8px 13px 8px 11px; font-size: .8rem; }
  #echo .echo-chat__flag { font-size: .7rem; }
}

/* lowPower (phones / touch / low memory; .is-lite set by echo.js): same orb and chat, cheaper pixels */
#echo.is-lite .echo-orb__halo { filter: none; background:
    radial-gradient(closest-side, rgba(79,179,255,0.40), rgba(79,179,255,0.13) 50%, rgba(79,179,255,0.04) 78%, transparent 100%),
    radial-gradient(closest-side at 38% 36%, rgba(245,200,130,0.26), transparent 78%); }
#echo.is-lite .echo-orb__swirl--b { display: none; }               /* third blended swirl layer */
#echo.is-lite .echo-orb__swirl--a { filter: blur(12px); }
#echo.is-lite .echo-orb__swirl--c { filter: blur(10px); }
#echo.is-lite .echo-chat.glass,
#echo.is-lite .echo-badge.glass,
#echo.is-lite .echo-bubble { -webkit-backdrop-filter: none; backdrop-filter: none; }
#echo.is-lite .echo-chat.glass { background: linear-gradient(180deg, rgba(21,30,52,0.94), rgba(11,16,32,0.95)); }
#echo.is-lite .echo-badge.glass { background: linear-gradient(180deg, rgba(40,46,64,0.9), rgba(24,29,44,0.9)); }
#echo.is-lite .echo-bubble { background: linear-gradient(180deg, rgba(110,92,62,0.92), rgba(84,68,44,0.92)); }

/* Reduced motion: still, final state */
.reduced-motion #echo .echo-orb__swirl,
.reduced-motion #echo .echo-dots i,
.reduced-motion #echo .echo-input__caret { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  #echo .echo-orb__swirl, #echo .echo-dots i { animation: none !important; }
}
