:root {
  --bg: #f8f7ff;
  --bg-elev: #ffffff;
  --bg-elev-2: #f1eefc;
  --border: rgba(115, 87, 246, 0.1);
  --border-strong: rgba(115, 87, 246, 0.18);
  --text: #1a1530;
  --text-dim: #635b7a;
  --text-faint: #978fb0;
  --accent: #7357f6;
  --accent-2: #a18aff;
  --accent-soft: rgba(115, 87, 246, 0.1);
  --accent-ink: #ffffff;
  --silver: #b3a9e0;
  --font-display-ltr: 'Fraunces', serif;
  --font-body-ltr: 'Archivo', sans-serif;
  --font-display-rtl: 'Noto Kufi Arabic', sans-serif;
  --font-body-rtl: 'IBM Plex Sans Arabic', sans-serif;
  --header-bg: rgba(248, 247, 255, 0.75);
  --badge-border: rgba(115, 87, 246, 0.25);

  /* A small, fixed rotation of "pop" colors — used in a set order across
     the capability cards, steps, and security bullets so the page reads
     as deliberately colorful rather than randomly decorated. */
  --pop-1: #7357f6; /* purple */
  --pop-2: #38cfc3; /* turquoise */
  --pop-3: #ffb45b; /* warm orange */
  --pop-4: #ff7f9b; /* coral pink */
  --pop-5: #69bfff; /* sky blue */
}

:root[data-theme="dark"] {
  --bg: #151526;
  --bg-elev: #1c1c33;
  --bg-elev-2: #24243b;
  --border: rgba(161, 138, 255, 0.12);
  --border-strong: rgba(161, 138, 255, 0.22);
  --text: #edebfa;
  --text-dim: #a79fc2;
  --text-faint: #726b8c;
  --accent: #a18aff;
  --accent-2: #7357f6;
  --accent-soft: rgba(161, 138, 255, 0.16);
  --accent-ink: #151526;
  --silver: #8f85b8;
  --header-bg: rgba(21, 21, 38, 0.75);
  --badge-border: rgba(161, 138, 255, 0.3);

  /* Purple reads muddy against a near-purple dark background, so pop-1
     swaps to the lighter lavender here — everything else stays legible
     as-is against the dark surface. */
  --pop-1: #a18aff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body, .site-header, .cap-card, .shot-card, .mini-scan, .book-demo-inner,
.demo-form input, .demo-form select, .demo-form textarea {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body-ltr);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body { font-family: var(--font-body-rtl); }

h1, h2, h3, .brand, .quote {
  font-family: var(--font-display-ltr);
  font-weight: 600;
  letter-spacing: -0.01em;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .brand,
html[dir="rtl"] .quote {
  font-family: var(--font-display-rtl);
  font-weight: 700;
  letter-spacing: 0;
}

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

a { color: inherit; }

/* Background biometric-scan dot grid */
.scan-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 10%, transparent 75%);
  opacity: 0.6;
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  text-decoration: none;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand.small { font-size: 14px; white-space: normal; }

.main-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-dim);
}

.main-nav a { text-decoration: none; }
.main-nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang-toggle {
  font-size: 13px;
  text-decoration: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.theme-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.lang-toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-lg { padding: 15px 28px; font-size: 15px; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}

.btn-accent:hover { filter: brightness(1.07) saturate(1.1); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); transform: translateY(-1px); }

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

.reveal.in { opacity: 1; transform: none; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
}

/* Full-bleed to the actual screen edges — kept as a sibling of .hero-inner
   (rather than .hero::before) specifically so it isn't clipped to the
   1120px .wrap column the way the old .hero::before (painted on the same
   element as .wrap) used to be. */
.hero-glow {
  position: absolute;
  inset: -15% 0 auto 0;
  height: 620px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(420px circle at 18% 28%, color-mix(in srgb, var(--pop-1) 20%, transparent), transparent 70%),
    radial-gradient(380px circle at 85% 12%, color-mix(in srgb, var(--pop-2) 18%, transparent), transparent 70%),
    radial-gradient(360px circle at 55% 95%, color-mix(in srgb, var(--pop-4) 14%, transparent), transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 110px 28px 70px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--badge-border);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(34px, 5.6vw, 58px);
  line-height: 1.12;
  margin: 0 0 24px;
  max-width: 820px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 0 36px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 64px;
}

