/* Behrad web app. Pi identity: white, black and greys only; functional colour as a ≤6px dot.
   The "AI" feel comes from motion and light, not colour: a living greyscale halo, an oscilloscope line,
   words that surface out of blur, and a shimmer on what is being worked on. */

@font-face { font-family: "Vazirmatn"; src: url("/fonts/Vazirmatn-wght.woff2") format("woff2-variations"), url("/fonts/Vazirmatn-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #FFFFFF;
  --surface: #F5F5F4;
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #9A9A9A;
  --line: #E5E5E5;
  --fn-normal: #22A06B;
  --font: "Vazirmatn", Tahoma, sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.8 var(--font); -webkit-font-smoothing: antialiased;
  overflow: hidden; overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video, canvas { display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.en { font-family: var(--font); direction: ltr; unicode-bidi: isolate; }
.caps { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); line-height: 1.4; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ---------- ambient light ---------- */

.aura { position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(60px); opacity: .9; }
.aura i { position: absolute; border-radius: 50%; mix-blend-mode: multiply; }
.aura i:nth-child(1) { width: 70vmax; height: 70vmax; top: -10%; right: -15%; background: radial-gradient(closest-side, #e6e6e3, transparent 70%); animation: drift1 22s ease-in-out infinite alternate; }
.aura i:nth-child(2) { width: 60vmax; height: 60vmax; bottom: -5%; left: -20%; background: radial-gradient(closest-side, #ececea, transparent 70%); animation: drift2 26s ease-in-out infinite alternate; }
.aura i:nth-child(3) { width: 40vmax; height: 40vmax; top: 35%; left: 30%; background: radial-gradient(closest-side, #f0f0ee, transparent 70%); animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-12vmax, 10vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(14vmax, -8vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(-8vmax, -12vmax) scale(1.2); } }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 56px; padding: 0 30px; border: 1px solid var(--ink); border-radius: 999px;
  font-weight: 500; font-size: 16px; line-height: 1; background: transparent; color: var(--ink);
  transition: transform .25s var(--ease), background-color .3s ease, color .3s ease;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--arrow { padding-inline-end: 8px; }
.btn__chip { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink); transition: transform .35s var(--ease); }
.btn--arrow:hover .btn__chip { transform: translateX(-4px); }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; color: var(--ink); }
.icon-btn svg { fill: currentColor; }
.icon-btn:active { background: rgba(17,17,17,.06); }
.link { border: 0; background: none; padding: 6px 2px; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- opening (splash) ---------- */

.splash { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--bg); overflow: hidden; pointer-events: auto; }
.splash > * { grid-area: 1 / 1; }
.sp-mark { width: 34px; height: 34px; opacity: 0; }
.sp-burst { position: relative; width: 120px; height: 120px; opacity: 0; transform-origin: 50% 50%; will-change: transform, filter, opacity; }
.sp-g { position: absolute; inset: 0; width: 100%; height: 100%; }
/* A monochrome "chromatic" fringe: two blurred copies pulled apart, and a soft glow under them */
.sp-g--glow { filter: blur(22px); opacity: .5; transform: scale(1.12); }
.sp-g--a { filter: blur(4px); opacity: .55; transform: translate(calc(var(--fr, 0) * -1px), calc(var(--fr, 0) * .3px)); }
.sp-g--b { filter: blur(9px) invert(1) brightness(.62); opacity: .55; mix-blend-mode: multiply; transform: translate(calc(var(--fr, 0) * 1px), calc(var(--fr, 0) * -.4px)); }
.sp-blob {
  position: relative; width: min(118vw, 620px); aspect-ratio: 1; opacity: 0; transform: scale(.3);
  /* liquid silver: a slow conic sheen in greys, a white core so the wordmark stays readable */
  background:
    radial-gradient(closest-side, rgba(255,255,255,.96) 0%, rgba(255,255,255,.7) 38%, rgba(255,255,255,0) 66%),
    conic-gradient(from 20deg, #f4f4f2, #cdcdca, #ffffff, #bfbfbc, #efefed, #d8d8d5, #ffffff, #c6c6c3, #f4f4f2);
  filter: blur(14px) contrast(1.05); border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  -webkit-mask: radial-gradient(closest-side, #000 72%, transparent 100%); mask: radial-gradient(closest-side, #000 72%, transparent 100%);
  animation: blob 5s ease-in-out infinite alternate;
}
.sp-blob::after { content: ""; position: absolute; inset: 6%; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(255,255,255,.9), inset 0 0 30px rgba(17,17,17,.12); }
@keyframes blob {
  33% { border-radius: 58% 42% 46% 54% / 44% 58% 42% 56%; rotate: 40deg; }
  66% { border-radius: 42% 58% 54% 46% / 58% 46% 54% 42%; rotate: -25deg; }
  100% { border-radius: 52% 48% 40% 60% / 46% 52% 48% 54%; rotate: 70deg; }
}
.sp-ring { width: min(84vw, 420px); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(17,17,17,.14); opacity: 0; filter: blur(.4px); box-shadow: 0 0 40px rgba(17,17,17,.05) inset; }
.sp-word { display: flex; align-items: center; gap: 2px; font: 700 40px/1 var(--font); letter-spacing: -.01em; color: var(--ink); }
.sp-disc { width: 46px; height: 46px; margin-right: 10px; opacity: 0; transform: scale(.4); }
.sp-l { display: inline-block; opacity: 0; }
.sp-amp { font-weight: 300; color: #3a3a3a; margin: 0 1px; }
.sp-sub { align-self: center; margin-top: 110px; font-size: 13px; color: var(--ink-2); letter-spacing: .02em; opacity: 0; }
.splash.done { pointer-events: none; }

/* the intro's own entrance after the opening */
.intro.pre > * { opacity: 0; }
.intro.enter > * { animation: introIn .9s var(--ease) both; animation-delay: calc(var(--k, 0) * 90ms); }
@keyframes introIn { from { opacity: 0; transform: translateY(16px); filter: blur(8px); } }

/* ---------- intro ---------- */

.intro {
  position: relative; z-index: 2; height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 14px) var(--gutter) calc(var(--safe-b) + 20px);
  transition: opacity .5s ease, transform .6s var(--ease), filter .6s ease;
  scrollbar-width: none;
}
.intro::-webkit-scrollbar { display: none; }
.intro.leaving { opacity: 0; transform: scale(1.04); filter: blur(8px); pointer-events: none; }
.intro__top { width: 100%; max-width: 440px; display: flex; align-items: center; justify-content: space-between; }
.logo { height: 26px; width: auto; }

.hero { position: relative; width: min(72vw, 290px, 36vh); aspect-ratio: 1; margin: clamp(14px, 4vh, 40px) 0 4px; display: grid; place-items: center; }
.halo { position: absolute; pointer-events: none; }
.halo--hero { inset: -22%; width: 144%; height: 144%; }
.hero__ring {
  position: absolute; inset: 9%; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(17,17,17,0), rgba(17,17,17,.55), rgba(17,17,17,0) 30%, rgba(17,17,17,0) 60%, rgba(17,17,17,.35), rgba(17,17,17,0) 90%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  animation: spin 9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__portrait {
  position: relative; width: 78%; height: 78%; border-radius: 50%; object-fit: cover; object-position: 50% 20%;
  filter: saturate(.85) contrast(1.02); animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.015); } }
.hero__tag {
  position: absolute; bottom: 10%; inset-inline-start: 8%;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(17,17,17,.08); font-size: 12px; font-weight: 500; line-height: 1;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fn-normal); flex: none; position: relative; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--fn-normal); opacity: 0; animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

.intro__copy { text-align: center; max-width: 360px; }
.intro__copy .caps { margin-top: 6px; }
h1 { margin: 0; font-size: clamp(36px, 5.5vh, 46px); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.shine {
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 40%, #8a8a8a 50%, var(--ink) 60%, var(--ink) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s ease-in-out infinite;
}
@keyframes shine { 0% { background-position: 100% 0; } 60%, 100% { background-position: -50% 0; } }
.lede { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.9; }

.steps { list-style: none; margin: clamp(12px, 2.4vh, 22px) 0 0; padding: 0; width: 100%; max-width: 400px; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.steps li { padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.steps li + li { border-inline-start: 1px solid var(--line); }
.steps b { font-weight: 600; color: var(--ink); font-size: 14px; }

.intro__cta { margin-top: auto; padding-top: 22px; width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.intro__cta .btn { width: 100%; justify-content: space-between; padding-inline-start: 28px; }
.fine { margin: 0; text-align: center; font-size: 11.5px; line-height: 1.9; color: var(--ink-3); }

/* ---------- chat shell ---------- */

.chat { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }

.bar {
  position: relative; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 10px) 10px 12px var(--gutter);
  background: rgba(255,255,255,.7); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid rgba(17,17,17,.06); z-index: 3;
}
.who { display: flex; align-items: center; gap: 12px; }
.ava { position: relative; width: 48px; height: 48px; flex: none; display: grid; place-items: center; }
.ava img { position: relative; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.halo--mini { inset: -18px; width: 84px; height: 84px; }
.who__text { display: flex; flex-direction: column; line-height: 1.35; }
.who__text b { font-weight: 600; font-size: 16px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.status.busy .dot { background: var(--ink); }
.status.busy .dot::after { border-color: var(--ink); }
.status.busy #statusText { background: linear-gradient(90deg, var(--ink-2) 0%, var(--ink-2) 35%, #cfcfcf 50%, var(--ink-2) 65%, var(--ink-2) 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.scope { position: absolute; left: 0; right: 0; bottom: -14px; width: 100%; height: 28px; pointer-events: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }

.menu {
  position: absolute; top: calc(var(--safe-t) + 64px); inset-inline-end: 12px; z-index: 5; min-width: 220px; padding: 6px;
  background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; animation: pop .25s var(--ease);
}
.menu button { text-align: start; border: 0; background: none; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.menu button:active { background: var(--surface); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

.log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth;
  padding: 28px var(--gutter) 24px; display: flex; flex-direction: column; gap: 18px;
}
.log > * { max-width: 560px; width: 100%; margin-inline: auto; }

/* Behrad: text on the page, a thin rule on the reading side (the catalogue voice) */
.b { position: relative; padding-inline-start: 16px; animation: msgIn .55s var(--ease) both; }
.b::before { content: ""; position: absolute; inset-inline-start: 0; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--ink), rgba(17,17,17,.15)); transform-origin: top; animation: rule .7s var(--ease) both; }
@keyframes rule { from { transform: scaleY(0); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.b__text { white-space: pre-line; font-size: 15.5px; line-height: 1.95; overflow-wrap: anywhere; }
.b__text i, .b__text em { font-style: normal; color: var(--ink-2); }
.b__text b, .b__text strong { font-weight: 600; }
.b__text a { color: var(--ink); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.w { display: inline; animation: word .6s var(--ease) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes word { from { opacity: 0; filter: blur(6px); } }
.cmd { border: 0; background: var(--surface); border-radius: 999px; padding: 0 10px; font-size: .9em; font-weight: 500; }

/* functional colour, as the brand allows it: a 6px dot */
.fn-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-inline-end: 8px; vertical-align: middle; position: relative; top: -1px; }
.fn-dot--ok { background: var(--fn-normal); }
.fn-dot--warn { background: #F5C400; }

/* report flag: quiet until touched, beside each of Behrad's messages */
.b { padding-inline-end: 30px; }
.flag { position: absolute; top: 0; inset-inline-end: -6px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); opacity: .55; transition: opacity .2s ease, color .2s ease, background-color .2s ease; }
.flag:hover, .flag:focus-visible { opacity: 1; color: var(--ink); }
.flag:active { background: rgba(17,17,17,.06); }
.flag.sent { opacity: 1; color: var(--ink); }
.flag.sent path { fill: currentColor; }

/* keyboard chips */
.kb { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kb button, .kb a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(17,17,17,.2); background: rgba(255,255,255,.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 14px; font-weight: 500; line-height: 1.4; text-decoration: none; color: var(--ink); text-align: start;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .2s var(--ease);
  animation: msgIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}
.kb button:active, .kb a:active { transform: scale(.97); }
.kb .on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kb .on::before { content: ""; width: 12px; height: 7px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg) translate(1px, -2px); }
.kb .primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kb .ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.kb a::after { content: "↖"; font-size: 13px; opacity: .6; }
.kb.used { opacity: .45; pointer-events: none; }
.kb.used .picked { opacity: 1; }

/* voice */
.voice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.play {
  position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ink); background: var(--bg);
  display: grid; place-items: center; color: var(--ink); transition: background-color .25s ease, color .25s ease;
}
.play svg { fill: currentColor; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.playing .play { background: var(--ink); color: var(--bg); }
.playing .play::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(17,17,17,.25); animation: ping 1.6s var(--ease) infinite; }
.wave { height: 34px; width: 100%; cursor: pointer; touch-action: none; }
.dur { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 32px; text-align: end; }
.cap { margin-top: 10px; white-space: pre-line; font-size: 15.5px; line-height: 1.95; }
.cap .k { color: var(--ink-3); transition: color .25s ease; }
.cap .k.said { color: var(--ink); }
.voice-only .cap .k { color: var(--ink); }

/* video */
.vid { position: relative; border-radius: 4px; overflow: hidden; background: var(--surface); max-width: 320px; }
.vid video { width: 100%; height: auto; }
.vid__sound {
  position: absolute; bottom: 10px; inset-inline-end: 10px; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 12px;
  background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* the welcome stage: Behrad in the middle, light moving round him with his voice */
.b--stage { padding-inline: 0; display: flex; flex-direction: column; align-items: center; }
.b--stage::before { display: none; }
.b--stage .flag { top: 6px; inset-inline-end: 0; }
.stage { position: relative; width: min(60vw, 260px); aspect-ratio: 7 / 8; margin: 54px auto 46px; }
.stage__halo { position: absolute; left: -28%; top: -21%; width: 156%; height: 142%; pointer-events: none; }
.stage__frame { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: var(--surface); cursor: pointer; animation: stageIn 1s var(--ease) both; }
@keyframes stageIn { from { opacity: 0; transform: scale(.94); filter: blur(12px); } }
.stage__frame video { width: 100%; height: 100%; object-fit: cover; }
/* a thin light that runs round the frame while he speaks */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.stage__frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--sweep), rgba(255,255,255,0) 0deg, rgba(255,255,255,.9) 40deg, rgba(255,255,255,0) 90deg, rgba(255,255,255,0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .6s ease; animation: sweep 3.2s linear infinite; }
.stage.live .stage__frame::after { opacity: 1; }
@keyframes sweep { to { --sweep: 360deg; } }
.stage__play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.stage.muted .stage__frame::before { content: "برای صدا بزنید"; position: absolute; z-index: 1; bottom: 12px; left: 50%; translate: -50% 0; padding: 5px 12px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.85); }
.stage__cap { max-width: 440px; margin: 0 auto; padding: 0 8px; text-align: center; }
.stage__skip { margin: 14px auto 0; display: block; }
/* the welcome holds the screen: room below it so it can sit at the top */
.b--stage { min-height: calc(100dvh - 200px); justify-content: center; }

/* the user */
/* The user's replies sit on the end side (left), Behrad's voice runs from the start side like the page text. */
.u { display: flex; justify-content: flex-end; animation: uIn .4s var(--ease) both; }
@keyframes uIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.u__bubble { max-width: 82%; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 20px 20px 20px 6px; font-size: 15px; line-height: 1.85; white-space: pre-line; overflow-wrap: anywhere; }
.u__bubble.voice { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; min-width: 210px; padding: 8px 10px 8px 14px; }
.u__bubble .play { width: 36px; height: 36px; border-color: var(--bg); background: transparent; color: var(--bg); }
.u__bubble.playing .play { background: var(--bg); color: var(--ink); }
.u__bubble .dur { color: rgba(255,255,255,.6); }
.u__bubble .wave { height: 28px; }

/* thinking */
.think { display: flex; align-items: center; gap: 12px; padding-inline-start: 16px; color: var(--ink-2); font-size: 14px; animation: msgIn .4s var(--ease) both; }
.think__orb { position: relative; width: 22px; height: 22px; flex: none; }
.think__orb::before, .think__orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.think__orb::before { background: conic-gradient(from 0deg, rgba(17,17,17,0), var(--ink), rgba(17,17,17,0) 70%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); animation: spin 1s linear infinite; }
.think__orb::after { inset: 6px; background: var(--ink); animation: core 1.4s ease-in-out infinite; }
@keyframes core { 50% { transform: scale(.55); opacity: .5; } }
.think__dots { display: inline-flex; gap: 5px; }
.think__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); animation: dot 1.2s ease-in-out infinite; }
.think__dots i:nth-child(2) { animation-delay: .15s; }
.think__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.gone { animation: out .35s ease both; }
@keyframes out { to { opacity: 0; transform: translateY(-4px); filter: blur(4px); } }
.sys { text-align: center; font-size: 12px; color: var(--ink-3); }

/* ---------- composer ---------- */

.composer {
  flex: none; position: relative; padding: 10px var(--gutter) calc(var(--safe-b) + 12px);
  background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.92) 22%);
}
.cmp { max-width: 560px; margin-inline: auto; display: flex; align-items: flex-end; gap: 10px; }
.field {
  flex: 1; display: flex; align-items: center; min-height: 56px; padding: 8px 18px; border-radius: 28px;
  background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(17,17,17,.14); transition: border-color .25s ease;
}
.field:focus-within { border-color: var(--ink); }
.field textarea, .field input { flex: 1; width: 100%; border: 0; outline: 0; background: transparent; resize: none; font-size: 16px; line-height: 1.7; max-height: 132px; padding: 0; }
.field textarea::placeholder, .field input::placeholder { color: var(--ink-3); }
.field--phone input { letter-spacing: .06em; text-align: left; }
.cmp--phone { flex-wrap: wrap; align-items: center; }
.cmp--phone .field { flex-basis: 100%; }
.cmp--phone .btn { flex: 1; }

.mic {
  position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--ink); color: var(--bg); display: grid; place-items: center; transition: transform .25s var(--ease);
}
.mic:active { transform: scale(.94); }
.mic:disabled { background: #c9c9c9; }
.mic svg { position: relative; transition: opacity .2s ease, transform .3s var(--ease); }
.mic .i-send { position: absolute; opacity: 0; transform: scale(.6); }
.mic.has-text .i-mic { opacity: 0; transform: scale(.6); }
.mic.has-text .i-send { opacity: 1; transform: none; }
.mic__glow { position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(17,17,17,.22), transparent); opacity: 0; transform: scale(var(--lv, 1)); transition: opacity .3s ease; }
.mic--send .mic__glow { opacity: 1; }

.cmp--rec { align-items: center; }
.rec { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; border-radius: 28px; background: var(--surface); }
.rec__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: core 1s ease-in-out infinite; }
.rec__wave { flex: 1; height: 36px; width: 100%; }
.rec__time { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 34px; }
.cmp__hint { max-width: 560px; margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--ink-3); }

.toast {
  position: fixed; z-index: 10; left: 50%; bottom: calc(var(--safe-b) + 96px); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-size: 13px; line-height: 1.7; animation: pop .25s var(--ease);
}

@media (min-width: 720px) {
  .chat { max-width: 720px; margin-inline: auto; border-inline: 1px solid rgba(17,17,17,.06); background: rgba(255,255,255,.5); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- routine motion (full screen) ---------- */

.rt { position: fixed; inset: 0; z-index: 30; color: var(--ink); background: var(--bg); overflow: hidden; display: flex; flex-direction: column; animation: rtIn .5s var(--ease) both; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.rt.closing { animation: rtOut .45s ease both; }
@keyframes rtIn { from { opacity: 0; transform: scale(1.03); filter: blur(10px); } }
@keyframes rtOut { to { opacity: 0; transform: scale(.98); filter: blur(8px); } }
.rt.dark { color: #F5F5F4; background: var(--ink); }
.rt { transition: color .4s ease; }

.rt-bg { position: absolute; inset: -20%; filter: blur(70px); pointer-events: none; opacity: .9; }
.rt-bg i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; }
.rt-bg i:nth-child(1) { top: -5%; right: -20%; background: radial-gradient(closest-side, #e7e7e4, transparent 70%); animation: drift1 16s ease-in-out infinite alternate; }
.rt-bg i:nth-child(2) { bottom: -10%; left: -25%; background: radial-gradient(closest-side, #efefed, transparent 70%); animation: drift2 18s ease-in-out infinite alternate; }
.rt.dark .rt-bg i:nth-child(1) { background: radial-gradient(closest-side, #2a2a2a, transparent 70%); }
.rt.dark .rt-bg i:nth-child(2) { background: radial-gradient(closest-side, #222, transparent 70%); }

.rt-wipe { position: absolute; inset: 0; pointer-events: none; clip-path: circle(0 at 50% 22%); z-index: 1; }
.rt-wipe.to-dark { background: var(--ink); }
.rt-wipe.to-light { background: var(--bg); }
.rt-wipe.go { animation: wipe .9s cubic-bezier(.7,0,.2,1) both; }
@keyframes wipe { 0% { clip-path: circle(0 at 50% 22%); opacity: 1; } 70% { clip-path: circle(150% at 50% 22%); opacity: 1; } 100% { clip-path: circle(150% at 50% 22%); opacity: 0; } }

.rt-top { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) 10px 0 var(--gutter); }
.rt-bars { flex: 1; display: flex; gap: 4px; direction: rtl; }
.rt-bars span { flex: 1; height: 2px; border-radius: 2px; background: rgba(17,17,17,.14); overflow: hidden; }
.rt-bars i { display: block; height: 100%; background: currentColor; transform: scaleX(0); transform-origin: right; }
.rt.dark .rt-bars span { background: rgba(255,255,255,.2); }
.rt-close { color: inherit; }
.rt.dark .rt-close:active { background: rgba(255,255,255,.1); }

.rt-stage { position: relative; z-index: 2; flex: 1; min-height: 0; }
.rt-scene { position: absolute; inset: 0; padding: 18px var(--gutter) calc(var(--safe-b) + 36px); display: flex; flex-direction: column; justify-content: center; overflow-y: auto; scrollbar-width: none; }
.rt-scene::-webkit-scrollbar { display: none; }
.rt-scene > * { width: 100%; max-width: 460px; margin-inline: auto; }
.rt-scene.out { animation: sceneOut .45s ease both; }
@keyframes sceneOut { to { opacity: 0; transform: translateY(-18px); filter: blur(8px); } }
.rt-hint { position: absolute; z-index: 3; bottom: calc(var(--safe-b) + 12px); left: 0; right: 0; text-align: center; font-size: 11px; color: var(--ink-3); animation: fadeHint 1s 2.5s both; }
@keyframes fadeHint { from { opacity: 0; } }
.rt.paused .rt-hint::after { content: " · مکث"; }

.rt-caps { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); line-height: 1.4; margin: 0; }
.rt.dark .rt-caps { color: #9A9A9A; }
.rt-draw { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s cubic-bezier(.6,0,.2,1) .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* intro */
.rt-intro { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 0; }
.rt-orbit { position: absolute; left: 50%; top: 50%; width: min(96vw, 440px); transform: translate(-50%, -50%) rotate(-90deg); opacity: .5; animation: orbitSpin 30s linear infinite; }
.rt-draw--2 { stroke-dasharray: .06 .03; animation-duration: 2.4s; opacity: .6; }
@keyframes orbitSpin { to { transform: translate(-50%, -50%) rotate(270deg); } }
.rt-intro .rt-caps { animation: up .7s var(--ease) .1s both; }
.rt-name { margin: 14px 0 0; font-size: 20px; color: var(--ink-2); animation: up .7s var(--ease) .3s both; }
.rt-title { margin: 0; padding-inline: 8px; font-size: clamp(26px, 8vw, 44px); line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.rt-w { display: inline-block; animation: wordUp .9s var(--ease) both; animation-delay: calc(.45s + var(--i) * 110ms); }
@keyframes wordUp { from { opacity: 0; transform: translateY(18px); filter: blur(10px); } }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
.rt-sub { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); animation: up .7s var(--ease) 1.2s both; }
.rt-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 0; }
.rt-tags span { padding: 4px 12px; border: 1px solid rgba(17,17,17,.18); border-radius: 999px; font-size: 13px; animation: up .6s var(--ease) both; animation-delay: calc(1.45s + var(--i) * 90ms); }

/* morning / night / weekly */
.rt-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.rt-head h2 { margin: 2px 0 0; font-size: clamp(30px, 9vw, 40px); line-height: 1.3; font-weight: 700; animation: wordUp .8s var(--ease) .15s both; }
.rt-head .rt-caps { animation: up .6s var(--ease) both; }
.rt-count { margin: 0; font-size: 13px; color: var(--ink-3); animation: up .6s var(--ease) .35s both; }
.rt-sun, .rt-moon, .rt-week { width: 84px; height: 84px; flex: none; }
.rt-sun { animation: spin 40s linear infinite; }
.rt-ray { stroke: currentColor; stroke-width: 1; stroke-linecap: round; opacity: 0; animation: ray .5s var(--ease) both; animation-delay: calc(.5s + var(--i) * 50ms); }
@keyframes ray { from { opacity: 0; transform: scale(.7); transform-origin: 60px 60px; } to { opacity: 1; } }
.rt-moon .rt-draw { stroke-width: 1.2; }
.rt-moon { filter: drop-shadow(0 0 18px rgba(255,255,255,.18)); }
.rt-week circle { fill: currentColor; opacity: 0; animation: up .5s var(--ease) both, twinkle 2.4s ease-in-out infinite; animation-delay: calc(.3s + var(--i) * 80ms), calc(1s + var(--i) * 200ms); }
@keyframes twinkle { 50% { opacity: .35; } }
.rt-week circle { opacity: 1; }

.rt-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rt-row { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 6px 10px; padding: 14px 0; animation: rowIn .8s var(--ease) both; animation-delay: calc(.9s + var(--i) * 650ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-26px); filter: blur(8px); } }
.rt-line { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; opacity: .14; transform-origin: right; animation: line .9s var(--ease) both; animation-delay: calc(1s + var(--i) * 650ms); }
@keyframes line { from { transform: scaleX(0); } }
.rt-n { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-3); padding-top: 6px; letter-spacing: .04em; }
.rt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rt-body b { font-size: 21px; font-weight: 600; line-height: 1.5; }
.rt-why { font-size: 13px; line-height: 1.8; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rt.dark .rt-why, .rt.dark .rt-n { color: #9A9A9A; }
.rt-mark { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--ink-2); animation: up .5s var(--ease) both; animation-delay: calc(1.35s + var(--i) * 650ms); }
.rt.dark .rt-mark { color: #BDBDBD; }
.rt-mark i, .rt-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; display: inline-block; }
.rt-mark--ok i, .rt-dot--ok { background: var(--fn-normal); }
.rt-mark--add i, .rt-dot--add { background: #F5C400; }
.rt-mark--rev i, .rt-dot--rev { background: transparent; border: 1px solid currentColor; }

/* summary */
.rt-summary { display: flex; flex-direction: column; gap: 6px; }
.rt-summary > * { animation: up .7s var(--ease) both; }
.rt-summary > :nth-child(2) { animation-delay: .1s; }
.rt-summary h2 { margin: 2px 0 14px; font-size: clamp(28px, 8vw, 36px); line-height: 1.35; font-weight: 700; }
.rt-cols { display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid var(--line); animation-delay: .2s !important; }
.rt-col { padding: 14px 0 16px; }
.rt-col + .rt-col { border-inline-start: 1px solid var(--line); padding-inline-start: 14px; }
.rt-col ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rt-col li { display: flex; align-items: center; gap: 8px; font-size: 14.5px; line-height: 1.6; animation: up .5s var(--ease) both; animation-delay: calc(.35s + var(--i) * 70ms); }
.rt-legend { display: flex; gap: 16px; margin: 8px 0 0; font-size: 12px; color: var(--ink-2); animation-delay: .4s !important; }
.rt-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.rt-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; animation-delay: .55s !important; }
.rt-pack { width: 100%; justify-content: space-between; padding-inline-start: 24px; min-height: 64px; text-decoration: none; position: relative; overflow: hidden; }
.rt-pack > span:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.rt-pack b { font-weight: 600; font-size: 16px; }
.rt-pack small { font-size: 12px; opacity: .7; font-weight: 400; }
.rt-pack::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.2s ease-in-out 1.2s infinite; }
@keyframes sheen { 40%, 100% { transform: translateX(100%); } }
.rt-cta__row { display: flex; gap: 10px; align-items: center; }
.rt-cta__row .btn { flex: 1; min-height: 52px; }
.rt-cta__row .icon-btn { width: 52px; height: 52px; border: 1px solid rgba(17,17,17,.2); }

/* the chat keeps a card to open it again */
.rt-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid rgba(17,17,17,.14); border-radius: 16px; background: rgba(255,255,255,.7); text-align: start; animation: msgIn .5s var(--ease) both; }
.rt-card__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; position: relative; }
.rt-card__icon::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(17,17,17,.2); animation: ping 2.4s var(--ease) infinite; }
.rt-card b { display: block; font-weight: 600; font-size: 15px; }
.rt-card small { color: var(--ink-2); font-size: 12px; }

/* products page (after the summary). The discount is said once, plainly, and shown on every price: struck list
   price in grey, the package price in ink. No red, no bursts, no countdowns. */
.rt.on-products .rt-bars { opacity: .35; }
.rt-scene--products { justify-content: flex-start; padding-top: 22px; padding-bottom: calc(var(--safe-b) + 110px); }
.rt-products { display: flex; flex-direction: column; gap: 4px; transition: filter .8s var(--ease), opacity .8s ease, transform .8s var(--ease); }
.rt-products.veiled { filter: blur(16px); opacity: .55; transform: scale(.985); pointer-events: none; }
.rt-products > * { animation: up .7s var(--ease) both; }
.rt-products h2 { margin: 2px 0 6px; font-size: clamp(28px, 8vw, 36px); line-height: 1.35; font-weight: 700; animation-delay: .05s; }
.rt-offer { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 13px; color: var(--ink-2); animation-delay: .1s; }
.rt-off { display: inline-grid; place-items: center; min-width: 46px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rt-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; animation: none; }
.rt-grid li { display: flex; flex-direction: column; gap: 2px; min-width: 0; animation: up .7s var(--ease) both; animation-delay: calc(.12s + var(--i) * 90ms); }
.rt-img { position: relative; aspect-ratio: 1; border-radius: 4px; background: var(--surface); overflow: hidden; margin-bottom: 8px; display: grid; place-items: center; }
.rt-img img { width: 100%; height: 100%; object-fit: cover; animation: imgIn .8s var(--ease) both; }
.rt-img .rt-img__none { width: 34%; height: auto; opacity: .12; object-fit: contain; }
@keyframes imgIn { from { opacity: 0; transform: scale(1.06); filter: blur(6px); } }
.rt-tag { position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(17,17,17,.88); color: #fff; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.rt-grid b { font-size: 14.5px; font-weight: 600; line-height: 1.6; }
.rt-grid small { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.rt-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rt-price s { font-size: 12px; color: var(--ink-3); text-decoration-thickness: 1px; }
.rt-price strong { font-size: 14.5px; font-weight: 600; }
.rt-price i, .rt-total i { font-style: normal; font-size: .82em; font-weight: 400; color: var(--ink-2); }
.rt-total { margin: 24px 0 4px; padding: 16px 0 6px; border-top: 1px solid var(--line); animation-delay: .35s !important; }
.rt-total__row { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.rt-total__row s { color: var(--ink-3); text-decoration-thickness: 1px; font-variant-numeric: tabular-nums; }
.rt-total__row--now { color: var(--ink); }
.rt-total__row--now b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rt-total__save { margin: 0; text-align: end; font-size: 12px; color: var(--ink-2); }
.rt-quote { margin: 18px 0 0; display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; animation-delay: .45s !important; }
.rt-quote img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; grid-row: span 2; }
.rt-quote blockquote { margin: 0; padding-inline-start: 14px; border-inline-start: 1px solid var(--ink); font-size: 14.5px; line-height: 1.95; }
.rt-quote figcaption { grid-column: 2; padding-inline-start: 14px; font-size: 12px; color: var(--ink-3); }
.rt-buy { margin-top: 20px; animation-delay: .55s !important; }
.rt-back { align-self: center; margin-top: 10px; animation-delay: .6s !important; }

/* Behrad before the page: large and centred, then a small circle in the corner */
.rt-pv { position: absolute; z-index: 4; left: calc(50% - min(39vw, 180px)); top: calc(54% - min(78vw, 360px) * .625); width: min(78vw, 360px); aspect-ratio: 4 / 5; transform-origin: 0 0; border-radius: 14px; overflow: hidden; background: var(--ink); animation: pvIn .7s var(--ease) both; }
@keyframes pvIn { from { opacity: 0; filter: blur(10px); } }
.rt-pv video { width: 100%; height: 100%; object-fit: cover; }
.rt-pv__skip { position: absolute; top: 12px; inset-inline-end: 12px; border: 0; border-radius: 999px; padding: 6px 16px; font-size: 12px; background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.rt-pv__name { position: absolute; top: 12px; inset-inline-start: 12px; padding: 3px 10px; border-radius: 999px; font-size: 11px; color: #fff; background: rgba(17,17,17,.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.rt-pv.corner { left: 16px; top: calc(100% - var(--safe-b) - 86px); width: 68px; aspect-ratio: 1; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px rgba(17,17,17,.12), 0 0 0 5px rgba(255,255,255,.9); animation: none; }
.rt-pv.corner .rt-pv__skip, .rt-pv.corner .rt-pv__name, .rt-pv.corner .rt-pv__cap { display: none; }
.rt-pv__cap { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 40px 14px 14px; font-size: 13.5px; line-height: 1.9; text-align: center; color: rgba(255,255,255,.45); background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.rt-pv__cap:empty { display: none; }
.rt-pv__cap .said { color: #fff; }
