@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('../fonts/IBMPlexSansArabic-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('../fonts/IBMPlexSansArabic-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('../fonts/IBMPlexSansArabic-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Reem Kufi'; src: url('../fonts/ReemKufi.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #12243F;
  --ink-2: #1B3354;
  --teal: #2FA6A0;
  --teal-d: #1A7F7A;
  --blue: #1E5AA8;
  --mist: #F2F6FA;
  --line: #D6E0EA;
  --text: #1B2B40;
  --muted: #5B6B7C;
  --signal: #F4B942;
  --display: 'Reem Kufi', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: #fff; color: var(--text);
  font-family: var(--body); font-size: 17px; line-height: 1.75;
}
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.25; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.top {
  max-width: var(--maxw); margin-inline: auto; padding: 16px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.nav { display: flex; gap: 6px; margin-inline-start: auto; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 15px; }
.nav a:hover { background: var(--mist); color: var(--ink); }
.lang { border: 1.5px solid var(--line); background: #fff; color: var(--ink); padding: 7px 16px; border-radius: 999px; font-weight: 500; font-size: 15px; cursor: pointer; }
.lang:hover { border-color: var(--ink); }

/* ---------- intro ---------- */
.intro { padding-block: 28px 22px; }
.intro h1 { font-size: clamp(36px, 5.4vw, 62px); letter-spacing: 0; text-wrap: balance; }
.lead { margin-top: 12px; max-width: 62ch; font-size: 19px; color: var(--muted); text-wrap: pretty; }
.demo-note { margin-top: 14px; display: inline-block; font-size: 14.5px; color: #7A5A00; background: #FFF4D6; border: 1px solid #F0DDA4; padding: 4px 14px; border-radius: 14px; }
.setup-note { margin-top: 12px; max-width: 70ch; font-size: 14.5px; color: #8A1F11; background: #FDECEA; border: 1px solid #F3C4BD; padding: 10px 14px; border-radius: 12px; }

/* ---------- console ---------- */
.console {
  display: grid; grid-template-columns: minmax(340px, 5fr) 7fr;
  border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  box-shadow: 0 30px 60px -36px rgba(18, 36, 63, .45);
  background: #fff;
}
.tabs { display: none; }

/* voice side */
.voice {
  position: relative; background: var(--ink); color: #fff;
  background-image: radial-gradient(circle at 50% 34%, rgba(47, 166, 160, .30), transparent 58%);
  padding: 32px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
}
.voice h2 { color: #fff; font-size: 24px; }

.orb {
  position: relative; margin-top: 18px; width: 168px; height: 168px; border-radius: 50%; border: 0;
  background: var(--teal); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(47, 166, 160, .20), 0 18px 40px -12px rgba(0, 0, 0, .5);
  transition: background-color .2s, color .2s, transform .15s;
}
.orb:hover { transform: scale(1.03); }
.orb:active { transform: scale(.98); }
.orb svg { width: 68px; height: 68px; grid-area: 1 / 1; }
.orb .ico-stop { display: none; }
.orb .ring { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--signal); opacity: 0; pointer-events: none; }

.voice[data-state="listening"] .orb { background: #fff; color: var(--ink); box-shadow: 0 0 0 10px rgba(244, 185, 66, .28), 0 18px 40px -12px rgba(0, 0, 0, .5); }
.voice[data-state="listening"] .ring { animation: ripple 1.8s ease-out infinite; }
.voice[data-state="listening"] .r2 { animation-delay: .9s; }
.voice[data-state="thinking"] .orb::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 4px solid transparent; border-top-color: #fff; border-inline-end-color: rgba(255, 255, 255, .35);
  animation: spin 1s linear infinite;
}
.voice[data-state="thinking"] .ico-mic, .voice[data-state="speaking"] .ico-mic { display: none; }
.voice[data-state="thinking"] .ico-stop, .voice[data-state="speaking"] .ico-stop { display: block; }

.wave { display: flex; align-items: center; justify-content: center; gap: 5px; height: 44px; }
.wave i { display: block; width: 5px; height: 6px; border-radius: 3px; background: var(--teal); opacity: .5; }
.voice[data-state="speaking"] .wave i { opacity: 1; animation: bar 1s ease-in-out infinite; }
.wave i:nth-child(1) { animation-delay: 0s; } .wave i:nth-child(2) { animation-delay: .12s; }
.wave i:nth-child(3) { animation-delay: .24s; } .wave i:nth-child(4) { animation-delay: .36s; }
.wave i:nth-child(5) { animation-delay: .48s; } .wave i:nth-child(6) { animation-delay: .36s; }
.wave i:nth-child(7) { animation-delay: .24s; } .wave i:nth-child(8) { animation-delay: .12s; }
.wave i:nth-child(9) { animation-delay: 0s; }

.status { font-family: var(--display); font-size: 22px; min-height: 1.6em; }
.heard { min-height: 1.7em; color: #BCCBDD; font-size: 16px; max-width: 34ch; }
.spoken {
  width: 100%; max-height: 170px; overflow: auto; text-align: start; background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; padding: 12px 16px; font-size: 16px; line-height: 1.8;
}
.voice-note { font-size: 14px; color: #FFD98A; max-width: 38ch; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.switch input { width: 18px; height: 18px; accent-color: var(--teal); cursor: pointer; }
.voice .switch { margin-top: auto; padding-top: 6px; color: #D7E2EF; }
.switch.small { font-size: 14px; color: var(--muted); }

/* chat side */
.chat { display: flex; flex-direction: column; padding: 22px 28px 20px; min-height: 540px; background: #fff; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chat-head h2 { font-size: 24px; }
.chat-tools { display: flex; align-items: center; gap: 16px; }
.linkbtn { background: none; border: 0; color: var(--blue); font-size: 14px; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }

.log { flex: 1; overflow-y: auto; min-height: 230px; max-height: 400px; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px 10px; scrollbar-width: thin; }
.msg { position: relative; max-width: 88%; padding: 10px 16px; border-radius: 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16.5px; line-height: 1.8; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-end-end-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--mist); border: 1px solid var(--line); border-end-start-radius: 6px; padding-inline-end: 40px; }
.msg.error { background: #FDECEA; border-color: #F3C4BD; color: #7A1A0E; }
.msg .via { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-inline-end: 6px; opacity: .8; }
.say { position: absolute; inset-inline-end: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.say:hover { background: #E3EBF3; color: var(--ink); }
.say svg { width: 17px; height: 17px; }
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.chips:empty { display: none; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 14.5px; cursor: pointer; text-align: start; }
.chip:hover { background: var(--mist); border-color: #B7C8DA; }

.composer { display: flex; align-items: flex-end; gap: 10px; border: 1.5px solid var(--line); border-radius: 20px; padding: 8px 8px 8px 8px; background: #fff; }
.composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 90, 168, .15); }
.composer textarea { flex: 1; border: 0; resize: none; background: transparent; font: inherit; font-size: 16.5px; line-height: 1.7; padding: 8px 10px; max-height: 130px; color: var(--text); }
.composer textarea:focus { outline: none; }
.send { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--teal-d); color: #fff; padding: 10px 20px; border-radius: 14px; font-weight: 500; font-size: 15.5px; cursor: pointer; }
.send:hover { background: #166B67; }
.send:disabled { background: #9DB7B5; cursor: default; }
.send svg { width: 18px; height: 18px; }
[dir="rtl"] .send svg { transform: scaleX(-1); }

/* ---------- sections ---------- */
section h2 { font-size: clamp(28px, 3.4vw, 40px); }

.how { padding-block: 96px 80px; }
.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.steps li { position: relative; border-top: 2px solid var(--line); padding: 28px 0 0; padding-inline-end: 24px; }
.steps .n { position: absolute; top: -17px; inset-inline-start: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--teal-d); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.steps h3 { font-size: 19px; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 15.5px; line-height: 1.7; }

.survey-band { background: var(--mist); padding-block: 88px; border-block: 1px solid var(--line); }
.survey { display: grid; grid-template-columns: 4fr 7fr; gap: 64px; align-items: start; }
.survey-copy p { margin-top: 14px; color: var(--muted); max-width: 40ch; }
.bars { display: flex; flex-direction: column; gap: 26px; }
.bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 8px; }
.bar-top span { max-width: 46ch; }
.bar-top strong { font-family: var(--display); font-size: 28px; color: var(--ink); direction: ltr; flex: none; }
.track { height: 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.track i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--teal); border-radius: 999px; }
.js .track i { width: 0; }
.js .bars.in .track i { width: calc(var(--v) * 1%); transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.js .bars.in .bar:nth-child(2) i { transition-delay: .08s; } .js .bars.in .bar:nth-child(3) i { transition-delay: .16s; }
.js .bars.in .bar:nth-child(4) i { transition-delay: .24s; } .js .bars.in .bar:nth-child(5) i { transition-delay: .32s; }

.team { padding-block: 88px 96px; }
.people { list-style: none; padding: 0; margin: 36px 0 0; border-bottom: 1px solid var(--line); }
.people li { display: grid; grid-template-columns: minmax(220px, 1fr) 1.4fr auto; align-items: center; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.pname { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); }
.prole { color: var(--muted); }
.tag { font-size: 14px; font-weight: 500; color: var(--teal-d); border: 1.5px solid var(--teal); border-radius: 999px; padding: 2px 14px; }
.people li:not(:has(.tag)) { grid-template-columns: minmax(220px, 1fr) 1.4fr; }

.foot { background: var(--ink); color: #C5D3E4; padding-block: 36px; font-size: 15px; }

/* ---------- animation ---------- */
@keyframes ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bar { 0%, 100% { height: 6px; } 50% { height: 40px; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .voice[data-state="speaking"] .wave i { height: 24px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .nav { display: none; }
  .lang { margin-inline-start: auto; }
  .console { grid-template-columns: 1fr; border-radius: 22px; }
  .tabs { display: flex; padding: 6px; gap: 6px; background: var(--mist); border-bottom: 1px solid var(--line); }
  .tabs button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 14px; font-size: 16px; font-weight: 500; color: var(--muted); cursor: pointer; }
  .tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(18, 36, 63, .18); }
  .console[data-tab="voice"] .chat { display: none; }
  .console[data-tab="chat"] .voice { display: none; }
  .voice { padding-block: 28px 30px; }
  .chat { padding: 20px 16px 18px; min-height: 0; }
  .log { max-height: 52vh; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { border-top: 0; border-inline-start: 2px solid var(--line); padding: 0 0 34px; padding-inline-start: 28px; }
  .steps .n { top: 0; inset-inline-start: -17px; }
  .survey { grid-template-columns: 1fr; gap: 36px; }
  .people li, .people li:not(:has(.tag)) { grid-template-columns: 1fr; gap: 4px; }
  .people .tag { justify-self: start; margin-top: 6px; }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .wrap, .top { padding-inline: 16px; }
  .intro { padding-top: 22px; }
  .orb { width: 148px; height: 148px; }
  .msg { max-width: 94%; }
  .send span { display: none; }
  .send { padding: 10px 14px; }
  .how, .survey-band, .team { padding-block: 64px; }
}