.scan-frame {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.corner {
  fill: none;
  stroke: var(--silver);
  stroke-width: 2;
}

.face-outline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0.55;
}

.scan-line {
  position: absolute;
  left: 12%;
  right: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  top: 15%;
  animation: scan 3.2s ease-in-out infinite;
  opacity: 0.85;
}

@keyframes scan {
  0%, 100% { top: 15%; }
  50% { top: 80%; }
}

/* Capability strip */
.capabilities {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 140px;
}

.cap-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 22px;
}

.cap-card:hover {
  transform: translateY(-4px);
  border-color: var(--pop);
  box-shadow: 0 18px 30px -16px color-mix(in srgb, var(--pop) 45%, transparent);
}

.cap-card:nth-child(1) { --pop: var(--pop-1); }
.cap-card:nth-child(2) { --pop: var(--pop-2); }
.cap-card:nth-child(3) { --pop: var(--pop-3); }
.cap-card:nth-child(4) { --pop: var(--pop-4); }

.cap-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--pop) 15%, transparent);
  color: var(--pop);
  font-family: var(--font-display-ltr);
  font-size: 14px;
  margin-bottom: 16px;
}

html[dir="rtl"] .cap-index { font-family: var(--font-display-rtl); }

.cap-card h3 { font-size: 17px; margin: 0 0 8px; }
.cap-card p { font-size: 14px; color: var(--text-dim); margin: 0; }

/* Section headings */
.section-title {
  font-size: clamp(26px, 3.6vw, 36px);
  margin: 0 0 14px;
}

.section-sub {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 0 48px;
}

.how, .platform, .security { margin-bottom: 140px; }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step {
  border-top: 1px solid var(--border);
  padding-top: 26px;
}

.step:nth-child(1) { --pop: var(--pop-2); }
.step:nth-child(2) { --pop: var(--pop-5); }
.step:nth-child(3) { --pop: var(--pop-1); }

.step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pop) 14%, transparent);
  border: 1.5px solid var(--pop);
  color: var(--pop);
  font-family: var(--font-display-ltr);
  font-size: 15px;
  margin-bottom: 16px;
}

html[dir="rtl"] .step-n { font-family: var(--font-display-rtl); }

.step h3 { font-size: 19px; margin: 0 0 10px; }
.step p { font-size: 14.5px; color: var(--text-dim); margin: 0; }

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

.shot-card {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.shot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px -18px rgba(26, 21, 48, 0.25);
}

.shot-img-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: zoom-in;
}

.shot-card img {
  width: 100%;
  display: block;
}

.shot-card figcaption {
  padding: 16px 18px;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 9, 16, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}

.lightbox[hidden] { display: none; }

.lightbox figure {
  margin: 0;
  max-width: min(1100px, 100%);
  cursor: default;
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
}

.lightbox figcaption {
  margin-top: 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.lightbox-close {
  position: absolute;
  top: 22px;
  inset-inline-end: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }

/* Security */
.security-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
}

.security-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.security-list li {
  position: relative;
  padding-inline-start: 26px;
  font-size: 15px;
  color: var(--text-dim);
}

.security-list li:nth-child(5n+1) { --pop: var(--pop-1); }
.security-list li:nth-child(5n+2) { --pop: var(--pop-2); }
.security-list li:nth-child(5n+3) { --pop: var(--pop-3); }
.security-list li:nth-child(5n+4) { --pop: var(--pop-4); }
.security-list li:nth-child(5n+5) { --pop: var(--pop-5); }

.security-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pop) 18%, transparent);
  border: 1.5px solid var(--pop);
}

.security-visual {
  display: flex;
  justify-content: center;
}

.mini-scan {
  position: relative;
  width: 180px;
  height: 180px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-scan .scan-line { left: 18%; right: 18%; }

/* Quote */
.quote-section {
  position: relative;
  text-align: center;
  margin-bottom: 140px;
}

.quote-section::before {
  content: '';
  position: absolute;
  inset: -40% 20% auto 20%;
  height: 320px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at 50% 50%, color-mix(in srgb, var(--pop-5) 16%, transparent), transparent 70%);
}

.quote-section > * { position: relative; z-index: 1; }

