/* site.css: matheel.app in the zalapier light theme (near-white ground, ink, one orange accent, 1.5px borders,
   small radii), Ping AR+LT type, the Saudi riyal sign from its own font. RTL-first, mobile at 16px gutter. */
@font-face { font-family: "Ping"; src: url("/fonts/imdent-400.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ping"; src: url("/fonts/imdent-500.otf") format("opentype"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Ping"; src: url("/fonts/imdent-700.otf") format("opentype"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Riyal"; src: url("/fonts/riyal-regular.woff2") format("woff2"); font-weight: 400; unicode-range: U+20C1; }
@font-face { font-family: "Riyal"; src: url("/fonts/riyal-bold.woff2") format("woff2"); font-weight: 700; unicode-range: U+20C1; }

:root {
  --bg: #fafafa; --surface: #fff; --ground: #f4f4f5;
  --ink: #18181b; --muted: #63636b; --line: #e4e4e7; --line-strong: #d4d4d8;
  --accent: #f97316; --accent-hover: #ea580c; --accent-soft: #fff4ec;
  --ok: #0d9488; --err: #dc2626;
  --r-box: 8px; --r-field: 6px; --b: 1.5px;
  --pad: clamp(16px, 4vw, 56px); --max: 1180px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Riyal", "Ping", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; letter-spacing: 0; }
h1 { font-size: clamp(34px, 5.2vw, 64px); }
h2 { font-size: clamp(26px, 3.4vw, 40px); max-width: 22ch; }
h3 { font-size: 17px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.lede { color: var(--muted); font-size: clamp(16px, 1.4vw, 18px); max-width: 56ch; margin-top: 14px; }
.hl { color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; direction: ltr; unicode-bidi: plaintext; word-break: break-all; }
.sar { font-family: "Riyal", var(--font); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
section { padding: clamp(64px, 9vw, 112px) var(--pad); max-width: var(--max); margin: 0 auto; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.link { font-weight: 600; text-decoration: none; }
.link:hover { color: var(--accent); }

/* buttons: 44 main, 36 small (ui-craft), one filled accent per view */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-box); border: var(--b) solid transparent; font: 600 15px var(--font); text-decoration: none;
  cursor: pointer; transition: background .22s var(--ease), border-color .22s var(--ease), color .22s var(--ease), transform .12s var(--ease); }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); margin-top: 18px; }
.btn[disabled] { opacity: .7; cursor: progress; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 10px var(--pad);
  background: rgba(250,250,250,.86); backdrop-filter: saturate(1.4) blur(12px); border-bottom: var(--b) solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; text-decoration: none; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); position: relative; }
.mark::after { content: ""; position: absolute; inset: 6px; border-radius: 2px; background: var(--accent); }
.links { display: flex; gap: 22px; margin-inline-start: auto; font-size: 15px; }
.links a { text-decoration: none; color: var(--muted); }
.links a:hover { color: var(--ink); }

/* hero + try card */
.hero { display: grid; grid-template-columns: 1fr minmax(320px, 470px); gap: clamp(28px, 5vw, 64px); align-items: start; padding-top: clamp(48px, 7vw, 88px); }
.try { background: var(--surface); border: var(--b) solid var(--line); border-radius: 12px; padding: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 40px -24px rgba(24,24,27,.18); }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.try-head h2 { font-size: 20px; }
.badge { font-size: 12px; font-weight: 600; color: var(--accent-hover); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field.grow { grid-column: 1 / -1; }
.hero > *, .fields > * { min-width: 0; }
.field input { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; border: var(--b) solid var(--line-strong); border-radius: var(--r-field); font: 500 16px var(--font); color: var(--ink); background: var(--surface); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.totals { margin: 14px 0; font-size: 15px; color: var(--muted); }
.totals b { color: var(--ink); font-size: 18px; }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { margin-top: 10px; color: var(--err); font-size: 14px; }
.result { margin-top: 18px; padding-top: 18px; border-top: var(--b) solid var(--line); animation: rise .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.result-head { display: flex; justify-content: space-between; align-items: center; }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 700; }
.status svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.status.bad { color: var(--err); }
.result-body { display: grid; grid-template-columns: 112px 1fr; gap: 16px; margin-top: 14px; align-items: start; }
.qr { width: 112px; height: 112px; padding: 6px; background: #fff; border: var(--b) solid var(--line); border-radius: var(--r-field); }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; }
dl { display: grid; gap: 4px; font-size: 14px; min-width: 0; }
dt { color: var(--muted); font-size: 12px; font-weight: 600; }
dd { margin-bottom: 8px; }

/* stats: hairline row */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding-block: 0; }
.stats > div { padding: 26px 20px; border-top: var(--b) solid var(--line); border-inline-start: var(--b) solid var(--line); display: grid; gap: 4px; }
.stats > div:first-child { border-inline-start: 0; }
.stats b { font-size: clamp(26px, 3vw, 38px); font-weight: 700; unicode-bidi: plaintext; }
.stats span { color: var(--muted); font-size: 14px; }

/* how */
.steps { list-style: none; padding: 0; margin-top: 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: var(--b) solid var(--line); }
.steps li { display: flex; gap: 14px; padding: 24px 0; padding-inline-end: 28px; }
.steps b { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 15px; }
.steps p, .why-grid p { color: var(--muted); font-size: 15px; margin-top: 6px; }

/* why */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 32px; border-top: var(--b) solid var(--line); }
.why-grid > div { padding: 24px 0; padding-inline-end: 36px; border-bottom: var(--b) solid var(--line); }

/* ai: the one dark break */
.dark { background: var(--ink); color: #fafafa; max-width: none; border-radius: 0; }
.dark > * { max-width: var(--max); margin-inline: auto; }
.dark .eyebrow, .dark .lede { color: #a1a1aa; }
.dark .lede a { color: #fff; }
.prompt { margin-top: 26px; padding: 20px 22px; background: #0b0b0d; border: var(--b) solid #27272a; border-radius: var(--r-box);
  color: #d4d4d8; font: 13px/1.7 var(--mono); white-space: pre-wrap; max-height: 300px; overflow: auto; }
.ai .btn { display: flex; width: fit-content; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 32px; }
.plan { background: var(--surface); border: var(--b) solid var(--line); border-radius: var(--r-box); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.plan-main { border-color: var(--ink); }
.price { color: var(--muted); font-size: 15px; }
.price b { font-size: 34px; color: var(--ink); font-weight: 700; }
.plan ul { padding-inline-start: 18px; color: var(--muted); font-size: 14px; flex: 1; display: grid; gap: 4px; }

/* faq */
.faq details { border-top: var(--b) solid var(--line); padding: 18px 0; max-width: 860px; }
.faq details:last-of-type { border-bottom: var(--b) solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; min-height: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: inline-end; color: var(--accent); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--muted); margin-top: 8px; max-width: 70ch; }

.final { text-align: center; display: grid; justify-items: center; gap: 22px; }
.final h2 { max-width: 20ch; }
.foot { display: flex; gap: 22px; flex-wrap: wrap; padding: 28px var(--pad); color: var(--muted); font-size: 14px; border-top: var(--b) solid var(--line); }
.foot span { margin-inline-end: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
.toast { position: fixed; bottom: 20px; inset-inline: 0; margin: auto; width: fit-content; padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; z-index: 50; animation: rise .3s var(--ease); }

/* reveal once at ~15% visible; off for reduced motion and when JS is off */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .62s var(--ease), transform .62s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero, .steps, .why-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-inline-start: 0; }
  .plans { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .plan { scroll-snap-align: start; }
  .links { display: none; }
  .nav .btn { margin-inline-start: auto; }
  .steps li, .why-grid > div { padding-inline-end: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, .js .reveal { transition: none !important; animation: none !important; opacity: 1 !important; transform: none !important; }
}
