/* Naskh — Ink & Paper */

:root {
  --paper: #F6F1E8;
  --surface: #FFFDF8;
  --ink: #1B1F3B;
  --ink-2: #5D6180;
  --saffron: #E8A33D;
  --rule: rgba(27, 31, 59, 0.12);
  --glow: rgba(232, 163, 61, 0.26);
  --dots: 0.2;
  --sheen: rgba(255, 255, 255, 0.24);
  --shadow: rgba(27, 31, 59, 0.45);
  --ease: cubic-bezier(0.2, 0.75, 0.2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14172B;
    --surface: #1C2038;
    --ink: #F6F1E8;
    --ink-2: #A9ACC2;
    --rule: rgba(246, 241, 232, 0.14);
    --glow: rgba(232, 163, 61, 0.16);
    --dots: 0.16;
    --sheen: rgba(232, 163, 61, 0.35);
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  -webkit-tap-highlight-color: transparent;
}

html[lang="en"] body { line-height: 1.65; }

::selection { background: rgba(232, 163, 61, 0.35); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: rgba(232, 163, 61, 0.7);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  transition: color 0.25s, text-decoration-color 0.25s;
}
a:hover { color: var(--saffron); text-decoration-color: var(--saffron); }
a:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; border-radius: 4px; }

kbd, .path {
  font-family: inherit;
  font-weight: 500;
}
kbd {
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  white-space: nowrap;
}

/* Quiet links: home links, header nav, footer.
   No resting underline; a saffron line draws in on hover. */

.links a, .top nav a, footer a {
  position: relative;
  padding: 4px 1px;
  color: var(--ink-2);
  text-decoration: none;
}
.links a::after, .top nav a::after, footer a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1.5px;
  border-radius: 1px;
  background: var(--saffron);
  transform: scaleX(0);
  transition: transform 0.45s var(--ease);
}
.links a:hover, .top nav a:hover, footer a:hover { color: var(--ink); }
.links a:hover::after, .top nav a:hover::after, footer a:hover::after,
.links a:focus-visible::after, .top nav a:focus-visible::after, footer a:focus-visible::after { transform: scaleX(1); }

/* Pointer aura: a warm glow and a field of paper dots that follow the pointer. */

.aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
body > :not(.aura) { position: relative; z-index: 1; }
.aura-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 620px;
  height: 620px;
  margin: -310px 0 0 -310px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  opacity: 0;
  transition: opacity 0.8s;
  will-change: transform;
  animation: breathe 7s ease-in-out infinite;
}
.aura-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--ink) 1px, transparent 1.6px);
  background-size: 22px 22px;
  opacity: 0;
  transition: opacity 0.8s;
  -webkit-mask-image: radial-gradient(circle 190px at var(--mx, 50%) var(--my, 30%), #000, transparent);
  mask-image: radial-gradient(circle 190px at var(--mx, 50%) var(--my, 30%), #000, transparent);
}
.aura.on .aura-glow { opacity: 0.7; }
.aura.live .aura-glow { opacity: 1; }
.aura.live .aura-dots { opacity: var(--dots); }

@media (max-width: 600px) {
  .aura-glow { width: 420px; height: 420px; margin: -210px 0 0 -210px; }
}

/* Motion */

@keyframes land {
  from { opacity: 0; transform: translateY(-16px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes drop {
  0% { opacity: 0; transform: translateY(-70px) rotate(-45deg); }
  55% { opacity: 1; transform: translateY(4px) rotate(0); }
  75% { transform: translateY(-2px); }
  100% { opacity: 1; transform: none; }
}
@keyframes leave {
  to { opacity: 0; transform: translateY(-10px); filter: blur(6px); }
}
@keyframes breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.08; }
}
@keyframes sheen {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

.land { animation: land 0.9s var(--ease) both; animation-delay: calc(0.12s + var(--i, 0) * 0.09s); }


html.leaving body > main, html.leaving body > header, html.leaving body > footer {
  animation: leave 0.32s ease-in forwards;
}

/* Home */

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 48px 20px;
  text-align: center;
}
.home .lockup { display: block; color: var(--ink); }
.home .lockup svg { width: min(270px, 66vw); height: auto; display: block; overflow: visible; }
.lockup .wm { animation: land 1s var(--ease) 0.1s both; }
.lockup .arc { animation: land 1s var(--ease) 0.25s both; }
.lockup .dot {
  fill: var(--saffron);
  transform-box: fill-box;
  transform-origin: center;
  animation: drop 1.1s var(--ease) 0.6s both;
}
.home h1 {
  margin: 0;
  max-width: 26ch;
  font-size: clamp(20px, 4.6vw, 26px);
  font-weight: 500;
  line-height: 1.6;
}
.store {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 14px 30px -18px var(--shadow);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.store::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, var(--sheen) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: sheen 1.3s var(--ease) 1.5s;
  transition: transform 0.9s var(--ease);
}
.store:hover { color: var(--paper); transform: translateY(-2px); box-shadow: 0 20px 36px -18px var(--shadow); }
.store:hover::after { transform: translateX(120%); }
.store:active { transform: translateY(0) scale(0.98); }
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}
.links li { display: flex; align-items: center; }
.links li + li::before {
  content: "";
  width: 1px;
  height: 14px;
  margin-inline: 18px;
  background: var(--ink-2);
  opacity: 0.35;
}

/* Inner pages */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 0;
}
.top .lockup { transition: opacity 0.25s; }
.top .lockup:hover { opacity: 0.75; }
.top .lockup img { height: 36px; width: auto; display: block; }
.top nav { display: flex; gap: 20px; font-size: 15px; }

