/* Design tokens — modern product/SaaS direction.
   Same custom-property names as before so component styles and templates
   don't need to change, only what they resolve to. */

:root {
  --ink: #14151F;
  --ink-soft: #565A6E;
  --ink-faint: #8A8DA3;
  --paper: #FAFAFC;
  --paper-raised: #FFFFFF;
  --paper-sunk: #F1F2F8;
  --rule: rgba(20, 21, 31, .08);
  --rule-strong: rgba(20, 21, 31, .14);
  --cyan: #06B6D4;
  --cyan-soft: rgba(6, 182, 212, .10);
  --cyan-strong: #0E7490;
  --red: #4F46E5;
  --red-soft: rgba(79, 70, 229, .10);
  --panel: #14152A;
  --panel-text: #F4F4FA;
  --panel-soft: #1E2040;
  --focus: #4F46E5;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .14);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --font-display: "Plus Jakarta Sans", "Cairo", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", "Cairo", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EEEFF7;
    --ink-soft: #B7BAD1;
    --ink-faint: #7C7FA0;
    --paper: #0B0C16;
    --paper-raised: #14152A;
    --paper-sunk: #191B33;
    --rule: rgba(238, 239, 247, .08);
    --rule-strong: rgba(238, 239, 247, .16);
    --cyan: #22D3EE;
    --cyan-soft: rgba(34, 211, 238, .12);
    --cyan-strong: #67E8F9;
    --red: #818CF8;
    --red-soft: rgba(129, 140, 248, .14);
    --panel: #0A0B18;
    --panel-text: #F4F4FA;
    --panel-soft: #191B36;
    --focus: #818CF8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --ink: #EEEFF7;
  --ink-soft: #B7BAD1;
  --ink-faint: #7C7FA0;
  --paper: #0B0C16;
  --paper-raised: #14152A;
  --paper-sunk: #191B33;
  --rule: rgba(238, 239, 247, .08);
  --rule-strong: rgba(238, 239, 247, .16);
  --cyan: #22D3EE;
  --cyan-soft: rgba(34, 211, 238, .12);
  --cyan-strong: #67E8F9;
  --red: #818CF8;
  --red-soft: rgba(129, 140, 248, .14);
  --panel: #0A0B18;
  --panel-text: #F4F4FA;
  --panel-soft: #191B36;
  --focus: #818CF8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, .55);
}

html[lang="ar"] {
  --font-display: "Cairo", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Cairo", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  /* Safety net against stray horizontal scroll. `clip`, not `hidden`: hidden
     would turn body into a scroll container and break the sticky header. */
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan-strong); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
::selection { background: var(--red-soft); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cond { font-family: var(--font-body); }
.label {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-faint);
}
h1, h2, h3, h4 { font-weight: 700; text-wrap: balance; margin: 0; font-family: var(--font-display); }
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em; }

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px;
  background: var(--red); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  z-index: 100; transition: top .2s var(--ease); text-decoration: none;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
