/* WELABS — shared by index-v3.html and index-v4.html (both test builds).
   Additive on top of style-v2.css, which is loaded first and reused
   read-only here for the header, footer, buttons, .hero/.section
   primitives and the shared CSS variables (--ink, --border, --ease,
   --container, etc.). Nothing in style-v2.css is duplicated or
   overridden — this file only styles what's new: the scroll-driven
   constellation moment and the interactive chat demo. */

/* ---- Hero (v3 variant: no CTA buttons, a scroll cue instead) ---- */
.hero--v3 { padding-bottom: 56px; }
.hero__scroll-cue {
  margin-top: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero__scroll-cue-line {
  width: 1px;
  height: 36px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.hero__scroll-cue-line::after {
  content: "";
  position: absolute;
  left: 0; top: -100%;
  width: 100%; height: 100%;
  background: var(--ink);
  animation: scroll-cue-drop 1.8s ease-in-out infinite;
}
@keyframes scroll-cue-drop {
  0% { top: -100%; }
  60%, 100% { top: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-cue-line::after { animation: none; top: 0; }
}

/* ---- Hero (v4 variant: v2's exact intro+title, but sized to the full
   viewport so the constellation section starts cleanly on the next scroll
   step instead of peeking in underneath it). ---- */
.hero--v4 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 110px 0 64px;
}

/* ---- Intro scroll hint (v4 variant): swaps v2's small mouse-icon for the
   same line + falling-highlight cue used in the v3 hero — same white intro
   background, just a cleaner graphic. Reuses the scroll-cue-drop keyframe
   defined above. The p element stays styled by style-v2.css's own
   .intro__hint p rule, untouched. ---- */
.intro__hint-line {
  width: 1px;
  height: 34px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.intro__hint-line::after {
  content: "";
  position: absolute;
  left: 0; top: -100%;
  width: 100%; height: 100%;
  background: var(--ink);
  animation: scroll-cue-drop 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .intro__hint-line::after { animation: none; top: 0; }
}

/* ---- Constellation: pinned star field that connects into a path as the
   visitor scrolls through a tall wrapper — the Vela/guiding-star brand
   story as a scroll moment instead of a paragraph. Deep-space navy palette
   (not the neutral gray/black used for the Offres illustrations) — two
   soft colored nebula glows over a midnight-blue-to-black radial base, a
   deliberate, scoped color exception for this one component. ---- */
.constellation {
  position: relative;
  height: 320vh;
  background: #04050c;
}
.constellation__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 78% 12%, rgba(90, 112, 222, 0.32) 0%, transparent 42%),
    radial-gradient(circle at 12% 85%, rgba(147, 78, 200, 0.22) 0%, transparent 48%),
    radial-gradient(circle at 25% 20%, #182449 0%, #0b1226 45%, #04050c 100%);
}
.constellation__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.constellation__beats {
  position: relative;
  z-index: 1;
  max-width: 600px;
  padding: 0 32px;
  text-align: center;
}
.constellation__beat { display: none; }
.constellation__beat.is-active {
  display: block;
  animation: constellation-beat-in 0.7s var(--ease);
}
@keyframes constellation-beat-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.constellation__kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}
.constellation__beat h2 {
  color: #fff;
  font-size: clamp(26px, 4vw, 40px);
  margin-bottom: 16px;
}
.constellation__beat p:not(.constellation__kicker) {
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  max-width: 480px;
  margin: 0 auto;
}
.constellation__beat .btn { margin-top: 30px; }
.btn--ghost-light { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.btn--ghost-light:hover { border-color: rgba(255, 255, 255, 0.65); }

/* Progress dots — subtle indicator of the 3 beats, bottom of the pinned stage */
.constellation__dots {
  position: absolute;
  z-index: 1;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.constellation__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.constellation__dot.is-active { background: #fff; transform: scale(1.3); }

@media (prefers-reduced-motion: reduce) {
  .constellation { height: auto; }
  .constellation__sticky { position: static; height: auto; padding: 110px 0; }
  .constellation__beats { display: flex; flex-direction: column; gap: 72px; max-width: 640px; }
  .constellation__beat { display: block !important; animation: none !important; }
  .constellation__dots { display: none; }
}

@media (max-width: 780px) {
  .constellation { height: 280vh; }
  .constellation__beats { max-width: 440px; }
}

/* ---- Interactive AI demo ---- */
/* Compact top/bottom padding and a shorter section-head gap so the whole
   section (title + panel) fits within a single viewport on typical laptop
   screens without needing an extra scroll. */
.demo-section { padding: 56px 0 64px; }
.demo-section .section-head { margin-bottom: 32px; }

/* ---- AI Live: video / voice / text assistant ----
   Same conversation engine behind three views of it — a talking-orb
   "video" view and a waveform "voice" view (both real mic input via the
   Web Speech API, with spoken replies), plus the original plain-text chat.
   The dark stage reuses the constellation's exact nebula gradient (hex
   values kept literal, not var(--site-accent-*), so this reads correctly
   on index-v2.html too, which doesn't load style-v3-color.css). */
.ai-live { max-width: 640px; margin: 0 auto; }
.ai-live__backdrop { display: none; }
.ai-live.is-expanded .ai-live__backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 16, 0.72);
  z-index: 998;
  animation: ai-live-fade-in 0.25s ease;
}
@keyframes ai-live-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ai-live__panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
}
.ai-live.is-expanded .ai-live__panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  z-index: 999;
  box-shadow: 0 50px 120px -24px rgba(0, 0, 0, 0.55);
}

