:root {
  --ink: #14171F;
  --ink-soft: #2A2E3A;
  --paper: #FAF9F6;
  --paper-dim: #F1EFE9;
  --blue: #3B5BFF;
  --blue-dim: #E8ECFF;
  --sage: #6B8F71;
  --sage-dim: #E9F0E9;
  --gray: #8B8D98;
  --line: rgba(20, 23, 31, 0.1);

  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --ink: #F4F3EF;
  --ink-soft: #C7C9D3;
  --paper: #14171F;
  --paper-dim: #1B1F2A;
  --blue: #6E85FF;
  --blue-dim: #232A47;
  --sage: #8FB596;
  --sage-dim: #202C22;
  --gray: #8B8D98;
  --line: rgba(244, 243, 239, 0.12);
}

[data-theme="dark"] .contact-section {
  background: #0B0D12;
}

body {
  transition: background 0.25s ease, color 0.25s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body {
  font-family: 'Noto Kufi Arabic', var(--body);
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Focus ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- Nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo span {
  color: var(--blue);
}

.nav-links {
  display: flex;
  gap: 36px;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a {
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--blue);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-cta {
  background: var(--ink);
  color: var(--paper) !important;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--blue);
}

.nav-toggle {
  display: none;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--ink);
  background: var(--paper-dim);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* ---------- Language toggle ---------- */
.lang-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--gray);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:not(:last-child) {
  border-right: 1px solid var(--line);
}

html[dir="rtl"] .lang-btn:not(:last-child) {
  border-right: none;
  border-left: 1px solid var(--line);
}

.lang-btn:hover {
  color: var(--ink);
  background: var(--paper-dim);
}

.lang-btn.active {
  color: var(--paper);
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  padding: 100px 0 80px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  display: inline-block;
  flex-shrink: 0;
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 820px;
}

h1 .accent {
  color: var(--blue);
}

.hero-sub {
  margin-top: 26px;
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 560px;
  line-height: 1.6;
}

.hero-ctas {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--blue);
  color: white;
  padding: 14px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  display: inline-block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 91, 255, 0.28);
}

.btn-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 14px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  display: inline-block;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--paper-dim);
}

/* ---------- Hero benefits row ---------- */
.hero-benefits {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.hero-benefit {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

.hero-benefit-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sage-dim);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-benefit-icon svg {
  width: 12px;
  height: 12px;
}

/* ---------- Trust strip ---------- */
.trust-strip {
  margin-top: 22px;
  display: inline-block;
  padding: 10px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gray);
  line-height: 1.5;
}

@media (max-width: 520px) {
  .hero-benefits {
    gap: 14px 22px;
  }

  .trust-strip {
    font-size: 12px;
  }
}

/* ---------- Workflow signature ---------- */
.workflow {
  margin-top: 72px;
  padding: 36px 0 8px;
}

.workflow-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 780px;
}

.workflow-track::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 7px;
  right: 7px;
  height: 1px;
  background: var(--line);
}

.workflow-line {
  position: absolute;
  top: 7px;
  left: 7px;
  height: 1px;
  background: var(--blue);
  width: 0;
  animation: draw-line 2.4s ease forwards 0.4s;
}

@keyframes draw-line {
  to {
    width: calc(100% - 14px);
  }
}

.w-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 33.33%;
}

.w-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  z-index: 2;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.w-node:nth-child(1) .w-dot {
  border-color: var(--gray);
}

.w-node:nth-child(2) .w-dot {
  animation: pulse-blue 2.4s ease forwards 1.1s;
}

.w-node:nth-child(3) .w-dot {
  animation: pulse-sage 2.4s ease forwards 2s;
}

@keyframes pulse-blue {
  0% {
    border-color: var(--gray);
    background: var(--paper);
  }

  100% {
    border-color: var(--blue);
    background: var(--blue);
  }
}

