:root {
  --bg: #000000;
  --panel: #0b0b0c;
  --line: #1c1c1e;
  --line-2: #2c2c2e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --dim: #8e8e93;
  --accent: #4fe3a6;
  --accent-ink: #002417;
  --accent-soft: rgba(79, 227, 166, .1);
  --you: #1c1c1e;
  --bot: #0f2a20;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --level: 0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, system-ui, sans-serif; line-height: 1.5; overflow-x: clip;
}
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(0,0,0,.72); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }
.nav-in { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.pill-link { border: 1px solid #3a3a3c; color: var(--ink); text-decoration: none; padding: 8px 16px; border-radius: 980px; font-size: 14px; font-weight: 600; transition: border-color .3s, background .3s; }
.pill-link:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- hero ---------- */
.hero { position: relative; text-align: center; padding-top: 72px; }
.halo { position: absolute; left: 0; right: 0; margin: 0 auto; top: 10%; width: min(900px, 100%); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(79,227,166,.2), rgba(79,227,166,0)); animation: breathe 7s ease-in-out infinite; pointer-events: none; }
.hero h1 { position: relative; margin: 0 auto; max-width: 900px; font-size: clamp(44px, 7.6vw, 104px); line-height: .98; letter-spacing: -.055em; font-weight: 800; }
.accent { color: var(--accent); }
.lead { position: relative; margin: 24px auto 0; max-width: 620px; font-size: clamp(17px, 1.7vw, 20px); color: var(--muted); }

/* ---------- stage ---------- */
.stage { position: relative; max-width: 760px; margin-top: 48px; }
.panel { background: var(--panel); border: 1px solid #1f2e28; border-radius: 30px; padding: 22px; box-shadow: 0 40px 140px -40px rgba(79,227,166,.3); display: flex; flex-direction: column; gap: 16px; }
.pickers { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.pick { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
select {
  appearance: none; -webkit-appearance: none; background: #151517 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a1a1a6' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--ink); border: 1px solid var(--line-2); border-radius: 999px; padding: 10px 38px 10px 16px; font: 600 15px Inter, sans-serif; min-height: 42px; max-width: 100%; cursor: pointer;
}
select:disabled, .seg button:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: #151517; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font: 600 15px Inter, sans-serif; padding: 8px 18px; border-radius: 999px; cursor: pointer; min-height: 34px; transition: background .35s var(--ease), color .35s; }
.seg button[aria-checked="true"] { background: var(--ink); color: #000; }

/* orb */
.orb-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 4px; }
.orb { position: relative; width: 128px; height: 128px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.core { position: absolute; inset: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 rgba(79,227,166,.5); transition: transform .5s var(--ease), background .4s, color .4s; transform: scale(calc(1 + var(--level) * .12)); }
.orb:hover .core { transform: scale(1.04); }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(79,227,166,.35); opacity: 0; }
.live .ring { animation: ripple 2.4s var(--ease) infinite; }
.live .r2 { animation-delay: 1.2s; }
.live.speaking .ring { border-color: rgba(79,227,166,.7); animation-duration: 1.4s; }
.live .core { background: #0f2a20; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.connecting .core { animation: pulse 1.2s ease-in-out infinite; }
.start-label { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.status { font-size: 14px; color: var(--muted); text-align: center; min-height: 1.5em; max-width: 520px; }

.wa { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: 999px; }
.wa[hidden] { display: none; }

/* conversation */
.log { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; scroll-behavior: smooth; padding: 2px; }
.log:empty { display: none; }
.msg {
  max-width: 86%; padding: 12px 20px; border-radius: 24px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 16px; line-height: 1.6;
  /* each line picks its own direction, so mixed scripts read correctly */
  unicode-bidi: plaintext; text-align: start;
  animation: pop .45s var(--ease) both;
}
.msg.you { align-self: flex-end; background: var(--you); border-bottom-right-radius: 8px; }
.msg.bot { align-self: flex-start; background: var(--bot); border: 1px solid #1f3a2f; border-bottom-left-radius: 8px; }
.msg.rtl { direction: rtl; text-align: right; }
.msg.f-nastaliq { font-family: "Noto Nastaliq Urdu", Inter, serif; font-size: 19px; line-height: 2.25; padding: 8px 22px 14px; }
.msg.f-naskh { font-family: "Noto Naskh Arabic", Inter, serif; font-size: 18px; line-height: 1.9; }
.msg.f-deva { font-family: "Noto Sans Devanagari", Inter, sans-serif; }
.msg.f-beng { font-family: "Noto Sans Bengali", Inter, sans-serif; }
.msg.pending { opacity: .55; }

.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggest button { background: none; border: 1px solid var(--line-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 500 14px Inter, sans-serif; cursor: pointer; transition: border-color .3s, background .3s, transform .3s var(--ease); min-height: 36px; }
.suggest button:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }

.form { display: flex; gap: 8px; background: #151517; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 5px 5px 18px; transition: border-color .3s; }
.form:focus-within { border-color: #2f6b55; }
.form input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ink); font: 16px Inter, "Noto Nastaliq Urdu", sans-serif; }
.send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.chip { background: #151517; border: 1px solid var(--line-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 600 13px Inter, sans-serif; cursor: pointer; min-height: 36px; }
.chip[aria-pressed="true"] { border-color: #2f6b55; color: var(--accent); }
.chip:disabled { opacity: .45; cursor: default; }
.check { font-size: 13px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.note { text-align: center; font-size: 12px; color: var(--dim); margin: 14px 0 0; }

/* ---------- below ---------- */
.feats { margin-top: 96px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.feat { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 6px; transition: transform .6s var(--ease), border-color .6s; }
.feat:hover { transform: translateY(-4px); border-color: #2f6b55; }
.feat b { font-size: 17px; letter-spacing: -.01em; }
.feat span { color: var(--muted); font-size: 15px; }
.get { text-align: center; padding-top: 110px; padding-bottom: 110px; }
.get h2 { margin: 0; font-size: clamp(34px, 5vw, 62px); letter-spacing: -.05em; line-height: 1.02; }
.get p { margin: 14px auto 0; max-width: 520px; color: var(--muted); font-size: 18px; }
.cta { display: inline-block; margin-top: 30px; background: var(--ink); color: #000; text-decoration: none; padding: 16px 30px; border-radius: 980px; font-weight: 700; transition: transform .4s var(--ease), background .3s; }
.cta:hover { transform: translateY(-2px); background: var(--accent); }
.foot { padding: 24px 16px 40px; text-align: center; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); background: linear-gradient(#000, #04140e); }

/* ---------- motion ---------- */
@keyframes up { from { opacity: 0; transform: translateY(32px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .6; transform: scale(1.06); } }
@keyframes ripple { from { opacity: .9; transform: scale(.8); } to { opacity: 0; transform: scale(1.35); } }
@keyframes pulse { 50% { transform: scale(.92); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.in { animation: up 1.1s var(--ease) both; }
.d1 { animation-delay: .12s; } .d2 { animation-delay: .26s; }
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
}
@media (max-width: 560px) {
  .hero { padding-top: 48px; }
  .panel { padding: 16px; border-radius: 24px; }
  .pickers { justify-content: flex-start; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Contact form the assistant opens in the chat (issue #8) */
.cform { align-self: stretch; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: #0f1513; border: 1px solid #24312c; }
.cform.cf-done { opacity: .7; }
.cf-title { font-weight: 700; font-size: 16px; }
.cf-why { font-size: 13px; color: var(--muted, #a1a1a6); }
.cf-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted, #a1a1a6); }
.cform input[type=text], .cform input[name=name], .cform input[type=tel], .cform select { font: inherit; font-size: 16px; color: #f5f5f7; background: #151a18; border: 1px solid #2a3832; border-radius: 12px; min-height: 46px; padding: 0 12px; width: 100%; }
.cf-phone { display: flex; gap: 8px; }
.cf-phone select { width: auto; max-width: 42%; flex: 0 0 auto; }
.cf-phone input { flex: 1; min-width: 0; }
.cf-check { font-size: 13px; min-height: 18px; color: #ffb340; }
.cf-check.good { color: #4fe3a6; }
.cf-ok { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.cf-ok input { width: 20px; height: 20px; accent-color: #4fe3a6; }
.cf-err { color: #ff6b6b; font-size: 13px; min-height: 0; }
.cf-btns { display: flex; gap: 10px; justify-content: flex-end; }
.cf-btns button { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; }
.cf-cancel { background: #1c1c1e; color: #f5f5f7; }
.cf-send { background: #4fe3a6; color: #04140e; }
.cf-send:disabled { opacity: .4; cursor: default; }
.wa-confirm { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: #25d366; color: #052e16; font-weight: 700; text-decoration: none; }