.ai-live__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.ai-live__id { display: flex; align-items: center; gap: 10px; }
.ai-live__live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #34c759;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18);
}
.ai-live__id-text { display: flex; flex-direction: column; line-height: 1.25; }
.ai-live__id-text strong { font-size: 14px; }
.ai-live__id-text span { font-size: 12px; color: var(--ink-soft); }

.ai-live__modes { display: flex; gap: 4px; background: var(--bg-alt); border-radius: 999px; padding: 3px; }
.ai-live__mode {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.ai-live__mode.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.ai-live__stage {
  position: relative;
  height: 340px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(90, 112, 222, 0.32) 0%, transparent 42%),
    radial-gradient(circle at 12% 85%, rgba(147, 78, 200, 0.22) 0%, transparent 48%),
    radial-gradient(circle at 25% 20%, #182449 0%, #0b1226 45%, #04050c 100%);
}
.ai-live.is-expanded .ai-live__stage { height: 440px; }

.ai-live__visual {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ai-live__visual.is-active { display: flex; }

/* orb (video view) — layered for depth: a soft pulsing halo behind, a
   flowing (slowly shifting) gradient core with a glossy specular highlight,
   plus a few star-like particles orbiting it (echoes the constellation
   this whole component sits under). Always gently alive at idle, not just
   during listening/speaking. */
.ai-live__orb { position: relative; width: 140px; height: 140px; display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.ai-live__orb-halo {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 110, 230, 0.4), transparent 70%);
  filter: blur(4px);
  animation: ai-orb-halo-pulse 4.5s ease-in-out infinite;
}
.ai-live__orb-core {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5a70de, #934ec8, #5a70de);
  background-size: 220% 220%;
  box-shadow:
    0 0 40px 6px rgba(110, 100, 220, 0.55),
    inset -6px -6px 14px rgba(0, 0, 0, 0.25),
    inset 4px 4px 10px rgba(255, 255, 255, 0.22);
  animation: ai-orb-breathe 3.4s ease-in-out infinite, ai-orb-flow 7s ease-in-out infinite;
}
.ai-live__orb-core::before {
  content: "";
  position: absolute;
  top: 11%; left: 16%;
  width: 32%; height: 32%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 72%);
  filter: blur(0.5px);
}
.ai-live__orb-ring {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  opacity: 0;
}
.ai-live__orb-particle {
  position: absolute;
  top: 50%; left: 50%;
  width: 3px; height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.85);
  opacity: 0;
  animation: ai-orb-particle-orbit 6s linear infinite;
}
.ai-live__orb-particle:nth-child(1) { animation-delay: 0s; }
.ai-live__orb-particle:nth-child(2) { animation-delay: -1.5s; }
.ai-live__orb-particle:nth-child(3) { animation-delay: -3s; }
.ai-live__orb-particle:nth-child(4) { animation-delay: -4.5s; }

.ai-live__stage[data-state="listening"] .ai-live__orb-core,
.ai-live__stage[data-state="speaking"] .ai-live__orb-core,
.ai-live__stage[data-state="thinking"] .ai-live__orb-core {
  animation-name: ai-orb-pulse, ai-orb-flow;
}
.ai-live__stage[data-state="listening"] .ai-live__orb-core { animation-duration: 0.9s, 4s; }
.ai-live__stage[data-state="thinking"] .ai-live__orb-core { animation-duration: 1.6s, 4s; }
.ai-live__stage[data-state="speaking"] .ai-live__orb-core { animation-duration: 0.55s, 3s; }
.ai-live__stage[data-state="listening"] .ai-live__orb-ring,
.ai-live__stage[data-state="speaking"] .ai-live__orb-ring {
  animation: ai-orb-ring-expand 1.2s ease-out infinite;
}
.ai-live__stage[data-state="listening"] .ai-live__orb-halo,
.ai-live__stage[data-state="speaking"] .ai-live__orb-halo {
  animation-duration: 1.6s;
}
.ai-live__stage[data-state="listening"] .ai-live__orb-particle,
.ai-live__stage[data-state="speaking"] .ai-live__orb-particle {
  animation-duration: 2.5s;
}

