/* Public landing page. Builds on app.css tokens.
   Every text exists in English and Arabic (data-l); the page language shows one. */

html[lang="ar"] [data-l="en"],
html:not([lang="ar"]) [data-l="ar"] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

:root { --wrap: 1160px; }
body { background: var(--surface); }

h1, h2, h3 { letter-spacing: -0.025em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 10; padding: 8px 16px; background: var(--surface); color: var(--text); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.skip:focus { top: 8px; }

.btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.top-row { display: flex; align-items: center; gap: 8px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo-name { font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }
.nav { display: none; gap: 2px; margin-inline-start: 28px; }
.nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; color: var(--muted); font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 999px; transition: color var(--fast), background-color var(--fast); }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  margin-inline-start: auto;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--fast);
}
.lang-switch:hover { background: var(--surface-2); }
.top-login { padding: 0 16px; }
.top-cta { display: none; }
@media (min-width: 560px) { .top-cta { display: inline-flex; } }
@media (min-width: 900px) { .nav { display: flex; } }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 48px 0 72px; }
@media (min-width: 1000px) { .hero { padding: 88px 0 112px; } }
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 85% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(700px 500px at 10% 0%, color-mix(in srgb, #2563eb 10%, transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 0) 0 0 / 24px 24px;
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.hero-grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 1.25fr 0.75fr; gap: 56px; } .phone-screen { min-height: 560px; } }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px; /* whole pixels, so the dot lands on whole pixels and stays sharp */
  box-shadow: var(--shadow-sm);
}
[dir="rtl"] .pill { padding: 6px 12px 6px 14px; }
/* The ring is a shadow and takes no room, so the margin makes room for it on both sides. */
.pill-dot { flex: none; width: 8px; height: 8px; margin-inline: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }

.hero h1 { margin: 0; font-size: clamp(36px, 5.4vw, 60px); line-height: 1.05; font-weight: 700; text-wrap: balance; }
html[lang="ar"] .hero h1 { font-size: clamp(34px, 5.6vw, 54px); line-height: 1.3; }
.hero h1 em { font-style: normal; color: var(--muted); }
.lead { margin: 22px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 19px); line-height: 1.6; max-width: 33em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.facts { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 14.5px; }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts .icon { color: var(--success); }

