/* Ragea public site. Colours: ONLY packages/tokens (--ragea-color-*, copied to ./tokens.css at build time).
   Shape, depth, texture and motion follow the soft-spatial-ui skill (colour-agnostic). */

@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-medium.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-bold.woff2") format("woff2"); }

:root {
  --radius-card: 18px;
  --radius-inner: 12px;
  --radius-pill: 9999px;
  --shadow-card: 0 10px 40px rgb(0 0 0 / .05);
  --shadow-raised: 0 20px 60px rgb(0 0 0 / .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --wrap: 1120px;
  --text: var(--ragea-color-text-primary);
  --muted: var(--ragea-color-text-secondary);
  --canvas-c: var(--ragea-color-background-canvas);
  --surface: var(--ragea-color-surface-default);
  --subtle: var(--ragea-color-surface-subtle);
  --link: var(--ragea-color-state-info-foreground);
  --hairline: color-mix(in srgb, var(--text) 10%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-block-start: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); background: var(--canvas-c);
  font-family: var(--ragea-font-family-arabic); font-size: 1rem; line-height: 1.75; font-weight: 400;
  min-height: 100vh; display: flex; flex-direction: column;
}
html[lang="en"] body { line-height: 1.65; }
/* Language toggle: both languages are in the HTML (crawlers and reviewers can read both); one is shown. */
html[lang="ar"] [data-l="en"], html[lang="en"] [data-l="ar"] { display: none !important; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ragea-color-focus-ring); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: 12px; inset-block-start: -80px; background: var(--ragea-color-brand-primary); color: var(--ragea-color-text-inverse); padding: 8px 16px; border-radius: var(--radius-pill); z-index: 100; }
.skip:focus { inset-block-start: 12px; }

/* Canvas: faint dot grid behind the cards (skill: canvas-texture). */
.canvas {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 1.5px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 70%); mask-image: linear-gradient(to bottom, #000 0, transparent 70%);
}

/* Header */
.bar { position: sticky; inset-block-start: 0; z-index: 20; padding: 12px 16px; }
.bar-inner {
  max-width: var(--wrap); margin-inline: auto; display: flex; align-items: center; gap: 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card); padding: 8px 12px 8px 16px; padding-inline: 16px 10px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 10px; }
.brand-name { font-weight: 700; font-size: 1.125rem; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { color: var(--text); text-decoration: none; padding: 6px 14px; border-radius: var(--radius-pill); font-size: .9375rem; transition: background-color .15s var(--ease); }
.nav a:hover { background: var(--subtle); }
.lang { display: inline-flex; background: var(--subtle); border-radius: var(--radius-pill); padding: 3px; }
.lang button {
  font: inherit; font-size: .875rem; font-weight: 500; line-height: 1; color: var(--muted); background: transparent; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius-pill); transition: background-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
}
.lang button:active { transform: scale(.97); }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 10px rgb(0 0 0 / .08); }

main { flex: 1; width: 100%; max-width: var(--wrap); margin-inline: auto; padding: 8px 16px 64px; }

/* Draft banner on legal pages */
.draft { background: var(--ragea-color-state-warning-background); color: var(--ragea-color-state-warning-foreground); border-radius: var(--radius-inner); padding: 12px 18px; margin-block: 8px 24px; font-size: .9375rem; }
mark.ph { background: var(--ragea-color-state-warning-background); color: var(--ragea-color-state-warning-foreground); border-radius: 6px; padding: 0 6px; font-size: .9em; font-weight: 500; unicode-bidi: isolate; }