main.doc {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}
.doc > * { animation: land 0.9s var(--ease) 0.6s both; }
.doc > :nth-child(1) { animation-delay: 0.15s; }
.doc > :nth-child(2) { animation-delay: 0.24s; }
.doc > :nth-child(3) { animation-delay: 0.33s; }
.doc > :nth-child(4) { animation-delay: 0.42s; }
.doc > :nth-child(5) { animation-delay: 0.5s; }
.doc > :nth-child(6) { animation-delay: 0.56s; }
.doc h1 {
  margin: 0 0 4px;
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 700;
  line-height: 1.3;
}
.doc .meta { margin: 0 0 28px; color: var(--ink-2); font-size: 15px; }
.doc .lede {
  margin: 0 0 32px;
  padding: 18px 20px;
  border-inline-start: 3px solid var(--saffron);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 40px -30px var(--shadow);
  font-weight: 500;
}
.doc h2 {
  margin: 40px 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
}
.doc p, .doc ul, .doc ol { margin: 0 0 12px; }
.doc ul, .doc ol { padding-inline-start: 1.4em; }
.doc li { margin-bottom: 4px; }
[dir="rtl"] .doc ol { list-style-type: arabic-indic; }
.doc li::marker { color: var(--saffron); }
.doc .note { color: var(--ink-2); font-size: 15px; }

footer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
}
.home + footer { border-top: 0; justify-content: center; }

header.top { animation: land 0.9s var(--ease) 0.05s both; }
footer { animation: land 0.9s var(--ease) 0.7s both; }

/* Below-the-fold blocks wait for site.js to reveal them as they scroll in. */
body .rv { opacity: 0; animation: none; }
body .rv.in { animation: land 0.8s var(--ease) both; }

/* Support: group labels, shortcut list, Free/Pro table */

.doc .group {
  margin: 48px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.doc .group + h2 { margin-top: 12px; }
.doc > .meta + .group { margin-top: 20px; }

.keys { margin: 0 0 12px; }
.keys > div {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.keys > div:last-child { border-bottom: 0; }
.keys dt { margin: 0; }
.keys dd { margin: 0; }
.keys kbd { font-size: 15px; }

.plans {
  margin: 4px 0 12px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
}
.plans table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.plans th, .plans td { padding: 10px 14px; text-align: start; vertical-align: top; }
.plans thead th { color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--rule); }
.plans tbody th { font-weight: 500; }
.plans tbody tr + tr > * { border-top: 1px solid var(--rule); }
.plans td { white-space: nowrap; color: var(--ink-2); }
.plans td:last-child { color: var(--ink); }
.plans:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }

/* Contact form */

.form { display: grid; gap: 18px; margin: 8px 0 20px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 15px; font-weight: 500; }
.field label small { color: var(--ink-2); font-size: 13px; font-weight: 400; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field textarea { min-height: 170px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.22);
}
.field input[type="email"] { direction: ltr; }
[dir="rtl"] .field input[type="email"] { text-align: right; }
.form .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form button {
  min-width: 150px;
  justify-content: center;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.form button[disabled] { opacity: 0.6; cursor: progress; }
.status {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border-inline-start: 3px solid var(--saffron);
}
.status[hidden] { display: none; }
.status.error { border-inline-start-color: #C2453A; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .top .lockup img { height: 30px; }
  .top nav { gap: 16px; font-size: 14px; }
  .links { font-size: 15px; }
  .links li + li::before { margin-inline: 12px; height: 12px; }
  .form button { width: 100%; }
  .plans th, .plans td { padding: 9px 10px; }
  .keys > div { grid-template-columns: 4.8em 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body .rv { opacity: 1; }
  .aura { display: none; }
}
