:root {
  --ink: #17215c;
  --ink-2: #3a4160;
  --muted: #6e7389;
  --faint: #9aa0b2;
  --line: #e6e4df;
  --line-strong: #dcdde3;
  --surface: #ffffff;
  --surface-2: #f4f4f6;
  --paper: #f4f1ec;
  --blue: #2f6fd6;
  --cta: #d9442f;
  --cta-hover: #c13a27;
  --wa: #1fa855;
  --web: #3e6db4;
  --app: #c4553f;
  --gold: #e8a93a;
  --shadow-panel: 0 1px 2px rgba(17, 24, 39, 0.06), 0 28px 64px -16px rgba(17, 24, 39, 0.28);
  --shadow-soft: 0 1px 2px rgba(17, 24, 39, 0.05), 0 8px 24px -10px rgba(17, 24, 39, 0.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-2);
  background: var(--paper);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 3D scene ---------- */
#scene {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(#f6f3ee 0%, #ece8e1 45%, #e8e3db 70%);
}
#office-canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s ease; }
#scene.ready #office-canvas { opacity: 1; }
.scene-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.5s ease;
}
#scene.ready .scene-loader, #scene.fallback .scene-loader { opacity: 0; pointer-events: none; }
.loader-bar { width: 160px; height: 2px; background: var(--line-strong); border-radius: 2px; overflow: hidden; }
.loader-bar i { display: block; width: 40%; height: 100%; background: var(--ink); animation: load 1.1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Zone labels projected from 3D */
#zone-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 0.8s ease 0.4s; }
#scene.ready #zone-labels { opacity: 1; }
.zone-label {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  transition: opacity 0.35s ease;
  will-change: transform;
}
.zone-label.hidden { opacity: 0; pointer-events: none; }
.zl-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(23, 33, 92, 0.08);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  transition: background 0.25s ease, transform 0.25s ease;
}
.zone-label:hover .zl-card { transform: translateY(-2px); }
.zl-pin { width: 1px; height: 22px; background: linear-gradient(rgba(23, 33, 92, 0.45), rgba(23, 33, 92, 0)); }
.zl-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--zone, var(--ink)); }
.zl-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--zone, var(--ink)); opacity: 0.35; }
.zl-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.zl-text strong { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.zl-text small { font-size: 11px; color: var(--muted); }
.zone-website { --zone: var(--web); }
.zone-app { --zone: var(--app); }
.zone-both { --zone: var(--gold); }
.zone-contact { --zone: var(--ink); }
.zone-label.active .zl-card { background: var(--ink); border-color: var(--ink); }
.zone-label.active strong { color: #fff; }
.zone-label.active small { color: rgba(255, 255, 255, 0.7); }
.zone-label.active .zl-dot::after { animation: ping 1.6s ease-out infinite; opacity: 0.8; }
@keyframes ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }

/* ---------- explore hint + reset ---------- */
.scene-tools {
  position: fixed;
  top: 82px;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: right 0.4s ease;
}
body.chat-open .scene-tools { right: 444px; }
.scene-hint, .reset-view {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(23, 33, 92, 0.08);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.scene-hint { opacity: 0; transition: opacity 0.6s ease; }
#scene.ready ~ .scene-tools .scene-hint { opacity: 1; }
#scene.ready ~ .scene-tools .scene-hint.gone { opacity: 0; }
.scene-hint svg, .reset-view svg { width: 17px; height: 17px; }
.scene-hint svg { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.hint-touch { display: none; }
@media (hover: none) { .hint-desktop { display: none; } .hint-touch { display: inline; } }
.reset-view { position: absolute; pointer-events: auto; border: 1px solid rgba(23, 33, 92, 0.12); }
.reset-view:hover { background: #fff; }
.reset-view[hidden] { display: none; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  z-index: 10;
  pointer-events: none;
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 -36px;
  z-index: -1;
  background: linear-gradient(rgba(244, 241, 236, 0.92), rgba(244, 241, 236, 0.6) 55%, rgba(244, 241, 236, 0));
}
.topbar > * { pointer-events: auto; }
.brand img { height: 38px; width: auto; display: block; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.top-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.top-phone svg { width: 18px; height: 18px; }
.top-cta {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, opacity 0.3s ease;
}
.top-cta:hover { background: #0f1747; }
body.chat-open .top-cta { opacity: 0; pointer-events: none; }

/* ---------- hero ---------- */
.hero {
  position: fixed;
  bottom: 40px;
  left: 40px;
  max-width: 390px;
  z-index: 5;
  animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.15s;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -110px -170px -90px -140px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(247, 244, 239, 0.94) 0%, rgba(247, 244, 239, 0.8) 55%, rgba(247, 244, 239, 0) 100%);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow span { width: 22px; height: 2px; background: var(--cta); border-radius: 2px; }
.hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero .sub { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 340px; }
.proof { display: flex; margin: 0 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.proof li { padding: 0 14px; border-left: 1px solid rgba(23, 33, 92, 0.14); white-space: nowrap; }
.proof li:first-child { border-left: 0; }
.proof b { color: var(--ink); font-weight: 800; }
body.chat-open .proof { margin-right: 0; }

/* Hero has a fill-mode entrance animation, so hiding it is also an animation. */
body.engaged .hero { animation: sink 0.45s ease forwards; pointer-events: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sink { to { opacity: 0; transform: translateY(-10px); visibility: hidden; } }

/* ---------- assistant panel ---------- */
#assistant {
  position: fixed;
  top: 84px;
  right: 24px;
  bottom: 24px;
  width: 396px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(23, 33, 92, 0.07);
  border-radius: 18px;
  box-shadow: var(--shadow-panel);
  z-index: 20;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#assistant.open { opacity: 1; transform: none; pointer-events: auto; }
#assistant.open.minimized { opacity: 0; transform: translateY(16px); pointer-events: none; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 14px 18px;
}
.agent { display: flex; gap: 12px; align-items: center; }
.agent-text strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.agent-text small { font-size: 12px; color: var(--muted); }
.avatar, .launcher-avatar {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}
.avatar { width: 40px; height: 40px; background: var(--ink); color: #fff; font-size: 16px; }
.avatar i, .launcher-avatar i {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #22b35e;
  border: 2px solid #fff;
}
.head-actions { display: flex; gap: 4px; }
.head-actions button {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.head-actions button:hover { background: var(--surface-2); color: var(--ink); }
.head-actions svg { width: 18px; height: 18px; }

.progress { padding: 0 18px 14px; border-bottom: 1px solid var(--line); }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; margin-bottom: 8px; }
#step-label { font-weight: 700; color: var(--ink); white-space: nowrap; }
.summary { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary span + span::before { content: " · "; color: var(--faint); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; padding-top: 9px; font-size: 11px; color: var(--faint); font-weight: 500; }
.steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 3px; background: #ebebef; transition: background 0.4s ease; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--ink); }
.steps li.current { color: var(--ink); font-weight: 700; }
.steps li.current::before { background: linear-gradient(90deg, var(--ink) 50%, #ebebef 50%); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.chat-log > * { flex-shrink: 0; }

.msg {
  max-width: 88%;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  animation: rise 0.3s ease both;
}
.msg.bot { align-self: flex-start; background: var(--surface-2); color: var(--ink-2); border-radius: 14px 14px 14px 4px; }
.msg.bot b { color: var(--ink); font-weight: 700; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 14px 14px 4px 14px; font-weight: 500; }
.msg.typing { display: flex; gap: 4px; padding: 14px 16px; }
.msg.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.1s infinite ease-in-out; }
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.35; transform: none; } 40% { opacity: 1; transform: translateY(-2px); } }

.options { display: grid; gap: 8px; margin-top: 2px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px 12px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  animation: rise 0.35s ease both;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.option:hover:not(:disabled) { border-color: rgba(23, 33, 92, 0.4); box-shadow: var(--shadow-soft); }
.option:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.option.chosen { border-color: var(--ink); background: var(--surface-2); }
.option:disabled { cursor: default; }
.opt-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.opt-text { flex: 1; min-width: 0; }
.opt-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.opt-text small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.opt-arrow { color: var(--faint); transition: transform 0.15s ease, color 0.15s ease; }
.opt-arrow svg { width: 18px; height: 18px; }
.option:hover .opt-arrow { color: var(--ink); transform: translateX(2px); }
.options-chips { display: flex; flex-wrap: wrap; }
.options-chips .option { width: auto; padding: 9px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink); }

.card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  animation: rise 0.4s ease both;
}
.card-title { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.card ul { display: grid; gap: 8px; margin: 12px 0 14px; padding: 0; list-style: none; }
.card li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.card li svg { width: 16px; height: 16px; margin-top: 1px; color: var(--blue); stroke-width: 2.4; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.card-meta span { display: flex; align-items: center; gap: 6px; }
.card-meta svg { width: 15px; height: 15px; }
.card-meta b { color: var(--ink); font-weight: 700; }

.form-wrap { animation: rise 0.35s ease both; }
.lead-form { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 14px; }
.lead-form label { display: grid; gap: 6px; }
.lead-form label > span { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.lead-form em { font-style: normal; font-weight: 500; color: var(--faint); margin-left: 4px; }
.lead-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lead-form input::placeholder { color: var(--faint); }
.lead-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.14); }
.phone { display: flex; }
.phone span {
  display: grid; place-items: center;
  padding: 0 12px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 10px 0 0 10px;
}
.phone input { border-radius: 0 10px 10px 0; }
.form-error { margin: 0; font-size: 13px; color: var(--cta); }
.form-error:empty { display: none; }
.submit {
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--cta);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: background 0.15s ease;
}
.submit:hover { background: var(--cta-hover); }
.submit:disabled { opacity: 0.7; cursor: wait; }
.consent { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--faint); text-align: center; }

.next-steps { padding: 16px; border: 1px solid var(--line-strong); border-radius: 14px; animation: rise 0.4s ease both; }
.ns-title { margin: 0 0 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.next-steps ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.next-steps li { position: relative; padding-left: 34px; counter-increment: s; }
.next-steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  font-size: 12px; font-weight: 700; color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
.next-steps b { display: block; font-size: 14px; color: var(--ink); }
.next-steps span { font-size: 12.5px; color: var(--muted); }

.actions { display: grid; gap: 8px; animation: rise 0.35s ease both; }
.action {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.action svg { width: 18px; height: 18px; }
.action.wa { background: var(--wa); }
.action.call { background: var(--ink); }

/* ---------- launcher ---------- */
#launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px 7px 7px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-panel);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
#launcher:hover { transform: translateY(-2px); }
.launcher-avatar { width: 34px; height: 34px; background: #fff; color: var(--ink); font-size: 14px; }
.launcher-avatar i { border-color: var(--ink); }
body.chat-open #launcher { opacity: 0; pointer-events: none; transform: scale(0.9); }

/* ---------- smaller desktops ---------- */
@media (max-width: 1360px) and (min-width: 1181px) {
  .proof li:nth-child(3) { display: none; }
}
@media (max-width: 1180px) and (min-width: 769px) {
  .hero { max-width: 380px; }
  .hero h1 { font-size: 29px; }
  .proof { display: none; }
}

/* ---------- mobile ---------- */
@media (max-width: 768px) {
  .topbar { padding: 12px 16px; }
  .brand img { height: 28px; }
  .top-phone span { display: none; }
  .top-cta { height: 36px; padding: 0 14px; font-size: 13px; }

  .hero { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); left: 16px; right: 16px; max-width: none; }
  .hero::before { inset: -40px -16px -120px; background: linear-gradient(to top, var(--paper) 72%, rgba(244, 241, 236, 0)); }
  .eyebrow { margin-bottom: 8px; font-size: 11px; }
  .hero h1 { font-size: 25px; }
  .hero .sub { margin: 8px 0 0; font-size: 14px; }
  .proof { display: none; }
  body.chat-open .hero { animation: sink 0.3s ease forwards; pointer-events: none; }

  .zl-text small { display: none; }
  .scene-tools { top: 64px; }
  body.chat-open .scene-tools { right: 0; }
  .zl-card { padding: 5px 11px 5px 8px; }

  #assistant {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: auto;
    height: min(62dvh, 600px);
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #assistant.open { transform: none; }
  #assistant.open.minimized { transform: translateY(100%); opacity: 1; }
  .panel-head { padding: 12px 12px 10px 16px; }
  .progress { padding: 0 16px 12px; }
  .chat-log { padding: 14px 16px; }
  .msg { font-size: 14px; }
  #launcher { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

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