/* ==========================================================================
   Wamda pre-launch site
   Palette "spark of light": warm paper / deep ink base, one amber accent.
   Mobile first. Logical properties (inline-start/end) so Arabic RTL mirrors.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #f6f4ef;
  --bg-2: #eeeae1;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #13161d;
  --ink-2: #3a404c;
  --ink-3: #6b7280;
  --muted: #5b6270;
  --line: #e4dfd4;
  --line-strong: #cbc4b5;
  --accent: #f2a516;
  --accent-hover: #ffb52e;
  --accent-ink: #13161d;
  --accent-text: #8a5000;
  --accent-soft: rgba(242, 165, 22, 0.14);
  --accent-glow: rgba(242, 165, 22, 0.5);
  --focus: #a35f00;
  --header-bg: rgba(246, 244, 239, 0.84);
  --input-bg: #ffffff;
  --warn-bg: #fff3d9;
  --warn-line: #efcf86;
  --warn-ink: #8a5000;
  --todo-bg: #efeaff;
  --todo-ink: #4b2fa8;
  --todo-line: #b3a2ee;
  --err: #b42318;
  --plate: #ffffff;
  --wall: #e9e4d9;
  --shadow: 0 1px 2px rgba(19, 22, 29, 0.05), 0 12px 32px -12px rgba(19, 22, 29, 0.14);

  --header-h: 64px;
  --gutter: 16px;
  --radius: 20px;
  --font: "Archivo", "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Cairo", "Archivo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e14; --bg-2: #10141c; --surface: #151a23; --surface-2: #1a202b;
    --ink: #eef0f3; --ink-2: #c5cbd5; --ink-3: #8790a0; --muted: #9ba3b2;
    --line: #242b37; --line-strong: #364050;
    --accent: #ffb531; --accent-hover: #ffc457; --accent-ink: #13161d; --accent-text: #ffc457;
    --accent-soft: rgba(255, 181, 49, 0.12); --accent-glow: rgba(255, 181, 49, 0.4); --focus: #ffc457;
    --header-bg: rgba(11, 14, 20, 0.8); --input-bg: #10141c;
    --warn-bg: #261e0f; --warn-line: #5a4517; --warn-ink: #ffc457;
    --todo-bg: #221c3d; --todo-ink: #cbbcff; --todo-line: #5b47a8;
    --err: #ff8b7e; --plate: #1d2330; --wall: #121721;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e14; --bg-2: #10141c; --surface: #151a23; --surface-2: #1a202b;
  --ink: #eef0f3; --ink-2: #c5cbd5; --ink-3: #8790a0; --muted: #9ba3b2;
  --line: #242b37; --line-strong: #364050;
  --accent: #ffb531; --accent-hover: #ffc457; --accent-ink: #13161d; --accent-text: #ffc457;
  --accent-soft: rgba(255, 181, 49, 0.12); --accent-glow: rgba(255, 181, 49, 0.4); --focus: #ffc457;
  --header-bg: rgba(11, 14, 20, 0.8); --input-bg: #10141c;
  --warn-bg: #261e0f; --warn-line: #5a4517; --warn-ink: #ffc457;
  --todo-bg: #221c3d; --todo-ink: #cbbcff; --todo-line: #5b47a8;
  --err: #ff8b7e; --plate: #1d2330; --wall: #121721;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (min-width: 720px) { :root { --gutter: 28px; --header-h: 72px; } }
@media (min-width: 1200px) { :root { --gutter: 40px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.8; }
.i18n-pending body { opacity: 0; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4, h5 { margin: 0; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
[role="list"] { list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon--lg { width: 32px; height: 32px; }
.icon--accent { color: var(--accent-text); }
html[dir="rtl"] .icon--flip { transform: scaleX(-1); }

/* review markers: every [CONFIRM] / [PLACEHOLDER] on the page, easy to spot and search */
.todo {
  display: inline-block; direction: ltr; unicode-bidi: isolate;
  font: 600 0.74em/1.35 var(--mono); letter-spacing: 0; text-transform: none;
  padding: 0.12em 0.5em; border-radius: 6px; vertical-align: 0.08em;
  background: var(--todo-bg); color: var(--todo-ink); border: 1px dashed var(--todo-line);
}

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 136px); }
.section--alt { background: var(--bg-2); }
.section-head { max-width: 44rem; margin-bottom: clamp(32px, 5vw, 56px); }