@keyframes pulse-sage {
  0% {
    border-color: var(--gray);
    background: var(--paper);
  }

  100% {
    border-color: var(--sage);
    background: var(--sage);
  }
}

.w-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray);
  text-align: center;
}

.w-node:nth-child(1) .w-label {
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {

  .workflow-line,
  .w-dot {
    animation: none !important;
    width: calc(100% - 14px);
  }

  .w-node:nth-child(2) .w-dot {
    border-color: var(--blue);
    background: var(--blue);
  }

  .w-node:nth-child(3) .w-dot {
    border-color: var(--sage);
    background: var(--sage);
  }
}

/* ---------- Section shared ---------- */
section {
  padding: 88px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.section-tag {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 14px;
  display: block;
}

h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -0.015em;
  max-width: 560px;
}

.section-desc {
  color: var(--gray);
  font-size: 16px;
  max-width: 360px;
  line-height: 1.65;
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.service {
  background: var(--paper);
  padding: 40px;
  transition: background 0.2s ease;
}

.service:hover {
  background: var(--paper-dim);
}

.service-kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 18px;
}

.service h3 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 12px;
}

.service p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

.service-tags {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.service-tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--blue-dim);
  color: var(--blue);
}

.service:nth-child(2) .service-tag,
.service:nth-child(4) .service-tag {
  background: var(--sage-dim);
  color: var(--sage);
}

/* ---------- Process ---------- */
.process-list {
  border-top: 1px solid var(--line);
}

.process-row {
  display: grid;
  grid-template-columns: 80px 1fr 1.4fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.process-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gray);
}

.process-row h3 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
}

.process-row p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

/* ---------- Work / results ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.work-card {
  border: 1px solid var(--line);
  padding: 32px;
  border-radius: 8px;
  background: var(--paper);
}

.work-metric {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.work-card:nth-child(2) .work-metric {
  color: var(--sage);
}

.work-label {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 8px;
  margin-bottom: 20px;
}

.work-quote {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.work-quote strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 20px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.stat {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.stat-num {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
}

.stat-label {
  font-size: 13px;
  color: var(--gray);
  margin-top: 4px;
}

/* ---------- Contact ---------- */
.contact-section {
  background: var(--ink);
  color: var(--paper);
  border-bottom: none;
}

.contact-section .section-tag {
  color: #8FA3FF;
}

.contact-section h2 {
  color: var(--paper);
}

.contact-section .section-desc {
  color: rgba(250, 249, 246, 0.55);
}

.contact-section .nav-cta,
.contact-section .btn-secondary {
  color: var(--paper);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.contact-info-item {
  padding: 20px 0;
  border-top: 1px solid rgba(250, 249, 246, 0.15);
}

.contact-info-item .label {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(250, 249, 246, 0.5);
  margin-bottom: 6px;
}

.contact-info-item .value {
  font-size: 17px;
  font-weight: 500;
}

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(250, 249, 246, 0.5);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(250, 249, 246, 0.25);
  border-radius: 6px;
  padding: 13px 14px;
  color: var(--paper);
  font-family: var(--body);
  font-size: 15px;
  transition: border-color 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(250, 249, 246, 0.35);
}

.field input:focus,
.field textarea:focus {
  border-color: #8FA3FF;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

.submit-btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 15px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  font-family: var(--body);
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 6px;
}

.submit-btn:hover {
  background: #506EFF;
}

/* ---------- Problem ---------- */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.problem-card {
  padding: 32px 0 0;
  border-top: 1px solid var(--line);
}

.problem-card .mark {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray);
  display: block;
  margin-bottom: 16px;
}

