/* Cloudstudio mascot — living guide */

:root {
  /* motion tokens — the house signature */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-inout: cubic-bezier(0.76, 0, 0.24, 1);
  --dur-1: 0.2s;
  --dur-2: 0.34s;
  --dur-3: 0.5s;
  --dur-4: 0.7s;
}

.cs-ai-mascot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483200;
  width: 132px;
  height: 132px;
  pointer-events: none;
  transform: translate3d(var(--cs-mx, 72vw), var(--cs-my, 28vh), 0) scale(calc(var(--cs-mscale, 1) * var(--cs-msqx, 1)), calc(var(--cs-mscale, 1) * var(--cs-msqy, 1)));
  opacity: 0;
  transition: opacity 0.35s ease;
  --bubble-bg: rgba(14, 14, 12, 0.97);
  --bubble-fg: #ffffff;
  --bubble-border: rgba(255, 255, 255, 0.22);
}

.cs-ai-mascot.is-ready {
  opacity: 1;
}

.cs-ai-mascot canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.cs-ai-mascot[data-tone="light"] {
  --bubble-bg: rgba(253, 251, 242, 0.97);
  --bubble-fg: var(--ink, #0e0e0c);
  --bubble-border: rgba(14, 14, 12, 0.24);
}

/* ---------- speech bubble ---------- */

.cs-ai-mascot__bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  min-width: 150px;
  max-width: 250px;
  padding: 11px 14px;
  border: 1px solid var(--bubble-border);
  border-radius: 10px;
  background: var(--bubble-bg);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  color: var(--bubble-fg);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  transform: translate(calc(-50% + var(--cs-bx, 0px)), 8px) scale(calc(0.96 / var(--cs-mscale, 1)));
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.cs-ai-mascot__bubble::after {
  position: absolute;
  /* the bubble may slide sideways (--cs-bx) to stay on-screen; the tail
     compensates so it keeps pointing at the mascot */
  left: clamp(12px, calc(50% - var(--cs-bx, 0px)), calc(100% - 12px));
  top: 100%;
  width: 12px;
  height: 12px;
  border-right: 1px solid var(--bubble-border);
  border-bottom: 1px solid var(--bubble-border);
  background: var(--bubble-bg);
  content: "";
  transform: translate(-50%, -6px) rotate(45deg);
}

/* flip below when the mascot hugs the top edge */
.cs-ai-mascot.bubble-low .cs-ai-mascot__bubble {
  bottom: auto;
  top: calc(100% + 8px);
}

.cs-ai-mascot.bubble-low .cs-ai-mascot__bubble::after {
  top: auto;
  bottom: 100%;
  transform: translate(-50%, 6px) rotate(225deg);
}

.cs-ai-mascot__bubble.is-leaving {
  animation: cs-bubble-despop 0.18s var(--ease-out) forwards;
}

@keyframes cs-bubble-despop {
  to {
    opacity: 0;
    transform: translateX(calc(-50% + var(--cs-bx, 0px))) scale(calc(0.85 / var(--cs-mscale, 1)));
  }
}

.cs-ai-mascot.has-bubble .cs-ai-mascot__bubble {
  opacity: 1;
  transform: translate(calc(-50% + var(--cs-bx, 0px)), 0) scale(calc(1 / var(--cs-mscale, 1)));
  transform-origin: 50% 100%;
  animation: cs-bubble-pop 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-ai-mascot__bubble span {
  display: inline-block;
  /* base state is VISIBLE — the keyframe's `from` (via fill-mode both)
     hides it during the stagger. If the animation ever stalls (busy main
     thread, throttled tab, iOS quirks) the words still show instead of
     leaving an empty black bubble. */
  animation: cs-bubble-word 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i) * 30ms + 50ms);
}

/* ---------- gate ---------- */

.cs-guide-locked,
.cs-guide-locked body {
  overflow: hidden !important;
}

.cs-ai-guiding,
.cs-ai-guiding body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