/* ---------- type ---------- */
.display {
  font-size: clamp(2.6rem, 1.4rem + 4.6vw, 4.9rem);
  line-height: 0.98; font-weight: 800; font-stretch: 112%; letter-spacing: -0.03em;
}
.h2 {
  font-size: clamp(2rem, 1.3rem + 2.9vw, 3.4rem);
  line-height: 1.04; font-weight: 780; font-stretch: 108%; letter-spacing: -0.022em;
  margin-bottom: 0.5em;
}
.h3 { font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); line-height: 1.15; font-weight: 750; letter-spacing: -0.01em; margin-bottom: 0.45em; }
.h4 { font-size: 1.2rem; line-height: 1.25; font-weight: 700; margin-bottom: 0.4em; }
.h5 { font-size: 1.05rem; line-height: 1.3; font-weight: 700; margin-bottom: 0.25em; }
html[lang="ar"] :is(.display, .h2, .h3, .h4, .h5) { font-stretch: normal; letter-spacing: 0; }
html[lang="ar"] .display { line-height: 1.22; font-size: clamp(2.5rem, 1.4rem + 5vw, 5rem); }
html[lang="ar"] .h2 { line-height: 1.3; }
.lead { font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem); color: var(--ink-2); max-width: 38em; }
.kicker {
  display: flex; align-items: center; gap: 0.6em; margin-bottom: 1rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text);
}
.kicker::before {
  content: ""; width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg);
  background: var(--accent); box-shadow: 0 0 12px var(--accent-glow);
}
html[lang="ar"] .kicker { letter-spacing: 0; text-transform: none; font-size: 0.98rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 48px; padding: 0.75em 1.35em; border-radius: 999px;
  border: 1.5px solid transparent; font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px -10px var(--accent-glow); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--quiet { color: var(--ink); border-color: var(--line-strong); background: transparent; }
.btn--quiet:hover { border-color: var(--ink); }
.btn--sm { min-height: 40px; padding: 0.5em 1.05em; font-size: 0.92rem; }
.btn--lg { min-height: 54px; padding: 0.85em 1.6em; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn .icon { width: 1.1em; height: 1.1em; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 50; height: var(--header-h);
  background: var(--header-bg); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand__mark { width: 28px; height: 28px; }
html[lang="ar"] .brand { letter-spacing: 0; }
.site-nav { display: none; margin-inline-start: auto; gap: 4px; }
.site-nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 0.95rem; padding: 8px 12px; border-radius: 999px; }
.site-nav a:hover { color: var(--ink); background: var(--accent-soft); }
.site-header__tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.lang-toggle {
  min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: transparent; font-weight: 700; font-size: 0.95rem;
}
.lang-toggle:hover { border-color: var(--ink); }
.lang-toggle__to-ar { font-family: var(--font-ar); }
.lang-toggle__to-en { font-family: var(--font); }
html[lang="ar"] .lang-toggle__to-ar, html:not([lang="ar"]) .lang-toggle__to-en { display: none; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: transparent;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon--sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon--sun { display: block; }
  :root:not([data-theme="light"]) .icon--moon { display: none; }
}
:root[data-theme="dark"] .icon--sun { display: block; }
:root[data-theme="dark"] .icon--moon { display: none; }
.site-header__cta { display: none; }
@media (min-width: 560px) { .site-header__cta { display: inline-flex; } }
@media (min-width: 1040px) { .site-nav { display: flex; } .site-nav + .site-header__tools { margin-inline-start: 12px; } }

/* ---------- 1. hero ---------- */
.hero { position: relative; padding-top: calc(var(--header-h) + clamp(28px, 6vw, 64px)); padding-bottom: clamp(56px, 8vw, 96px); overflow: clip; }
.hero::before {
  content: ""; position: absolute; inset-inline-end: -20%; top: -10%; width: 80vw; height: 80vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); pointer-events: none; z-index: -1;
}
.hero__grid { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 1.4rem;
  padding: 6px 14px 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 0.9rem; font-weight: 650; color: var(--ink-2); background: var(--surface);
}
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hero .lead { margin-top: 1.4rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.hero__origin { display: flex; align-items: center; gap: 8px; margin-top: 1.6rem; font-weight: 650; color: var(--ink-2); }
.hero__origin .icon { width: 18px; height: 18px; color: var(--accent); }
.hero__visual { position: relative; width: 100%; max-width: 560px; margin-inline: auto; aspect-ratio: 1 / 1; }
.hero__visual::before {
  content: ""; position: absolute; inset: 12%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); filter: blur(10px);
}
.hero__img, .story__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.6s ease; }
.slot-canvas { position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 0.6s ease; touch-action: pan-y; }
.has-3d > .slot-canvas { opacity: 1; }
.has-3d > .hero__img, .has-3d > .story__img { opacity: 0; }
.hero__status {
  position: absolute; inset-inline: 0; bottom: 0; margin: 0 auto; width: max-content; max-width: 100%;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 0.88rem; font-weight: 600; color: var(--ink-2);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 7px transparent; } }
}
@media (min-width: 900px) {
  .hero { min-height: min(100svh, 980px); display: flex; align-items: center; }
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; }
}