.problem-card p {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

/* ---------- Why us ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.why-card {
  background: var(--paper);
  padding: 36px;
}

.why-card h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.why-card p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- FAQ ---------- */
.faq-list {
  border-top: 1px solid var(--line);
  max-width: 760px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  font-family: var(--body);
  color: var(--ink);
}

html[dir="rtl"] .faq-q {
  text-align: right;
}

.faq-q span:first-child {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.faq-icon {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--gray);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-item.open .faq-a {
  max-height: 240px;
}

.faq-a p {
  padding-bottom: 24px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
  max-width: 620px;
}

/* ---------- WhatsApp CTA ---------- */
.wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: white !important;
  padding: 14px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  transition: filter 0.15s ease;
}

.wa-cta:hover {
  filter: brightness(0.95);
}

@media (max-width: 860px) {
  .problem-grid {
    grid-template-columns: 1fr;
  }

  .why-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */
footer {
  padding: 32px 0;
  background: var(--ink);
  color: rgba(250, 249, 246, 0.5);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-row a {
  color: rgba(250, 249, 246, 0.7);
}

.footer-row a:hover {
  color: var(--paper);
}

/* ---------- Section CTA ---------- */
.section-cta {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.section-cta-text {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  max-width: 460px;
}

.section-cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.contact-section .section-cta {
  border-top-color: rgba(250, 249, 246, 0.15);
}

.contact-section .section-cta-text {
  color: var(--paper);
}

@media (max-width: 620px) {
  .section-cta {
    margin-top: 44px;
    padding-top: 32px;
  }

  .section-cta-text {
    font-size: 17px;
  }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Chatbot widget ---------- */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(59, 91, 255, 0.4);
  z-index: 300;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

html[dir="rtl"] .chat-toggle {
  right: auto;
  left: 24px;
}

.chat-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 34px rgba(59, 91, 255, 0.48);
}

.chat-toggle svg {
  width: 24px;
  height: 24px;
}

.chat-toggle .icon-close {
  display: none;
}

.chat-toggle.open .icon-chat {
  display: none;
}

.chat-toggle.open .icon-close {
  display: block;
}

.chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.97);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

html[dir="rtl"] .chat-window {
  right: auto;
  left: 24px;
  transform-origin: bottom left;
}

.chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  background: #14171F;
  color: #F4F3EF;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-header .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header .avatar svg {
  width: 17px;
  height: 17px;
  color: white;
}

.chat-header .header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-header .title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  color: #F4F3EF;
}

.chat-header .status {
  font-size: 12px;
  color: rgba(244, 243, 239, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.chat-header .status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8FB596;
  flex-shrink: 0;
}

.chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--paper);
}

.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.chat-msg {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.bot {
  background: var(--paper-dim);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

html[dir="rtl"] .chat-msg.bot {
  align-self: flex-end;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}

.chat-msg.user {
  background: var(--blue);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

html[dir="rtl"] .chat-msg.user {
  align-self: flex-start;
  border-bottom-right-radius: 14px;
  border-bottom-left-radius: 4px;
}

.chat-msg.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px 16px;
}

.chat-msg.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.chat-msg.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-msg.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}

.chat-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 11px 16px;
  font-family: var(--body);
  font-size: 14px;
  background: var(--paper-dim);
  color: var(--ink);
}

.chat-input-row input::placeholder {
  color: var(--gray);
}

.chat-input-row input:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--paper);
}

.chat-send {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.chat-send:hover:not(:disabled) {
  background: #506EFF;
  transform: scale(1.04);
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-send svg {
  width: 17px;
  height: 17px;
}

html[dir="rtl"] .chat-send svg {
  transform: scaleX(-1);
}

@media (max-width: 520px) {
  .chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 84px;
    height: min(560px, calc(100vh - 120px));
  }

  html[dir="rtl"] .chat-window {
    left: 12px;
  }

  .chat-toggle {
    right: 16px;
    bottom: 16px;
  }

  html[dir="rtl"] .chat-toggle {
    left: 16px;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    margin-bottom: 40px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .process-row {
    grid-template-columns: 50px 1fr;
  }

  .process-row p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 0 20px;
  }

  nav {
    padding: 18px 20px;
  }

  .hero {
    padding: 64px 0 56px;
  }

  section {
    padding: 64px 0;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }
}
