/* ==========================================================================
   MOKY Screens — shared styles
   Tokens, base, navigation, buttons, footer and the legal pages.
   The landing page sections live in landing.css.
   ========================================================================== */

:root {
  --bg: #050B24;
  --sf: #0A1440;
  --s2: #0F1D57;
  --ln: #1E3A8A;
  --sl: #16296b;
  --tx: #F1F5FF;
  --mu: #9DB0E0;
  --pr: #2F6BFF;
  --pg: #4F8DFF;
  --vi: #7C4DFF;
  --cy: #22D3EE;
  --ok: #22C55E;
  --bad: #F43F5E;
  --am: #F59E0B;
  --fd: 'Sora', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --fb: 'Manrope', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --nav-h: 68px;

  /* Shared with the MOKY app (moky-frontend: dashboard.css, app-shell.css), so the site and the
     product move and glow the same way. */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --glow: 0 0 18px rgba(47, 107, 255, .5);
  --lift: 0 12px 30px rgba(0, 0, 0, .38);
  --field: color-mix(in srgb, var(--mu) 70%, var(--sf)); /* a field edge that keeps 3:1, as the app's search box */
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 16px/1.6 var(--fb);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--cy); outline-offset: 2px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--cy);
  color: #041029;
  font-weight: 800;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

svg.ic {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Layout helpers ---------- */
.w { position: relative; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.sec { position: relative; padding: 96px 0; scroll-margin-top: var(--nav-h); }

/* Small label above a heading: the app's HUD label (cyan, 11px, tracked caps). */
.eb {
  display: flex; align-items: center; gap: 8px;
  font: 800 11px/1.2 var(--fb);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cy);
}
[dir="rtl"] .eb { letter-spacing: 0; font-size: 12px; }

.h2 {
  margin: 16px 0 14px;
  font: 700 clamp(30px, 4.2vw, 48px)/1.1 var(--fd);
  letter-spacing: -.02em;
  text-wrap: balance;
}
[dir="rtl"] .h2 { letter-spacing: 0; line-height: 1.3; }

.lead { margin: 0; max-width: 64ch; color: var(--mu); font-size: 18px; text-wrap: pretty; }
.mu { color: var(--mu); }

/* ---------- Buttons ---------- */
/* Buttons match the app: outline buttons warm to the raised surface, the primary one is solid
   electric blue with the glow, and every button gives a little under the pointer. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 10px;
  border: 1px solid var(--ln);
  background: transparent;
  font-weight: 700; font-size: 15px;
  white-space: nowrap;
  transition: border-color .15s, background-color .15s, filter .15s, transform .15s var(--ease), box-shadow .2s;
}
.btn:hover { border-color: var(--pg); background: var(--s2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.pri {
  border-color: var(--pg);
  background: var(--pr);
  color: #fff;
  box-shadow: var(--glow);
}
.btn.pri:hover { background: var(--pr); filter: brightness(1.1); }
.btn .ic { transition: transform .3s var(--ease); }
.btn:hover .ic.go { transform: translateX(3px); }
[dir="rtl"] .btn .ic.go { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .ic.go { transform: scaleX(-1) translateX(3px); }
.btn:hover .ic.turn { transform: rotate(90deg); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

.ib {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--ln);
  background: var(--sf);
}
.ib:hover { border-color: var(--pg); }

/* ---------- Status badge ---------- */
.bdg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  border-radius: 99px;
  border: 1px solid;
  background: rgba(5, 11, 36, .78);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.bdg::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Online pulses like the app's screen cards. */
.bdg.ok::before { animation: live-dot 2.4s ease-out infinite; }
@keyframes live-dot { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 5px transparent; } }
.bdg.ok { color: var(--ok); }
.bdg.bad { color: var(--bad); }
.bdg.warn { color: var(--am); }
[dir="rtl"] .bdg { letter-spacing: 0; }