@keyframes ai-orb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes ai-orb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@keyframes ai-orb-ring-expand { 0% { transform: scale(0.65); opacity: 0.6; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes ai-orb-halo-pulse { 0%, 100% { transform: scale(0.88); opacity: 0.5; } 50% { transform: scale(1.12); opacity: 0.9; } }
@keyframes ai-orb-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes ai-orb-particle-orbit {
  0% { transform: rotate(0deg) translateX(58px) rotate(0deg); opacity: 0; }
  8%, 92% { opacity: 0.85; }
  100% { transform: rotate(360deg) translateX(58px) rotate(-360deg); opacity: 0; }
}

/* mic + waveform (voice view) — same halo treatment as the orb, for
   visual parity between the two live views. */
.ai-live__mic-wrap { position: relative; width: 108px; height: 108px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.ai-live__mic-wrap .ai-live__orb-halo { inset: 2px; }
.ai-live__mic-big {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5a70de, #934ec8, #5a70de);
  background-size: 220% 220%;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 40px 6px rgba(110, 100, 220, 0.55),
    inset -6px -6px 14px rgba(0, 0, 0, 0.25),
    inset 4px 4px 10px rgba(255, 255, 255, 0.22);
  animation: ai-orb-breathe 3.4s ease-in-out infinite, ai-orb-flow 7s ease-in-out infinite;
}
.ai-live__stage[data-state="listening"] .ai-live__mic-big,
.ai-live__stage[data-state="speaking"] .ai-live__mic-big,
.ai-live__stage[data-state="thinking"] .ai-live__mic-big {
  animation-name: ai-orb-pulse, ai-orb-flow;
}
.ai-live__stage[data-state="listening"] .ai-live__mic-big { animation-duration: 0.9s, 4s; }
.ai-live__stage[data-state="thinking"] .ai-live__mic-big { animation-duration: 1.6s, 4s; }
.ai-live__stage[data-state="speaking"] .ai-live__mic-big { animation-duration: 0.55s, 3s; }
.ai-live__mic-big svg { width: 28px; height: 28px; stroke: #fff; position: relative; z-index: 1; }
.ai-live__wave { display: flex; align-items: flex-end; gap: 4px; height: 30px; margin-bottom: 18px; }
.ai-live__wave span {
  width: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.75);
  animation: ai-wave-idle 1.8s ease-in-out infinite;
}
.ai-live__wave span:nth-child(1) { height: 30%; animation-delay: 0s; }
.ai-live__wave span:nth-child(2) { height: 60%; animation-delay: 0.1s; }
.ai-live__wave span:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.ai-live__wave span:nth-child(4) { height: 45%; animation-delay: 0.3s; }
.ai-live__wave span:nth-child(5) { height: 80%; animation-delay: 0.4s; }
.ai-live__wave span:nth-child(6) { height: 40%; animation-delay: 0.5s; }
@keyframes ai-wave-idle { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.ai-live__stage[data-state="listening"] .ai-live__wave span { animation-duration: 0.5s; }
.ai-live__stage[data-state="speaking"] .ai-live__wave span { animation-duration: 0.4s; }

.ai-live__caption {
  position: absolute;
  left: 24px; right: 24px; bottom: 66px;
  text-align: center;
  color: #fff;
  font-size: 14.5px;
  line-height: 1.5;
  max-height: 72px;
  overflow: hidden;
  transition: opacity 0.2s var(--ease);
}

.ai-live__controls {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.ai-live__ctrl {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.ai-live__ctrl svg { width: 16px; height: 16px; }
.ai-live__ctrl:hover { background: rgba(0, 0, 0, 0.06); }
.ai-live__ctrl--mic.is-active { background: linear-gradient(135deg, #5a70de, #934ec8); color: #fff; }
.ai-live__ctrl--mic:disabled { opacity: 0.35; cursor: not-allowed; }
.ai-live__ctrl--end { width: auto; padding: 0 16px; color: #e5484d; font-weight: 600; font-size: 13px; }
.ai-live__ctrl--end:hover { background: rgba(229, 72, 77, 0.08); }

/* text view */
.ai-live__chat {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-alt);
}
.ai-live__chat.is-active { display: flex; }
.ai-live__bubble { max-width: 78%; padding: 11px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; }
.ai-live__bubble--bot { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-live__bubble--bot a { color: var(--ink); text-decoration: underline; font-weight: 600; }
.ai-live__bubble--user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.ai-live__typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}
.ai-live__typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: demo-typing-bounce 1.2s infinite;
}
.ai-live__typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-live__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes demo-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ai-live__form {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.ai-live__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg-alt);
}
.ai-live__input:focus { outline: none; border-color: rgba(0, 0, 0, 0.25); }
.ai-live__send { padding: 11px 22px; font-size: 14.5px; flex-shrink: 0; }
.ai-live__send:disabled { opacity: 0.5; cursor: default; }

.ai-live__disclaimer {
  padding: 10px 18px 16px;
  font-size: 11.5px;
  color: var(--ink-soft);
  text-align: center;
  background: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  .ai-live__orb-core, .ai-live__orb-ring, .ai-live__orb-halo, .ai-live__orb-particle,
  .ai-live__mic-big, .ai-live__wave span, .ai-live__typing span {
    animation: none !important;
  }
  .ai-live__orb-particle { display: none; }
}

@media (max-width: 780px) {
  .ai-live__stage { height: 320px; }
  .ai-live.is-expanded .ai-live__panel { width: 94vw; }
  .ai-live.is-expanded .ai-live__stage { height: 380px; }
  .ai-live__bubble { max-width: 86%; }
  .ai-live__topbar { flex-direction: column; align-items: flex-start; }
}