/* ---------- 2. idea ---------- */
.split { display: grid; gap: clamp(28px, 5vw, 72px); align-items: center; margin-bottom: clamp(36px, 6vw, 64px); }
.split__art { margin: 0; max-width: 460px; width: 100%; margin-inline: auto; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr 0.9fr; } }

.cards { display: grid; gap: 16px; }
@media (min-width: 720px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card .icon { margin-bottom: 18px; }
.card p { color: var(--muted); }

/* illustrations (inline SVG, colours from tokens so they follow the theme) */
.illo { width: 100%; height: auto; color: var(--ink-2); overflow: visible; }
.illo-wall { fill: var(--wall); }
.illo-plate { fill: var(--plate); stroke: var(--line-strong); stroke-width: 2; }
.illo-box { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 6; stroke-linecap: round; }
.illo-rocker { fill: var(--surface-2); fill-opacity: 0.9; stroke: var(--ink-3); stroke-width: 2; }
.illo-rocker-line { stroke: var(--ink-3); stroke-width: 1.5; }
.illo-mini { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 7 5; }
.illo-wire { fill: none; stroke: var(--ink-3); stroke-width: 2.5; stroke-dasharray: 5 6; stroke-linecap: round; }
.illo-sparkdot { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.illo-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.illo-fill { fill: var(--ink-3); }
.illo-accent { fill: var(--accent); }
.illo-accent-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.illo-accent-soft { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.illo-wire-solid { fill: none; stroke: var(--ink-2); stroke-width: 3; stroke-linecap: round; }
.illo-wire-accent { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.illo-tool { stroke: var(--ink-3); stroke-width: 3; stroke-linecap: round; }
.illo-tool-handle { stroke: var(--ink-2); stroke-width: 8; stroke-linecap: round; }
.illo-hatch { fill: var(--wall); }
.illo-cavity { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.illo-ring { fill: none; stroke: var(--line-strong); stroke-width: 2.5; }
.illo-dash { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 6; }

/* ---------- 3. install ---------- */
.steps { display: grid; gap: 16px; counter-reset: step; list-style: none; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step {
  position: relative; counter-increment: step;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 24px;
}
.step::before {
  content: counter(step); position: absolute; inset-inline-start: 16px; top: 16px; z-index: 1;
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-weight: 800; font-size: 0.95rem;
}
html[lang="ar"] .step::before { content: counter(step, arabic-indic); }
.step .illo--step { background: var(--bg); border-radius: 14px; padding: 14px; margin-bottom: 18px; aspect-ratio: 4 / 3; }
.step p { color: var(--muted); }
.safety {
  display: flex; gap: 16px; align-items: flex-start; margin-top: 24px; padding: 20px 22px;
  border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--warn-line);
}
.safety .icon { color: var(--warn-ink); }
.safety__title { font-weight: 800; margin-bottom: 0.2em; color: var(--warn-ink); }

/* ---------- 4. exploded-view story ----------
   One grid cell holds both the sticky stage and the scrolling steps (mobile),
   or two columns side by side (desktop). */
.story { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg); }
.story__stage, .story__steps { grid-area: 1 / 1; }
.story__stage { position: sticky; top: 0; height: 100vh; height: 100svh; align-self: start; z-index: 0; }
.story__visual { position: absolute; inset: calc(var(--header-h) + 8px) 0 36% 0; }
.story__steps { position: relative; z-index: 1; }
.story__step {
  min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end;
  padding: 0 var(--gutter) calc(32px + var(--sticky-h, 0px)); pointer-events: none;
}
.story__card {
  pointer-events: auto; width: 100%; max-width: 34rem; padding: 20px 22px;
  background: var(--header-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.story__card p { color: var(--ink-2); }
.story__card .btn { margin-top: 8px; }
.story__index { font: 700 0.8rem/1 var(--mono); color: var(--accent-text); letter-spacing: 0.08em; margin-bottom: 0.9em; direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .story__index { text-align: right; }
/* Inactive steps are dimmed with muted colours, not opacity, so they still pass
   WCAG AA contrast in both themes (opacity 0.25 dropped them to about 1.8:1). */
.story__card :is(.h2, .h3, p) { transition: color 0.45s ease; }
.js .story__step:not(.is-active) .story__card :is(.h2, .h3) { color: var(--ink-3); }
.js .story__step:not(.is-active) .story__card p { color: var(--muted); }
.story__dots {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  display: grid; gap: 10px; list-style: none;
}
.story__dots li { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); transition: background 0.3s, transform 0.3s; }
.story__dots li.is-done { background: var(--accent); }
.story__dots li.is-current { transform: scale(1.5); }

@media (min-width: 900px) {
  .story { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 80px); max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
  .story__stage { grid-area: 1 / 1; }
  .story__steps { grid-area: 1 / 2; }
  .story__visual { inset: calc(var(--header-h) + 16px) 0 24px 0; }
  .story__step { align-items: center; padding: 0; }
  .story__card { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; padding-inline-start: clamp(16px, 3vw, 48px); }
  .story__card p { font-size: 1.15rem; }
  .story__dots { inset-inline-end: auto; inset-inline-start: 0; }
}

/* callouts: positioned by main.js from the 3D anchors (physical px, so left/top on purpose) */
.callouts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.callout {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; direction: ltr;
  opacity: 0; transition: opacity 0.35s ease; will-change: transform, opacity;
}
.callout.is-left { flex-direction: row-reverse; }
.callout__dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent-glow); }
.callout__label {
  max-width: min(14rem, 46vw); padding: 6px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 0.86rem; font-weight: 650; line-height: 1.3; color: var(--ink);
}
html[dir="rtl"] .callout__label { direction: rtl; }
@media (min-width: 900px) {
  .callouts { overflow: visible; }                 /* labels may overhang into the gap beside the text */
  .callout__label { font-size: 0.92rem; }
}

/* ---------- 5. hardware ---------- */
.features { display: grid; gap: 16px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature__icon {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 18px;
  background: var(--accent-soft); color: var(--accent-text);
}
.feature__icon .icon { width: 26px; height: 26px; }
.feature__tech { font: 650 0.74rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.6em; }
html[lang="ar"] .feature__tech { font-family: var(--font-ar); font-size: 0.85rem; letter-spacing: 0; text-transform: none; }
.feature p:not(.feature__tech) { color: var(--muted); }

/* ---------- 6. app ---------- */
.app { display: grid; gap: clamp(40px, 6vw, 80px); align-items: center; }
@media (min-width: 960px) { .app { grid-template-columns: 1.1fr 0.9fr; } }
.app-features { display: grid; gap: 14px; margin-top: 8px; }
@media (min-width: 640px) { .app-features { grid-template-columns: repeat(2, 1fr); } }
.app-features li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.app-features li .icon { width: 24px; height: 24px; margin-top: 2px; }
.app-features p { color: var(--muted); font-size: 0.98rem; }
.app-features__more { align-items: center !important; justify-content: center; border-style: dashed !important; background: transparent !important; }
.app__phone { margin: 0; display: grid; justify-items: center; gap: 16px; }
.app__caption { font-size: 0.9rem; color: var(--muted); text-align: center; max-width: 22rem; }

/* phone mockup: its own dark UI in both themes */
.phone {
  width: min(300px, 82vw); aspect-ratio: 9 / 18.5; padding: 10px; border-radius: 46px;
  background: #0a0c10; box-shadow: 0 0 0 1px #2b313c, 0 40px 80px -30px rgba(10, 12, 16, 0.55);
}
.phone__screen {
  height: 100%; border-radius: 37px; overflow: hidden; padding: 14px 16px 18px;
  background: radial-gradient(120% 60% at 50% 0%, #1b2231, #0f131b 60%); color: #eef0f3;
  display: flex; flex-direction: column; gap: 12px; font-size: 0.86rem;
}
.ph-bar { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.78rem; padding: 2px 8px 6px; direction: ltr; }
.ph-bar__icons { display: flex; gap: 4px; }
.ph-bar__icons i { width: 14px; height: 8px; border-radius: 2px; background: #eef0f3; opacity: 0.85; }
.ph-head { display: flex; flex-direction: column; gap: 6px; }
.ph-title { font-size: 1.35rem; font-weight: 800; margin: 0; }
.ph-chip { display: inline-flex; align-items: center; gap: 6px; width: max-content; margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(95, 213, 155, 0.13); color: #7fe0b0; font-weight: 650; font-size: 0.76rem; }
.ph-chip .icon { width: 14px; height: 14px; }
.ph-tile {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px; border-radius: 22px;
  background: #1a2030; border: 1px solid #262e3f; transition: background 0.35s, border-color 0.35s;
}
.ph-tile.is-on { background: linear-gradient(140deg, rgba(255, 181, 49, 0.28), rgba(255, 181, 49, 0.06)); border-color: rgba(255, 181, 49, 0.45); }
.ph-room { margin: 0; color: #9ba3b2; font-size: 0.76rem; }
.ph-device { margin: 0; font-weight: 750; font-size: 1.02rem; }
.ph-state { margin: 2px 0 0; font-weight: 700; color: #ffc457; }
.ph-tile:not(.is-on) .ph-state { color: #9ba3b2; }
.ph-tile.is-on .ph-state__off, .ph-tile:not(.is-on) .ph-state__on { display: none; }
.ph-switch {
  position: relative; width: 56px; height: 32px; flex: none; border-radius: 999px; border: 0; cursor: pointer;
  background: #3a4252; transition: background 0.25s;
}
.ph-switch::after {
  content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: inset-inline-start 0.25s; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.ph-switch[aria-pressed="true"] { background: #ffb531; }
.ph-switch[aria-pressed="true"]::after { inset-inline-start: 28px; }
.ph-switch:focus-visible { outline-color: #ffc457; }
.ph-section { margin: 4px 0 0; font-weight: 700; color: #9ba3b2; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
html[lang="ar"] .ph-section { text-transform: none; letter-spacing: 0; }
.ph-list { display: grid; gap: 8px; }
.ph-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #161c28; }
.ph-list .icon { width: 18px; height: 18px; color: #ffc457; }
.ph-list b { display: block; font-weight: 700; }
.ph-list span { display: block; color: #9ba3b2; font-size: 0.76rem; }
.ph-note { margin: auto 0 0; display: flex; gap: 8px; align-items: center; color: #9ba3b2; font-size: 0.76rem; }
.ph-note .icon { width: 16px; height: 16px; }

/* ---------- 7. Egypt ---------- */
.egypt { display: grid; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (min-width: 960px) { .egypt { grid-template-columns: 1.1fr 0.9fr; } }
.egypt__text > p:not(.kicker):not(.lead) { color: var(--muted); max-width: 38em; }
.egypt__points { display: grid; gap: 10px; margin-top: 1.6rem; }
.egypt__points li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.egypt__points .icon { margin-top: 3px; }
.egypt__media { display: grid; gap: 16px; }
.placeholder {
  display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; padding: 24px;
  border: 2px dashed var(--todo-line); border-radius: var(--radius); background: var(--todo-bg); color: var(--todo-ink);
}
.placeholder--tall { aspect-ratio: 4 / 3; }
.placeholder--avatar { width: 64px; height: 64px; padding: 0; border-radius: 50%; flex: none; }
.founder { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.founder p { margin: 0; }
.founder__name { font-weight: 750; }
.founder__role { color: var(--muted); font-size: 0.95rem; }
.founder__quote { margin-top: 6px !important; }

/* ---------- 8. roadmap ---------- */
.roadmap-scroll { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 4px var(--gutter) 20px; scrollbar-width: thin; }
.roadmap-scroll:focus-visible { outline-offset: -3px; }
.roadmap {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(228px, 70vw); gap: 14px;
  list-style: none; max-width: 1200px; margin-inline: auto; width: max-content;
}
.road {
  scroll-snap-align: start; position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 22px; border-radius: var(--radius); border: 1.5px dashed var(--line-strong); color: var(--muted);
}
.road .icon { color: var(--ink-3); }
.road h3 { color: var(--ink-2); }
.road p { font-size: 0.95rem; margin: 0; }
.road__badge {
  align-self: flex-start; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.road--now { border: 1.5px solid var(--accent); background: var(--surface); color: var(--ink-2); box-shadow: 0 16px 40px -24px var(--accent-glow); }
.road--now .icon { color: var(--accent-text); }
.road--now h3 { color: var(--ink); }
.road--now .road__badge { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (min-width: 720px) { .roadmap { grid-auto-columns: 250px; } }
@media (min-width: 1200px) {
  .roadmap-scroll { overflow: visible; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
  .roadmap { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); width: auto; max-width: none; }
}

/* ---------- 9. form ---------- */
.signup__grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (min-width: 960px) { .signup__grid { grid-template-columns: 0.85fr 1.15fr; } .signup__intro { position: sticky; top: calc(var(--header-h) + 32px); } }
.signup__points { display: grid; gap: 10px; margin-top: 1.6rem; }
.signup__points li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.signup__points .icon { margin-top: 3px; }
.signup__panel { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow); }
.form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-weight: 700; font-size: 1rem; padding: 0; }
.field > legend { margin-bottom: 10px; float: left; width: 100%; }
html[dir="rtl"] .field > legend { float: right; }
.field > legend + * { clear: both; }
.optional { font-weight: 500; color: var(--muted); }
.field input[type="text"], .field input[type="tel"], .field input[type="email"] {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--input-bg); border: 1.5px solid var(--line-strong); border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
html[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
.field input:hover { border-color: var(--ink-3); }
.field input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--err); }
.field__hint { font-size: 0.9rem; color: var(--muted); margin: 0; }
.field__error { font-size: 0.92rem; font-weight: 650; color: var(--err); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--input-bg); font-weight: 600; font-size: 0.97rem;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover span { border-color: var(--ink-3); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.field.is-invalid .chip span { border-color: var(--err); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.97rem; color: var(--ink-2); cursor: pointer; }
.consent input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.hp { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.btn__busy { display: none; }
.is-busy .btn__label { display: none; }
.is-busy .btn__busy { display: inline; }
.form__note { display: flex; gap: 8px; align-items: flex-start; margin: -6px 0 0; font-size: 0.94rem; color: var(--muted); }
.form__note .icon { margin-top: 3px; color: var(--accent-text); }
.form__error { margin: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--err); color: var(--err); font-weight: 600; }
.form__demo { margin: 0; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--todo-line); background: var(--todo-bg); color: var(--todo-ink); font-size: 0.9rem; }
.form-done { text-align: center; padding: clamp(24px, 6vw, 56px) 8px; display: grid; justify-items: center; gap: 6px; }
.form-done:focus { outline: none; }
.form-done__icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 14px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 10px var(--accent-soft), 0 0 40px var(--accent-glow); }
.form-done__icon .icon { fill: currentColor; stroke: none; }
.form-done p { color: var(--ink-2); max-width: 26rem; }

/* ---------- 10. FAQ ---------- */
.faq { max-width: 860px; }
.faq__list { border-top: 1px solid var(--line-strong); }
.qa { border-bottom: 1px solid var(--line-strong); }
.qa summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 4px; font-weight: 700; font-size: 1.12rem; line-height: 1.35;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; width: 14px; height: 14px; flex: none; transition: transform 0.25s;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa summary:hover { color: var(--accent-text); }
.qa__a { padding: 0 4px 22px; color: var(--ink-2); max-width: 44em; }

/* ---------- 11. footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-top: 56px; padding-bottom: calc(24px + var(--sticky-h, 0px)); }
.site-footer__grid { display: grid; gap: 32px; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 1.2fr 1fr; } }
@media (min-width: 1040px) { .site-footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1.5fr; } }
.site-footer__brand p { color: var(--muted); margin: 12px 0 16px; }
.site-footer__title { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 14px; }
html[lang="ar"] .site-footer__title { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
.site-footer__list { display: grid; gap: 10px; }
.site-footer__list li { display: flex; gap: 8px; align-items: center; }
.site-footer__list a { text-decoration: none; }
.site-footer__list a:hover { text-decoration: underline; }
.site-footer__privacy p { color: var(--muted); font-size: 0.95rem; }
.site-footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-top: 20px;
  background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  color: var(--muted); font-size: 0.9rem;
}
.site-footer__base p { margin: 0; }

/* ---------- sticky CTA (mobile) ---------- */
.sticky-cta { display: none; }
@media (max-width: 719px) {
  :root { --sticky-h: 76px; }
  .js .sticky-cta {
    display: block; position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: var(--header-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); transform: translateY(110%); transition: transform 0.35s ease;
  }
  .js .sticky-cta.is-visible { transform: none; }
}

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 404 page (404.html) ---------- */
.notfound {
  min-height: 100vh; min-height: 100svh; display: grid; place-content: center; justify-items: center;
  gap: 16px; padding: 48px var(--gutter); text-align: center;
}
.notfound .brand { margin-bottom: 16px; }
.notfound__ar { font-family: var(--font-ar); line-height: 1.8; }
.notfound__ar .h2 { font-stretch: normal; letter-spacing: 0; line-height: 1.3; }
.notfound .btn { margin-top: 8px; }
.notfound [lang="ar"] { font-family: var(--font-ar); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .js .reveal { transform: none; }
}