/* ---------- HUD panel ---------- */
/* Corner ticks as on the app's panes: they frame a panel without adding a second border. */
.hud {
  position: relative;
  border: 1px solid var(--sl);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 29, 87, .62), rgba(10, 20, 64, .82));
  backdrop-filter: blur(6px);
}
.hud::before, .hud::after {
  content: ""; position: absolute;
  width: 12px; height: 12px;
  border: 0 solid var(--pg);
  opacity: .6;
  pointer-events: none;
}
.hud::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: 16px; }
.hud::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: 16px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px); /* clears the status bar where the page runs under it */
  background: rgba(5, 11, 36, .74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 58, 138, .55);
}
.nv {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  min-height: var(--nav-h);
  padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font: 700 17px var(--fd);
  letter-spacing: .3em;
}
.brand em {
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--ln);
  font: 600 10px var(--fb); font-style: normal;
  letter-spacing: .34em;
  color: var(--mu);
}
.bm { width: 30px; height: 30px; filter: drop-shadow(0 0 8px rgba(47, 107, 255, .7)); }
.nl { display: flex; gap: 4px; margin-inline-start: auto; }
.nl a {
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--mu);
  font-weight: 600; font-size: 14px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nl a:hover { color: var(--tx); background: rgba(47, 107, 255, .14); }
.nl a[aria-current="true"] { color: var(--tx); background: rgba(47, 107, 255, .2); }
.nv .lang { min-width: 64px; }

/* ---------- Footer ---------- */
.ft { padding: 56px 0 36px; border-top: 1px solid var(--sl); background: #030818; }
.ftg { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.ftg h5 {
  margin: 0 0 12px;
  font: 800 11px/1 var(--fb);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--cy);
}
[dir="rtl"] .ftg h5 { letter-spacing: 0; font-size: 13px; }
.ftg ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ftg a { color: var(--mu); font-size: 14px; }
.ftg a:hover { color: var(--tx); }
.ftg .brand { margin-bottom: 14px; }
.ftg p { max-width: 36ch; margin: 0; }
.ftg .ft-soc { margin-top: 16px; }
.ft-soc a { display: inline-flex; align-items: center; gap: 8px; }
.ft-soc .ic { width: 18px; height: 18px; }
.ftb {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--sl);
  color: var(--mu); font-size: 13px;
}
.ftb a { color: var(--pg); }

/* ---------- Legal pages ---------- */
.legal-page { min-height: calc(100vh - 300px); padding-bottom: 80px; }
.legal-header {
  padding: 72px 0 48px;
  text-align: center;
  background: radial-gradient(700px 320px at 50% 100%, rgba(47, 107, 255, .22), transparent 70%);
}
.legal-header h1 {
  margin: 0 0 12px;
  font: 700 clamp(32px, 5vw, 52px)/1.1 var(--fd);
  letter-spacing: -.02em;
}
.legal-header .last-updated { margin: 0; color: var(--mu); font-size: 14px; }
.legal-content { max-width: 820px; }
.legal-card {
  padding: 36px;
  border: 1px solid var(--sl);
  border-radius: 18px;
  background: rgba(10, 20, 64, .72);
}
.legal-card h3 { margin: 32px 0 8px; font: 600 20px/1.3 var(--fd); }
.legal-card h3:first-child { margin-top: 0; }
.legal-card p { margin: 0; color: var(--mu); }

/* ---------- Responsive ---------- */
@media (min-width: 761px) and (max-width: 1180px) {
  .nl a { padding-inline: 9px; }
  .nv { gap: 12px; }
}
@media (max-width: 900px) {
  .ftg { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --nav-h: 112px; }
  .nl { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .nl::-webkit-scrollbar { display: none; }
  .nv { gap: 12px; }
  .nv .lang { margin-inline-start: auto; }
  .brand em { display: none; }
  .sec { padding: 72px 0; }
  .legal-card { padding: 24px 20px; }
}
@media (max-width: 520px) {
  .ftg { grid-template-columns: minmax(0, 1fr); }
  .nv .nav-cta { display: none; }
}

/* ---------- RTL ---------- */
[dir="rtl"] .brand { letter-spacing: .12em; }
[dir="rtl"] .brand em { letter-spacing: .12em; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