.cs-guide-gate {
  position: fixed;
  inset: 0;
  z-index: 2147482800;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg, var(--accent, #fff48d));
  color: var(--ink, #0e0e0c);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-guide-gate.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-14px);
}

.cs-guide-choice {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 26px;
  width: min(780px, 100%);
  text-align: center;
}

.cs-guide-choice__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.72;
}

.cs-guide-choice__label i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink, #0e0e0c);
  animation: cs-live-dot 1.4s ease-in-out infinite;
}

.cs-guide-choice__orb {
  width: 128px;
  height: 128px;
  border-radius: 50%;
}

.cs-guide-choice__title {
  margin: 0;
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.cs-guide-choice__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin-top: 6px;
}

.cs-guide-choice button {
  display: grid;
  gap: 5px;
  width: min(272px, 100%);
  padding: 18px 22px 16px;
  border: 2px solid var(--ink, #0e0e0c);
  border-radius: 16px;
  background: transparent;
  color: var(--ink, #0e0e0c);
  font: inherit;
  cursor: pointer;
  justify-items: start;
  text-align: left;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.cs-guide-choice button:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 18px 44px rgba(14, 14, 12, 0.22);
}

.cs-guide-choice button[data-mode="guided"] {
  background: var(--ink, #0e0e0c);
  color: var(--accent, #fff48d);
}

.cs-choice-num {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  opacity: 0.55;
}

.cs-choice-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.cs-choice-desc {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.66;
}

.cs-guide-choice__hint {
  margin: 4px 0 0;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.45;
}

@keyframes cs-live-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- skip control ---------- */

.cs-guide-skip.is-entering {
  opacity: 0 !important;
  transform: translateX(-50%) translateY(10px);
}

.cs-guide-skip {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 2147483210;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: rgba(var(--ink-rgb, 14, 14, 12), 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--accent, #fff48d);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transform: translateX(-50%);
  opacity: 0.55;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cs-guide-skip:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.cs-guide-skip span {
  padding: 2px 7px;
  border: 1px solid rgba(var(--accent-rgb, 255, 244, 141), 0.5);
  border-radius: 5px;
  font-size: 10px;
}

.cs-guide-skip.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---------- overlay fx ---------- */

/* Document-coordinate layer: effects that mark content scroll WITH it */
#cs-doc-fx {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2147483080;
  width: 100%;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.cs-mascot-tether {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483050;
  height: 7px;
  margin-top: -3px;
  /* a string of dots, not a line — it's made of the same stuff as the mascot */
  background: radial-gradient(circle 2.1px at 5px 50%, var(--accent, #fff48d) 96%, transparent) repeat-x left center / 11px 7px;
  filter: drop-shadow(0 0 2.5px rgba(14, 14, 12, 0.55)) drop-shadow(0 0 8px rgba(var(--accent-rgb, 255, 244, 141), 0.35));
  mask-image: linear-gradient(90deg, #000 0%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 82%, transparent 100%);
  pointer-events: none;
  transform-origin: 0 50%;
}

.cs-impact-ring {
  position: absolute;
  z-index: 2147483045;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent, #fff48d);
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(14, 14, 12, 0.4));
  transform: translate(-50%, -50%) scale(0.35);
  animation: cs-impact-ring 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cs-impact-ring::after {
  position: absolute;
  left: 50%;
  top: 50%;
  color: var(--accent, #fff48d);
  content: attr(data-label);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(14, 14, 12, 0.66);
  text-transform: uppercase;
  transform: translate(-50%, calc(-50% - 22px));
  white-space: nowrap;
}

.cs-dot-stream {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
}

.cs-dot-stream i {
  position: fixed;
  left: var(--sx);
  top: var(--sy);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--ink, #0e0e0c);
  transform: translate(-50%, -50%) scale(1);
  animation: cs-dot-fly var(--duration) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--delay);
}

.cs-dot-stream.is-spit i {
  background: var(--accent, #fff48d);
  box-shadow: 0 0 14px rgba(var(--accent-rgb, 255, 244, 141), 0.6);
}

.cs-mascot-trail {
  position: fixed;
  z-index: 2147483190;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(14, 14, 12, 0.55);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: cs-trail-fade 0.6s ease-out forwards;
}

.cs-mascot-trail.is-light {
  background: rgba(var(--accent-rgb, 255, 244, 141), 0.7);
}

/* ---------- stamps / scan ---------- */

.cs-guide-stamp {
  position: absolute;
  z-index: 2147483080;
  padding: 7px 13px;
  border: 2px solid var(--ink, #0e0e0c);
  border-radius: 7px;
  background: var(--accent, #fff48d);
  color: var(--ink, #0e0e0c);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  pointer-events: none;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(var(--rot, -4deg));
  animation: cs-stamp-slam 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 12px 30px rgba(14, 14, 12, 0.3);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.cs-guide-stamp.is-light {
  border-color: var(--accent, #fff48d);
  background: var(--ink, #0e0e0c);
  color: var(--accent, #fff48d);
}

.cs-guide-stamp.is-leaving {
  opacity: 0;
  transform: translate(-50%, -60%) rotate(var(--rot, -4deg)) scale(0.9);
}

.cs-scan-beam {
  position: absolute;
  z-index: 2147483040;
  width: 42px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb, 255, 244, 141), 0), rgba(var(--accent-rgb, 255, 244, 141), 0.34), rgba(var(--accent-rgb, 255, 244, 141), 0));
  pointer-events: none;
  mix-blend-mode: difference;
}

/* ---------- FAQ shards / recycle ---------- */

.cs-faq-shard-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483100;
  pointer-events: none;
}

/* raw words of the broken question — no chrome, they ARE the text */
.cs-faq-piece {
  position: fixed;
  pointer-events: none;
  transform-origin: center;
  white-space: nowrap;
  will-change: transform, opacity;
}

.cs-recycle-chip {
  position: absolute;
  z-index: 2147483100;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 2px solid var(--ink, #0e0e0c);
  border-radius: 999px;
  background: var(--accent, #fff48d);
  box-shadow: 0 16px 40px rgba(14, 14, 12, 0.26);
  color: var(--ink, #0e0e0c);
  font-size: 13px;
  font-weight: 900;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: cs-stamp-slam 0.46s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.cs-recycle-chip.is-leaving {
  opacity: 0;
  transform: translate(-50%, -62%) scale(0.92);
}

/* ---------- toolkit ---------- */

.cs-pill-core {
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb, 255, 244, 141), 0.85),
    0 0 22px rgba(var(--accent-rgb, 255, 244, 141), 0.35) !important;
}

/* ---------- contact ---------- */

.cs-quote-chip {
  position: fixed;
  z-index: 2147483100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent, #fff48d);
  border-radius: 999px;
  background: var(--ink, #0e0e0c);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  color: var(--accent, #fff48d);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
  text-transform: uppercase;
}

.cs-cta-armed {
  box-shadow:
    0 0 0 2px rgba(14, 14, 12, 0.85),
    0 0 34px rgba(14, 14, 12, 0.3) !important;
}

/* ---------- keyframes ---------- */

@keyframes cs-bubble-pop {
  0% { transform: translate(calc(-50% + var(--cs-bx, 0px)), 10px) scale(calc(0.82 / var(--cs-mscale, 1))) rotate(-1deg); }
  62% { transform: translate(calc(-50% + var(--cs-bx, 0px)), -3px) scale(calc(1.04 / var(--cs-mscale, 1))) rotate(0.6deg); }
  100% { transform: translate(calc(-50% + var(--cs-bx, 0px)), 0) scale(calc(1 / var(--cs-mscale, 1))) rotate(0deg); }
}

@keyframes cs-bubble-word {
  0% { opacity: 0; transform: translateY(7px) rotate(-1deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg); }
}

@keyframes cs-impact-ring {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(7.4); }
}

@keyframes cs-dot-fly {
  70% { opacity: 0.9; }
  to {
    left: var(--tx);
    top: var(--ty);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.12);
  }
}

@keyframes cs-trail-fade {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
}

@keyframes cs-stamp-slam {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(2.1);
  }
  62% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--rot, -4deg)) scale(1);
  }
}

/* ---------- responsive / a11y ---------- */

@media (max-width: 760px) {
  .cs-ai-mascot {
    width: 86px;
    height: 86px;
  }

  .cs-guide-choice {
    padding: 20px;
  }

  .cs-guide-choice button {
    flex: 1;
  }

  .cs-guide-skip {
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-ai-mascot,
  .cs-ai-mascot *,
  .cs-mascot-trail,
  .cs-guide-stamp,
  .cs-recycle-chip {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ *
 *  Live chat — talk to the site
 * ------------------------------------------------------------------ */

.cs-ai-mascot.is-chattable {
  pointer-events: auto;
  cursor: pointer;
}

.cs-chat-veil {
  position: fixed;
  inset: 0;
  z-index: 2147483090;
  background: rgba(10, 10, 8, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cs-chat-veil.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cs-chat {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2147483100;
  width: min(600px, calc(100vw - 40px));
  max-height: min(680px, 84vh);
  display: flex;
  flex-direction: column;
  background: var(--ink, #0e0e0c);
  border: 2px solid var(--accent, #fff48d);
  border-radius: 20px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.96);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-chat.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.cs-chat__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #fff48d);
}

.cs-chat__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #fff48d);
  animation: cs-chat-pulse 1.8s ease-in-out infinite;
}

.cs-chat.is-busy .cs-chat__dot {
  animation-duration: 0.5s;
}

@keyframes cs-chat-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

.cs-chat__title { flex: 1; }

.cs-chat__close {
  border: 0;
  background: transparent;
  color: var(--accent, #fff48d);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.cs-chat__log {
  flex: 1;
  max-height: none;
  min-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.cs-chat__msg {
  max-width: 82%;
  padding: 11px 15px;
  font-size: 14.5px;
  line-height: 1.45;
  border-radius: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.cs-chat__msg--site {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f0e6;
  border-radius: 14px 14px 14px 4px;
}

.cs-chat__msg--user {
  align-self: flex-end;
  background: var(--accent, #fff48d);
  color: var(--ink, #0e0e0c);
  font-weight: 600;
  border-radius: 14px 14px 4px 14px;
}

.cs-chat__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.cs-chat__input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  padding: 10px 15px;
  font-size: 14px;
  font-family: inherit;
  color: #f2f0e6;
  outline: none;
}

.cs-chat__input:focus-visible {
  border-color: var(--accent, #fff48d);
}

.cs-chat__send {
  border: 0;
  background: var(--accent, #fff48d);
  color: var(--ink, #0e0e0c);
  width: 40px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.cs-chat.is-busy .cs-chat__send { opacity: 0.5; }

/* ---------- gate: character select ---------- */

.cs-guide-choice__picker {
  display: inline-flex;
  align-items: center;
  gap: 26px;
}

.cs-guide-choice button.cs-guide-arrow {
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink, #0e0e0c);
  border-radius: 50%;
  background: transparent;
  color: var(--ink, #0e0e0c);
  font-size: 24px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  justify-items: center;
  text-align: center;
  padding: 0 0 3px;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease, color 0.18s ease;
}

.cs-guide-choice button.cs-guide-arrow:hover {
  background: var(--ink, #0e0e0c);
  color: var(--accent, #fff48d);
  transform: scale(1.08);
  box-shadow: none;
}

.cs-guide-choice button.cs-guide-arrow:active {
  transform: scale(0.94);
}

.cs-guide-choice__variant {
  margin: -14px 0 0;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.55;
}

.cs-chat__li {
  display: block;
  position: relative;
  padding-left: 16px;
}

.cs-chat__li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #fff48d);
}

.cs-guide-choice__tagline {
  margin: -12px 0 0;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
  opacity: 0.7;
}

/* ---------- deep scan ---------- */

.cs-deepscan {
  position: absolute;
  z-index: 2147483040;
  pointer-events: none;
  border-radius: 10px;
  overflow: visible;
}

.cs-deepscan__grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(var(--ink-rgb, 14, 14, 12), 0.09) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(var(--ink-rgb, 14, 14, 12), 0.09) 0 1px, transparent 1px 22px);
  clip-path: inset(0 0 100% 0);
}

.cs-deepscan__beam {
  position: absolute;
  left: -12px;
  right: -12px;
  top: -14px;
  height: 28px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb, 255, 244, 141), 0), rgba(var(--accent-rgb, 255, 244, 141), 0.3) 50%, rgba(var(--accent-rgb, 255, 244, 141), 0));
  border-bottom: 2.5px solid var(--ink, #0e0e0c);
  filter: drop-shadow(0 3px 10px rgba(var(--accent-rgb, 255, 244, 141), 0.65));
}

.cs-deepscan__readout {
  position: absolute;
  right: -6px;
  top: -32px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: var(--ink, #0e0e0c);
  color: var(--accent, #fff48d);
  padding: 6px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

.cs-deepscan__readout.is-done {
  background: var(--accent, #fff48d);
  color: var(--ink, #0e0e0c);
  transition: background 0.25s ease, color 0.25s ease;
}

.cs-deepscan__tick {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2.5px solid var(--ink, #0e0e0c);
  border-radius: 50%;
  background: var(--accent, #fff48d);
  animation: cs-tickpulse 1.1s ease-out forwards;
}

@keyframes cs-tickpulse {
  0% { transform: scale(0.3); opacity: 0; }
  30% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- sound toggles ---------- */

.cs-guide-choice button.cs-sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin-top: 2px;
  border: 1.5px solid rgba(var(--ink-rgb, 14, 14, 12), 0.45);
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #0e0e0c);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cs-guide-choice button.cs-sound-toggle:hover,
.cs-guide-choice button.cs-sound-toggle[aria-pressed="true"] {
  transform: none;
  box-shadow: none;
  opacity: 1;
  background: var(--ink, #0e0e0c);
  color: var(--accent, #fff48d);
}

.cs-sound-chip {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 2147483205;
  border: 0;
  border-radius: 999px;
  background: rgba(var(--ink-rgb, 14, 14, 12), 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--accent, #fff48d);
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.25s ease;
}

.cs-sound-chip:hover {
  opacity: 1;
}

/* the chip only makes sense once you are inside */
.cs-guide-locked .cs-sound-chip {
  display: none;
}

/* guided chat pills */
.cs-chat__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.cs-chat__pill {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #f4f1e4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 100px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.cs-chat__pill:hover,
.cs-chat__pill:focus-visible {
  background: var(--accent, #fff48d);
  border-color: var(--accent, #fff48d);
  color: #0e0e0c;
  transform: translateY(-1px);
}

.cs-chat.is-busy .cs-chat__pill {
  opacity: 0.4;
  pointer-events: none;
}

.cs-chat__msg--site a {
  color: var(--accent, #fff48d);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* chat visual cards */
.cs-chat__card {
  align-self: stretch;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(var(--accent-rgb, 255, 244, 141), 0.5);
  border-radius: 16px;
  padding: 16px 16px 14px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-chat__card.is-in {
  opacity: 1;
  transform: translateY(0);
}

.cs-chat__card-title {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #fff48d);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-chat__card-badge {
  background: var(--ok, #46c98b);
  color: #0e0e0c;
  font-weight: 700;
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.cs-chat__card-note {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 12px;
  line-height: 1.5;
}

/* timeline */
.cs-chat__tl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
}

.cs-chat__tl-name {
  width: 118px;
  font-size: 12px;
  font-weight: 600;
  color: #f2f0e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-chat__tl-bar {
  flex: 1;
  height: 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.cs-chat__tl-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: var(--accent, #fff48d);
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-chat__card.is-in .cs-chat__tl-bar i { width: var(--w); }

.cs-chat__tl-wk {
  width: 64px;
  text-align: right;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
}

/* roi */
.cs-chat__roi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.cs-chat__roi-label {
  width: 118px;
  font-size: 12px;
  font-weight: 600;
  color: #f2f0e6;
}

.cs-chat__roi-bar {
  flex: 1;
  height: 14px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.cs-chat__roi-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-chat__roi-bar.is-good i { background: var(--ok, #46c98b); }
.cs-chat__card.is-in .cs-chat__roi-bar i { width: var(--w); }

.cs-chat__roi-val {
  width: 84px;
  text-align: right;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.75);
}

/* projects */
.cs-chat__proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cs-chat__proj {
  display: block;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cs-chat__proj:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #fff48d);
}

.cs-chat__proj img {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  filter: grayscale(1) brightness(1.05);
  transition: filter 0.35s ease;
}

.cs-chat__proj:hover img { filter: none; }

.cs-chat__proj-name {
  display: block;
  padding: 8px 10px 1px;
  font-weight: 700;
  font-size: 13px;
  color: #f2f0e6;
}

.cs-chat__proj-metric {
  display: block;
  padding: 0 10px 9px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--accent, #fff48d);
}

/* estimate */
.cs-chat__est-range {
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.03em;
  color: #fdfbf2;
  line-height: 1;
}

.cs-chat__est-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.cs-chat__est-meta span {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  padding: 3px 10px;
  color: rgba(255, 255, 255, 0.8);
}

.cs-chat__est-phases {
  display: flex;
  gap: 4px;
  height: 10px;
}

.cs-chat__est-phases i {
  border-radius: 100px;
  background: var(--accent, #fff48d);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-chat__card.is-in .cs-chat__est-phases i {
  opacity: 1;
  transform: scaleX(1);
}

.cs-chat__est-cta {
  display: inline-block;
  margin-top: 14px;
  background: var(--accent, #fff48d);
  color: #0e0e0c;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 100px;
}

.cs-chat__pill--ghost {
  opacity: 0.62;
  border-style: dashed;
}

@media (prefers-reduced-motion: reduce) {
  .cs-chat__card,
  .cs-chat__card.is-in { opacity: 1; transform: none; }
  .cs-chat__tl-bar i, .cs-chat__roi-bar i { transition: none; width: var(--w); }
  .cs-chat__est-phases i { transition: none; }
}

/* gate: the guided button's border breathes — a quiet halo, no theatrics */
.cs-guide-choice button[data-mode="guided"] {
  animation: cs-halo 3s ease-in-out infinite;
}

@keyframes cs-halo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--ink-rgb, 14, 14, 12), 0), 0 0 0 0 rgba(var(--ink-rgb, 14, 14, 12), 0); }
  50% { box-shadow: 0 0 0 5px rgba(var(--ink-rgb, 14, 14, 12), 0.16), 0 0 0 11px rgba(var(--ink-rgb, 14, 14, 12), 0.05); }
}

@media (prefers-reduced-motion: reduce) {
  .cs-guide-choice button[data-mode="guided"] { animation: none; }
}

/* nav pet — tiny live character in the header, click to recolor the world */
.cs-nav-pet {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cs-nav-pet canvas {
  width: 44px;
  height: 44px;
  display: block;
}

.cs-nav-pet:hover {
  transform: scale(1.12) rotate(-6deg);
}

.cs-nav-pet.is-born {
  animation: cs-navborn 0.5s var(--ease-back) backwards;
}

@keyframes cs-navborn {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.cs-nav-pet.is-spin {
  animation: cs-navspin 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cs-navspin {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(200deg) scale(0.72); }
  100% { transform: rotate(360deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cs-nav-pet.is-spin { animation: none; }
}

/* ------------------------------------------------------------------ *
 *  Mobile pass (≤640px) — gate, bubble, chips, chat
 * ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .cs-nav-pet {
    display: none;
  }

  /* bubble can never be wider than the screen */
  .cs-ai-mascot__bubble {
    min-width: 130px;
    max-width: min(250px, calc(100vw - 20px));
    font-size: 13px;
    padding: 10px 12px;
  }

  /* gate: stacked full-width choices, tighter type */
  .cs-guide-choice {
    gap: 20px;
  }

  .cs-guide-choice__title {
    font-size: 2rem;
  }

  .cs-guide-choice__picker {
    gap: 18px;
  }

  .cs-guide-choice__orb {
    width: 104px;
    height: 104px;
  }

  .cs-guide-choice button[data-mode] {
    flex: 1 1 100%;
    width: 100%;
    padding: 14px 18px 13px;
  }

  .cs-choice-name {
    font-size: 21px;
  }

  .cs-guide-choice__variant {
    margin-top: -8px;
  }

  /* chips: skip bottom-center, sound tucked bottom-left — both smaller */
  .cs-guide-skip {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 7px 12px;
    font-size: 10px;
    opacity: 0.8;
  }

  .cs-sound-chip {
    left: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 7px 11px;
    font-size: 9px;
  }

  /* chat: near-fullscreen sheet */
  .cs-chat {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }

  .cs-chat__log {
    min-height: 140px;
    padding: 12px;
  }

  .cs-chat__msg {
    max-width: 90%;
    font-size: 14px;
  }

  .cs-chat__pills {
    gap: 6px;
    padding: 10px 12px 12px;
  }

  .cs-chat__pill {
    font-size: 10px;
    padding: 6px 10px;
  }

  .cs-chat__card {
    padding: 13px 13px 12px;
  }

  .cs-chat__proj-grid {
    grid-template-columns: 1fr;
  }

  .cs-chat__tl-name,
  .cs-chat__roi-label {
    width: 84px;
    font-size: 11px;
  }

  .cs-chat__tl-wk {
    width: 48px;
  }

  .cs-chat__roi-val {
    width: 64px;
  }

  .cs-chat__est-range {
    font-size: 28px;
  }
}

/* theme changes tint the world smoothly (armed one frame after boot) */
html.cs-theme-ready,
html.cs-theme-ready body {
  transition: background-color 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* gate entrance: children cascade in top-to-bottom */
.cs-guide-choice > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-guide-gate.is-in .cs-guide-choice > * {
  opacity: 1;
  transform: none;
}

.cs-guide-gate.is-in .cs-guide-choice > :nth-child(2) { transition-delay: 0.07s; }
.cs-guide-gate.is-in .cs-guide-choice > :nth-child(3) { transition-delay: 0.14s; }
.cs-guide-gate.is-in .cs-guide-choice > :nth-child(4) { transition-delay: 0.2s; }
.cs-guide-gate.is-in .cs-guide-choice > :nth-child(5) { transition-delay: 0.27s; }
.cs-guide-gate.is-in .cs-guide-choice > :nth-child(6) { transition-delay: 0.34s; }
.cs-guide-gate.is-in .cs-guide-choice > :nth-child(7) { transition-delay: 0.4s; }

/* the chosen button arms itself before the curtain drops */
.cs-guide-choice button.is-chosen {
  transform: scale(0.96) !important;
  background: var(--accent, #fff48d) !important;
  color: var(--ink, #0e0e0c) !important;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), background 0.16s ease;
}

@media (prefers-reduced-motion: reduce) {
  .cs-guide-choice > * { opacity: 1; transform: none; transition: none; }
  html.cs-theme-ready, html.cs-theme-ready body { transition: none; }
}

/* chat thinking indicator — three breathing dots */
.cs-chat__typing {
  display: inline-flex;
  gap: 5px;
  padding: 3px 2px;
}

.cs-chat__typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #fff48d);
  animation: cs-chat-pulse 1.1s ease-in-out infinite;
}

.cs-chat__typing i:nth-child(2) { animation-delay: 0.18s; }
.cs-chat__typing i:nth-child(3) { animation-delay: 0.36s; }