/* Buttons and chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 26px;
  border-radius: var(--radius-pill); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; border: 0;
  background: var(--ragea-color-brand-primary); color: var(--ragea-color-text-inverse);
  transition: background-color .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { background: var(--ragea-color-brand-hover); text-decoration: none; box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn.ghost:hover { background: var(--subtle); box-shadow: inset 0 0 0 1px var(--ragea-color-border-strong); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: var(--radius-pill); font-size: .8125rem; font-weight: 500; line-height: 1.6; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.info { background: var(--ragea-color-state-info-background); color: var(--ragea-color-state-info-foreground); }
.chip.success { background: var(--ragea-color-state-success-background); color: var(--ragea-color-state-success-foreground); }
.chip.warn { background: var(--ragea-color-state-warning-background); color: var(--ragea-color-state-warning-foreground); }
.chip.transit { background: var(--ragea-color-state-transit-background); color: var(--ragea-color-state-transit-foreground); }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 24px; }
.card.subtle { background: var(--subtle); box-shadow: none; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.125rem); }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.0625rem, 2vw, 1.25rem); color: var(--muted); max-width: 40ch; }
.eyebrow { font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--link); font-weight: 700; margin-block-end: .75rem; }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .9375rem; }
section { margin-block: 72px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; margin-block: 32px 72px; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 28px; }
.store { display: inline-flex; align-items: center; gap: 12px; padding: 10px 20px; min-height: 56px; border-radius: var(--radius-card); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-card), inset 0 0 0 1px var(--hairline); transition: transform .12s var(--ease), box-shadow .15s var(--ease); }
a.store:hover { box-shadow: var(--shadow-raised), inset 0 0 0 1px var(--ragea-color-border-strong); }
.store:active { transform: scale(.97); }
.store small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.2; }
.store strong { display: block; font-size: 1.0625rem; line-height: 1.3; }
.store svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stage { display: grid; gap: 16px; position: relative; padding: 8px; }
.trip { display: grid; gap: 14px; }
.route { display: flex; align-items: center; justify-content: space-between; gap: 12px; direction: ltr; }
.route b { font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.route small { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; margin-block-start: 4px; }
.route .line { flex: 1; height: 2px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--ragea-color-border-strong) 0 6px, transparent 6px 12px); position: relative; }
.route .line::after { content: ""; position: absolute; inset-inline-end: -2px; inset-block-start: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ragea-color-brand-primary); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row { display: flex; align-items: center; gap: 12px; background: var(--subtle); border-radius: var(--radius-inner); padding: 12px 14px; }
.row .dot { width: 36px; height: 36px; border-radius: 50%; background: var(--ragea-color-brand-subtle); color: var(--ragea-color-state-info-foreground); display: grid; place-items: center; flex: none; }
.row svg, .icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row p { margin: 0; font-size: .875rem; line-height: 1.5; }
.row p span { color: var(--muted); display: block; font-size: .75rem; }

/* How it works */
.seg { display: inline-flex; background: var(--subtle); border-radius: var(--radius-pill); padding: 4px; margin-block: 8px 28px; }
.seg button { font: inherit; font-weight: 500; border: 0; background: transparent; color: var(--muted); padding: 10px 26px; border-radius: var(--radius-pill); cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease); }
.seg button:active { transform: scale(.97); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 12px rgb(0 0 0 / .08); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; }
.steps .card { height: 100%; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.steps .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-raised); }
.steps .num { width: 36px; height: 36px; border-radius: 50%; background: var(--ragea-color-brand-subtle); color: var(--ragea-color-state-info-foreground); display: grid; place-items: center; font-weight: 700; margin-block-end: 14px; font-variant-numeric: tabular-nums; }
.steps .num::before { content: counter(s); }
.steps p { color: var(--muted); font-size: .9375rem; line-height: 1.6; margin: 0; }
[data-role-panel]:not([hidden]) { animation: rise .35s var(--ease) both; }

/* Features / safety */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.icon { width: 44px; height: 44px; border-radius: var(--radius-inner); background: var(--ragea-color-brand-subtle); color: var(--ragea-color-state-info-foreground); display: grid; place-items: center; margin-block-end: 16px; }
.grid-3 p { color: var(--muted); margin: 0; font-size: .9375rem; line-height: 1.65; }
.callout { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; background: var(--ragea-color-state-info-background); color: var(--text); border-radius: var(--radius-card); padding: 20px 24px; margin-block-start: 16px; }
.callout .icon { margin: 0; background: var(--surface); }
.callout p { margin: 0; color: var(--text); }
.markets { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 8px; }
.contact { text-align: center; padding: 48px 24px; }
.contact p { color: var(--muted); max-width: 52ch; margin-inline: auto; }
.contact .btn { margin-block-start: 8px; direction: ltr; }