.quote {
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  max-width: 740px;
  margin: 0 auto;
  line-height: 1.4;
}

html[dir="rtl"] .quote { font-style: normal; }

/* Book demo */
.book-demo { margin-bottom: 120px; }

.book-demo-inner {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 56px;
  overflow: hidden;
}

.book-demo-inner::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--pop-1), var(--pop-5), var(--pop-2), var(--pop-3), var(--pop-4));
}

.book-demo-copy { max-width: 560px; margin-bottom: 36px; }
.book-demo-copy .section-sub { margin-bottom: 0; }

.demo-form[hidden] { display: none; }

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

/* Honeypot — off-screen (not display:none/visibility:hidden, which some
   bots already know to skip) so only an automated filler that blindly
   populates every field in the DOM ever touches it. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.demo-form label,
.demo-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.demo-form label.full { width: 100%; }

.demo-form input,
.demo-form select,
.demo-form textarea {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
}

.demo-form input:focus,
.demo-form select:focus,
.demo-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.demo-form textarea { resize: vertical; }

.phone-group {
  display: flex;
  gap: 8px;
}

.phone-number { flex: 1 1 auto; min-width: 0; }

/* Flag dropdowns (Country field, phone calling code) — a real button +
   listbox, not a native <select>, since <option> can't render an <img>. */
.flag-select {
  position: relative;
}

.phone-group .flag-select {
  flex: 0 0 auto;
  width: 128px;
}

.flag-select-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  cursor: pointer;
}

.flag-select-btn:focus-visible,
.flag-select-btn[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.flag-select-flag {
  flex-shrink: 0;
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

.flag-select-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
}

.flag-select-caret {
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flag-select-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.25);
}

.flag-select-list[hidden] { display: none; }

.flag-select-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.flag-select-list li img {
  flex-shrink: 0;
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

.flag-select-list li:hover { background: var(--bg-elev-2); }
.flag-select-list li.is-selected { background: var(--accent-soft); color: var(--accent); }

.demo-form button { margin-top: 8px; align-self: flex-start; }

.form-error {
  color: #dc2626;
  font-size: 13.5px;
  margin: 0;
}

.field-error {
  color: #dc2626;
  font-size: 12.5px;
  margin: -2px 0 0;
}

.demo-form input.is-invalid,
.phone-group:has(.phone-number.is-invalid) .flag-select-btn,
.phone-number.is-invalid {
  border-color: #dc2626 !important;
}

.demo-form input.is-invalid:focus,
.phone-number.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.form-success h3 { font-size: 22px; margin: 0 0 10px; }
.form-success p { color: var(--text-dim); margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
}

.footer-tagline {
  font-size: 13.5px;
  color: var(--text-faint);
  max-width: 34ch;
  margin: 10px 0 0;
}

.footer-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

html[dir="rtl"] .footer-heading { letter-spacing: 0; }

.footer-contact,
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  font-style: normal;
}

.footer-contact span,
.footer-contact a,
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-contact a:hover,
.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

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

/* Responsive */
@media (max-width: 860px) {
  .capabilities { grid-template-columns: repeat(2, 1fr); }
  .steps, .shots { grid-template-columns: 1fr; }
  .security-grid { grid-template-columns: 1fr; gap: 40px; }
  .field-row { grid-template-columns: 1fr; }
  .book-demo-inner { padding: 32px 22px; }
  .main-nav { display: none; }
}

@media (max-width: 520px) {
  .capabilities { grid-template-columns: 1fr; }
  .hero-inner { padding: 90px 20px 50px; }

  .wrap { padding: 0 16px; }

  /* At this width the brand name + theme toggle + lang toggle + CTA
     button don't fit on one line even with the gap already trimmed —
     .brand's flex-shrink:0 (needed at desktop width so it never wraps
     mid-word) was forcing the whole header row past the viewport instead
     of compressing. Letting it shrink and ellipsize is the actual fix. */
  .header-inner { gap: 10px; }
  .header-actions { gap: 10px; }
  .brand {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
  }
}

/* Respect "reduce motion" OS/browser preference — kill scroll reveals,
   the scan-line sweep, and hover-lift transforms, but leave color and
   layout untouched. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .scan-line { animation: none !important; }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .cap-card:hover,
  .shot-card:hover,
  .btn:hover {
    transform: none !important;
  }
}