/* Hero visual: a phone with the chat, and the cited page beside it */
.hero-visual { position: relative; margin: 0; display: grid; justify-items: center; }
.phone {
  position: relative;
  width: min(340px, 100%);
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(160deg, #1d2536, #0b1220 60%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgb(255 255 255 / 0.08);
}
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; width: 88px; height: 24px; border-radius: 999px; background: #05080f; transform: translateX(-50%); z-index: 2; }
.phone-screen { display: flex; flex-direction: column; min-height: 500px; border-radius: 37px; overflow: hidden; background: var(--bg); }
.p-bar { display: flex; align-items: center; gap: 8px; padding: 52px 16px 12px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.p-mark { width: 22px; height: 22px; }
.p-chat { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 12px; }
.p-msg { margin: 0; padding: 10px 13px; border-radius: 18px; font-size: 13.5px; line-height: 1.5; }
.p-msg p { margin: 0; }
.p-me { align-self: flex-end; max-width: 86%; background: var(--me); color: var(--on-me); border-end-end-radius: 6px; }
.p-usta { max-width: 94%; background: var(--surface); border: 1px solid var(--border); border-end-start-radius: 6px; box-shadow: var(--shadow-sm); }
.p-typing { gap: 5px; margin: 0; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.p-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dots 1.1s infinite ease-in-out; }
.p-typing i:nth-child(2) { animation-delay: 0.15s; }
.p-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.p-cite { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.p-thumb { display: grid; align-content: start; gap: 3px; width: 30px; height: 40px; padding: 5px 4px; flex: none; border-radius: 4px; background: var(--surface); border: 1px solid var(--border-strong); }
.p-thumb i { height: 2px; border-radius: 1px; background: var(--border-strong); }
.p-thumb i.hl { height: 5px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.p-cite-text { display: grid; font-size: 12px; color: var(--muted); line-height: 1.35; }
.p-cite-text strong { color: var(--text); font-size: 13px; }
.p-composer { display: flex; align-items: center; gap: 8px; margin: 0 10px 12px; padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; }
[dir="rtl"] .p-composer { padding: 6px 12px 6px 6px; }
.p-input { flex: 1; }
.p-send { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--on-primary); }

.page-card {
  display: none;
  position: absolute;
  inset-inline-end: -8px;
  bottom: 72px;
  width: 196px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: rotate(3deg);
}
[dir="rtl"] .page-card { transform: rotate(-3deg); }
@media (min-width: 560px) { .page-card { display: block; } }
@media (min-width: 1000px) { .page-card { inset-inline-end: -44px; bottom: 72px; } }
.pc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; font-weight: 600; }
.pc-tag { padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.pc-page { color: var(--muted); }
.pc-sheet { display: grid; gap: 6px; padding: 12px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.pc-sheet i { display: block; height: 4px; border-radius: 2px; background: #e3e6eb; }
.pc-sheet .w50 { width: 50%; } .pc-sheet .w60 { width: 60%; } .pc-sheet .w70 { width: 70%; } .pc-sheet .w80 { width: 80%; } .pc-sheet .w85 { width: 85%; } .pc-sheet .w90 { width: 90%; }
.pc-row { display: flex; gap: 8px; align-items: center; margin: 4px -4px; padding: 6px; border-radius: 6px; background: #fff1e8; outline: 1.5px solid #f97316; font-size: 11.5px; color: #0b1220; }
.pc-row b { font-weight: 700; }
.hero-caption { margin-top: 20px; max-width: 30em; color: var(--muted); font-size: 13.5px; text-align: center; }

/* The chat plays once when it comes into view: question, typing, answer, page. */
.motion .phone:not(.play) .seq { opacity: 0; }
.motion .phone:not(.play) ~ .page-card { opacity: 0; }
.motion .play .seq, .motion .play ~ .page-card { animation: rise 500ms var(--ease-out) both; }
.motion .play .seq-1 { animation-delay: 200ms; }
.motion .play .seq-2 { animation: typing 1300ms ease both; animation-delay: 800ms; }
.motion .play .seq-3 { animation-delay: 2100ms; }
.motion .play .seq-4 { animation-delay: 2500ms; }
.motion .play ~ .page-card { animation-delay: 2900ms; }
/* The typing dots and the answer share one place, so nothing jumps when the answer arrives. */
.p-slot { display: grid; justify-items: start; }
.p-slot > * { grid-area: 1 / 1; }
.p-typing { display: none; }
.motion .p-typing { display: inline-flex; align-self: start; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.motion .play ~ .page-card { animation-name: rise-card; }
@keyframes rise-card { from { opacity: 0; transform: translateY(16px) rotate(0deg); } }
@keyframes typing { 0% { opacity: 0; } 15%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* Sections */
.section { padding: 72px 0; }
@media (min-width: 768px) { .section { padding: 112px 0; } }
.section-tint { background: var(--bg); }
.kicker { margin: 0 0 12px; color: var(--accent-ink); font-size: 14px; font-weight: 600; letter-spacing: 0.02em; }
.section h2 { margin: 0; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.12; font-weight: 700; max-width: 20em; text-wrap: balance; }
html[lang="ar"] .section h2 { line-height: 1.35; }
.section-lead { margin: 16px 0 0; color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 36em; }

.ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.ic .icon { width: 22px; height: 22px; }

.trio { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 36px; }
@media (min-width: 760px) { .trio { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.trio h3, .features h3, .step h3 { margin: 16px 0 6px; font-size: 18px; font-weight: 650; line-height: 1.35; }
.trio p, .features p, .step p { margin: 0; color: var(--muted); }

/* Compare */
.compare { display: grid; gap: 16px; margin-top: 48px; }
@media (min-width: 860px) { .compare { grid-template-columns: 1fr 1fr; gap: 20px; } }
.cmp { padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.cmp-generic { background: transparent; border-style: dashed; }
.cmp-usta { box-shadow: var(--shadow-lg); border-color: transparent; outline: 1px solid var(--border); }
.cmp-label { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 14px; font-weight: 600; color: var(--muted); }
.cmp-usta .cmp-label { color: var(--text); font-size: 16px; font-weight: 700; }
.cmp-label .mark { width: 22px; height: 22px; }
.cmp-q { margin: 0 0 16px; padding: 12px 16px; border-radius: 16px; background: var(--surface-2); font-size: 16px; }
.cmp-machine { display: block; width: fit-content; margin: 0 0 16px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 600; }
.cmp-result { display: flex; gap: 12px; align-items: flex-start; }
.cmp-result p { margin: 0; font-size: 16px; line-height: 1.6; }
.cmp-generic .cmp-result .icon { color: var(--danger); }
.cmp-usta .cmp-result .icon { color: var(--success); }
.cmp .cite-chip { margin: 16px 0 0; margin-inline-start: 36px; }

.features { list-style: none; margin: 56px 0 0; padding: 0; display: grid; gap: 28px; }
@media (min-width: 700px) { .features { grid-template-columns: 1fr 1fr; gap: 32px 40px; } }
@media (min-width: 1080px) { .features { grid-template-columns: repeat(4, 1fr); } }
.features li { display: grid; gap: 0; align-content: start; }

/* Steps */
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; gap: 20px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 0 0 8px; }
.step-art {
  display: grid;
  align-content: center;
  gap: 8px;
  height: 188px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 0) 0 0 / 18px 18px,
    var(--bg);
  overflow: hidden;
}
.doc { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: 13.5px; font-weight: 500; }
.doc .icon { color: var(--muted); }
.doc:nth-child(2) { margin-inline-start: 16px; }
.doc-scan { margin-inline-start: 32px; }
.b { display: inline-flex; align-items: center; gap: 6px; max-width: 92%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; }
.b-me { justify-self: end; background: var(--me); color: var(--on-me); border-end-end-radius: 5px; }
.b-usta { justify-self: start; background: var(--surface); border: 1px solid var(--border); border-end-start-radius: 5px; box-shadow: var(--shadow-sm); }
.cite-chip { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.step-no { display: block; color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.step h3 { margin-top: 6px; }

/* Same answer, any form */
.same { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1000px) { .same { grid-template-columns: 0.9fr 1.1fr; gap: 64px; } }
.flow { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
@media (min-width: 620px) { .flow { grid-template-columns: 1fr 64px auto; gap: 0; } }
.flow-in { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.flow-in li { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 8px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); font-size: 14.5px; }
.flow-lines { display: none; width: 64px; height: 100%; min-height: 170px; }
@media (min-width: 620px) { .flow-lines { display: block; } }
[dir="rtl"] .flow-lines { transform: scaleX(-1); }
.flow-lines path { fill: none; stroke: var(--border-strong); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.flow-out { display: grid; gap: 6px; justify-items: start; padding: 18px 20px; border-radius: 18px; background: var(--primary); color: var(--on-primary); }
.flow-k { font-size: 12.5px; font-weight: 600; opacity: 0.7; }
.flow-out strong { font-size: 22px; letter-spacing: -0.02em; }

/* Request a demo */
.cta-panel {
  display: grid;
  gap: 40px;
  padding: 32px 20px;
  border-radius: 32px;
  background:
    radial-gradient(500px 300px at 0% 0%, rgb(234 88 12 / 0.22), transparent 70%),
    radial-gradient(600px 400px at 100% 100%, rgb(37 99 235 / 0.18), transparent 70%),
    #0b1220;
  color: #f3f5f8;
}
@media (min-width: 768px) { .cta-panel { padding: 56px; } }
@media (min-width: 1000px) { .cta-panel { grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; } }
.cta-panel h2 { color: #fff; }
.cta-panel .section-lead { color: #b9c1cf; }
.facts-dark { color: #d5dbe5; font-size: 15.5px; flex-direction: column; gap: 12px; }
.facts-dark .icon { color: #fb923c; }
.cta-form { padding: 28px 24px; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
@media (min-width: 768px) { .cta-form { padding: 32px; } }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-row .field { margin-bottom: 8px; }
.contact-hint { margin: 0 0 16px; }
.privacy { margin: 14px 0 0; text-align: center; font-size: 13.5px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#d-form-error { margin-bottom: 12px; }
.demo-done { display: grid; justify-items: center; gap: 6px; padding: 40px 12px; text-align: center; outline: none; }
.demo-done p { margin: 0; color: var(--muted); }
.demo-done .done-title { color: var(--text); font-size: 22px; font-weight: 700; }
.done-ic { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }

/* Footer */
.foot { padding: 32px 0 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.foot p { margin: 0; }
.foot .logo { color: var(--text); }
.lang-switch-plain { margin-inline-start: auto; color: var(--muted); }
.foot-c { width: 100%; }
@media (min-width: 760px) { .foot-c { width: auto; } }

/* Sections fade up as they scroll in (only when motion is allowed and JS runs). */
/* The hover lift and shadow (motion.css) are in the list too, so they ease instead of snapping. */
.motion .reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out), translate var(--med) var(--ease-out), box-shadow var(--med) var(--ease-out), border-color var(--med); }
.motion .reveal.in { opacity: 1; transform: none; }