/* Legal / document pages */
.doc-head { margin-block: 24px 24px; max-width: 760px; margin-inline: auto; }
.doc-head .meta { color: var(--muted); font-size: .9375rem; }
.doc { max-width: 760px; margin-inline: auto; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: clamp(20px, 4vw, 44px); }
.doc h2 { font-size: 1.375rem; margin-block: 2em .5em; padding-block-start: .25em; }
.doc h2:first-of-type { margin-block-start: 1em; }
.doc h3 { margin-block: 1.4em .4em; }
.doc ul, .doc ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
.doc li { margin-block-end: .4em; }
.doc li::marker { color: var(--muted); }
.toc { background: var(--subtle); border-radius: var(--radius-inner); padding: 16px 22px; margin-block-end: 8px; }
.toc strong { display: block; margin-block-end: 6px; font-size: .9375rem; }
.toc [lang="ar"] ol, [lang="ar"] .toc ol { list-style-type: arabic-indic; }
.toc ol { columns: 2; column-gap: 32px; margin: 0; font-size: .9375rem; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--link); text-decoration: underline; }
.table-wrap { overflow-x: auto; margin-block: 1em; border-radius: var(--radius-inner); box-shadow: inset 0 0 0 1px var(--hairline); }
.doc table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 560px; }
.doc th, .doc td { text-align: start; vertical-align: top; padding: 10px 14px; line-height: 1.55; }
.doc th { background: var(--subtle); font-weight: 600; font-size: .875rem; }
.doc tr + tr td { border-block-start: 1px solid var(--hairline); }
.note { background: var(--ragea-color-state-info-background); border-radius: var(--radius-inner); padding: 12px 18px; margin-block: 1em; }
.note.warn { background: var(--ragea-color-state-warning-background); color: var(--ragea-color-state-warning-foreground); }
.note p:last-child { margin: 0; }
.doc code { font-family: ui-monospace, monospace; background: var(--subtle); padding: 1px 6px; border-radius: 6px; font-size: .9em; direction: ltr; unicode-bidi: isolate; }

/* Small utilities (no inline styles: the CSP forbids them) */
.end { text-align: end; }
.mt16 { margin-block-start: 16px; }
.mt20 { margin-block-start: 20px; }
.small { font-size: .9375rem; }
[lang="ar"] .doc ol { list-style-type: arabic-indic; }
.table-wrap.stack table { min-width: 0; }
.table-wrap.stack td ul { margin: 0; }
@media (max-width: 640px) {
  .table-wrap.stack thead { display: none; }
  .table-wrap.stack tr, .table-wrap.stack td { display: block; }
  .table-wrap.stack tr + tr td, .table-wrap.stack td + td { border-block-start: 1px solid var(--hairline); }
}

/* Footer */
.foot { padding: 40px 16px 32px; }
.foot-inner { max-width: var(--wrap); margin-inline: auto; display: grid; gap: 20px; }
.foot-brand { display: flex; gap: 12px; align-items: center; }
.foot-brand img { border-radius: 10px; }
.foot-brand p { margin: 0; color: var(--muted); font-size: .9375rem; max-width: 52ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--text); font-size: .9375rem; }
.copy { margin: 0; color: var(--muted); font-size: .8125rem; }

/* Motion (skill): staggered entrance rise 8px / .98 -> 1; reveal on scroll; MPA route change = fade through the canvas. */
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.bar { animation: rise .4s var(--ease) both; }
.hero > div:first-child > *, .doc-head > *, .stage > * { animation: rise .55s var(--ease) both; }
.hero > div:first-child > :nth-child(2) { animation-delay: .06s; }
.hero > div:first-child > :nth-child(3) { animation-delay: .12s; }
.hero > div:first-child > :nth-child(4) { animation-delay: .18s; }
.stage > :nth-child(1) { animation-delay: .15s; }
.stage > :nth-child(2) { animation-delay: .22s; }
.stage > :nth-child(3) { animation-delay: .29s; }
.js .reveal { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .grid-3 .reveal:nth-child(2), .js .steps .reveal:nth-child(2) { transition-delay: .05s; }
.js .grid-3 .reveal:nth-child(3), .js .steps .reveal:nth-child(3) { transition-delay: .1s; }
.js .steps .reveal:nth-child(4) { transition-delay: .15s; }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out .25s var(--ease) both; }
::view-transition-new(root) { animation: fade-in .35s var(--ease) .1s both; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .15s !important; animation-delay: 0s !important; transition-duration: .15s !important; transition-delay: 0s !important; }
  .bar, .hero > div:first-child > *, .doc-head > *, .stage > *, [data-role-panel] { animation-name: fade-in !important; }
  .js .reveal { transform: none; }
  .steps .card:hover { transform: none; }
  @view-transition { navigation: none; }
}

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; gap: 28px; margin-block: 16px 56px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .lang { margin-inline-start: auto; }
  .toc ol { columns: 1; }
  section { margin-block: 56px; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .bar { padding: 8px 10px; }
  .store { flex: 1 1 100%; }
  .seg { display: flex; } .seg button { flex: 1; padding-inline: 12px; }
  .card { padding: 20px; }
  .callout { grid-template-columns: 1fr; }
  .contact { padding: 36px 16px; }
}
