/* ==========================================================================
   Gryb landing, redesign draft
   Tokens mirror GrybTheme.swift (dark appearance). System fonts only.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Color */
  --c-bg: #000000;
  --c-surface: #141414;
  --c-surface-2: #1c1c1c;
  --c-border: #2a2a2a;
  --c-glass: rgb(20 20 24 / 0.55);
  --c-glass-strong: rgb(16 16 20 / 0.86);
  --c-glass-edge: rgb(255 255 255 / 0.09);
  --c-glass-hi: rgb(255 255 255 / 0.14);
  --c-t1: #ffffff;
  --c-t2: #a1a1aa;
  --c-t3: #7c7c80;
  --c-accent: #8950d7;
  --c-accent-2: #672abb;
  --c-accent-text: #b892ff;
  --c-accent-dim: rgb(137 80 215 / 0.15);
  --c-accent-glow: rgb(137 80 215 / 0.35);
  --c-green: #30d158;
  --c-red: #ff453a;
  --c-gold: #ffd60a;
  --c-amber: #f5a623;
  --c-orange: #ff9f0a;
  --g-accent: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  --g-text: linear-gradient(100deg, #d9c4ff 0%, var(--c-accent-text) 45%, #8a5cff 100%);

  /* Type */
  --f-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic", "Geeza Pro", "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  --f-rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-h2: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --fs-h1: clamp(2.75rem, 1.6rem + 5.2vw, 5.5rem);
  --lh-tight: 1.08;
  --lh-snug: 1.3;
  --lh-body: 1.6;

  /* Space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1120px;

  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadow */
  --sh-glass: inset 0 1px 0 var(--c-glass-hi), 0 8px 32px rgb(0 0 0 / 0.45);
  --sh-card: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 20px 60px rgb(0 0 0 / 0.5);
  --sh-glow: 0 0 0 1px rgb(137 80 215 / 0.4), 0 12px 40px var(--c-accent-glow);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: linear(0, 0.083, 0.271, 0.49, 0.693, 0.856, 0.971, 1.042, 1.076, 1.083, 1.075, 1.059, 1.041, 1.024, 1.011, 1.002, 0.996, 0.994, 0.993, 0.994, 0.995, 0.997, 0.998, 0.999, 1, 1, 1.001, 1.001, 1.001, 1, 1);
  --d-fast: 180ms;
  --d-med: 360ms;
  --d-spring: 620ms;

  --nav-h: 60px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + var(--s-6)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--c-bg);
  color: var(--c-t1);
  font-family: var(--f-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
em { font-style: normal; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--c-accent-text); outline-offset: 3px; border-radius: var(--r-sm); }

/* Language visibility: both languages ship in the markup, CSS shows one */
html[lang="ar"] [data-lang="en"],
html[lang="en"] [data-lang="ar"] { display: none !important; }

.skip {
  position: absolute; inset-inline-start: var(--s-4); top: -100px; z-index: 100;
  background: var(--c-t1); color: var(--c-bg); padding: var(--s-2) var(--s-4); border-radius: var(--r-pill);
}
.skip:focus { top: var(--s-4); }

.glass {
  background: var(--c-glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid var(--c-glass-edge);
  box-shadow: var(--sh-glass);
}

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; }
.brand-icon { width: 32px; height: 32px; border-radius: 9px; }
.brand-word { font-family: var(--f-rounded); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; direction: ltr; }
.brand-ar { color: var(--c-t2); font-weight: 600; font-size: var(--fs-sm); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-6);
  border-radius: var(--r-pill); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
  transition: transform var(--d-spring) var(--ease-spring), background-color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.btn:active { transform: scale(0.96); transition-duration: var(--d-fast); }
.btn-small { min-height: 36px; padding: 0 var(--s-4); background: var(--c-t1); color: var(--c-bg); font-size: var(--fs-xs); }
.btn-ghost { border: 1px solid var(--c-glass-edge); background: rgb(255 255 255 / 0.04); }
.btn-ghost:hover { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.18); }

.store-btn {
  display: inline-flex; align-items: center; gap: var(--s-3);
  min-height: 56px; padding: 0 var(--s-6) 0 var(--s-5);
  background: var(--c-t1); color: var(--c-bg);
  border-radius: var(--r-pill); text-decoration: none; direction: ltr;
  box-shadow: 0 10px 40px rgb(137 80 215 / 0.35);
  transition: transform var(--d-spring) var(--ease-spring), box-shadow var(--d-med) var(--ease-out);
}
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 50px rgb(137 80 215 / 0.55); }
.store-btn:active { transform: scale(0.96); transition-duration: var(--d-fast); }
.store-btn svg { width: 26px; height: 26px; fill: currentColor; }
.store-text { display: flex; flex-direction: column; line-height: 1.1; text-align: start; }
.store-small { font-size: 0.6875rem; opacity: 0.75; }
.store-big { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  padding: calc(env(safe-area-inset-top) + var(--s-3)) var(--gutter) 0;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  max-width: var(--maxw); margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-inline: var(--s-3) var(--s-2);
  border-radius: var(--r-pill);
}
.nav-actions { display: flex; align-items: center; gap: var(--s-2); }

/* Nav glass firms up once content scrolls under it */
@supports (animation-timeline: scroll()) {
  .nav-inner { animation: nav-firm both var(--ease-out); animation-timeline: scroll(root); animation-range: 0 160px; }
  @keyframes nav-firm {
    from { background: rgb(20 20 24 / 0.25); border-color: rgb(255 255 255 / 0.04); }
    to { background: var(--c-glass-strong); border-color: var(--c-glass-edge); }
  }
}

/* Segmented language control with a spring thumb */
.seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  direction: ltr; padding: 3px; border-radius: var(--r-pill);
  background: rgb(255 255 255 / 0.06); border: 1px solid var(--c-glass-edge);
}
.seg-btn { position: relative; z-index: 1; width: 40px; height: 30px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; color: var(--c-t2); transition: color var(--d-fast) var(--ease-out); }
.seg-btn[aria-pressed="true"] { color: var(--c-t1); }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 40px;
  border-radius: var(--r-pill); background: var(--g-accent); box-shadow: 0 2px 10px var(--c-accent-glow);
  transition: transform var(--d-spring) var(--ease-spring);
}
html[lang="en"] .seg-thumb { transform: translateX(40px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: max(640px, min(100svh, 940px));
  display: grid; align-items: end;
  padding: calc(var(--nav-h) + var(--s-12)) var(--gutter) var(--s-12);
  overflow: hidden;
}
.voice-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(46% 34% at 50% 52%, rgb(0 0 0 / 0.55), transparent 100%),
    linear-gradient(to bottom, rgb(0 0 0 / 0.55), transparent 18%, transparent 78%, var(--c-bg));
}
.hero-content { max-width: var(--maxw); margin: 0 auto; width: 100%; display: grid; justify-items: center; text-align: center; gap: var(--s-5); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-1) var(--s-4) var(--s-1) var(--s-3); min-height: 32px;
  border-radius: var(--r-pill); font-size: var(--fs-xs); color: var(--c-t2); font-weight: 500;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 0 0 rgb(48 209 88 / 0.6); }

.hero-title {
  font-size: var(--fs-h1); line-height: var(--lh-tight); font-weight: 800; letter-spacing: -0.035em;
  max-width: 14ch; text-wrap: balance;
}
html[lang="ar"] .hero-title { letter-spacing: 0; line-height: 1.2; max-width: 12ch; }
.hero-title em, .h2 em {
  background: var(--g-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title, .hero-sub { text-shadow: 0 2px 24px rgb(0 0 0 / 0.7); }
.hero-sub { font-size: var(--fs-lg); color: var(--c-t2); max-width: 34ch; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-2); }

.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-5); margin-top: var(--s-6); color: var(--c-t2); font-size: var(--fs-xs); }
.facts li { display: inline-flex; align-items: center; gap: var(--s-2); }
.facts svg { width: 16px; height: 16px; fill: var(--c-accent-text); }

/* Hero entrance: staged so the eye lands on the headline, then the action */
@media (prefers-reduced-motion: no-preference) {
  .hero-content > * { animation: rise 900ms var(--ease-out) both; }
  .hero-content > :nth-child(2) { animation-delay: 80ms; }
  .hero-content > :nth-child(3) { animation-delay: 160ms; }
  .hero-content > :nth-child(4) { animation-delay: 240ms; }
  .hero-content > :nth-child(5) { animation-delay: 320ms; }
  .live-dot { animation: live 2.4s var(--ease-out) infinite; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgb(48 209 88 / 0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgb(48 209 88 / 0); } }

/* ---------- Section scaffolding ---------- */
section { padding-inline: var(--gutter); }
.section-head { max-width: var(--maxw); margin: 0 auto var(--s-10); text-align: center; display: grid; gap: var(--s-2); justify-items: center; }
.label { color: var(--c-accent-text); font-size: var(--fs-xs); font-weight: 700; }
html[lang="en"] .label { text-transform: uppercase; letter-spacing: 0.14em; }
.h2 { font-size: var(--fs-h2); line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
html[lang="ar"] .h2 { letter-spacing: 0; line-height: 1.3; }
.h3 { font-size: var(--fs-h3); font-weight: 800; line-height: var(--lh-snug); }
.muted { color: var(--c-t2); }

/* ---------- Device ----------
   An iPhone 16 Pro: titanium band, black bezel, Dynamic Island and the
   app's real screenshot (1206 x 2622) filling the glass edge to edge.
   Sizes follow --pw, the device width, so every part scales together. */
.device {
  --pw: 300px;
  --band: calc(var(--pw) * 0.012);
  --bezel: calc(var(--pw) * 0.03);
  --r-screen: calc((var(--pw) - 2 * (var(--band) + var(--bezel))) * 0.137);
  position: relative; width: var(--pw); flex: none;
  padding: var(--band);
  border-radius: calc(var(--r-screen) + var(--bezel) + var(--band));
  background: linear-gradient(150deg, #8a8a92 0%, #3a3a3f 18%, #6e6e76 42%, #2c2c30 68%, #7c7c84 100%);
  box-shadow:
    0 calc(var(--pw) * 0.14) calc(var(--pw) * 0.28) calc(var(--pw) * -0.06) rgb(0 0 0 / 0.75),
    0 calc(var(--pw) * 0.06) calc(var(--pw) * 0.5) rgb(137 80 215 / 0.22);
}
/* Side buttons: action and volume on one edge, side button on the other */
.device::before, .device::after {
  content: ""; position: absolute; width: calc(var(--pw) * 0.011); border-radius: 2px;
  background: linear-gradient(90deg, #4a4a50, #8a8a92 50%, #4a4a50);
}
.device::before {
  left: calc(var(--pw) * -0.009); top: 20%; height: 5%;
  box-shadow: 0 calc(var(--pw) * 0.17) 0 #6a6a70, 0 calc(var(--pw) * 0.31) 0 #6a6a70;
}
.device::after { right: calc(var(--pw) * -0.009); top: 29%; height: 10%; }
.device-bezel {
  padding: var(--bezel); border-radius: calc(var(--r-screen) + var(--bezel));
  background: #000; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.07);
}
.device-screen {
  position: relative; display: grid; overflow: hidden; isolation: isolate;
  border-radius: var(--r-screen); background: #000; aspect-ratio: 1206 / 2622;
  container-type: inline-size;
}
.device-screen img { grid-area: 1 / 1; width: 100%; height: auto; }
/* Dynamic Island, status bar and home indicator at iPhone 16 Pro proportions (402 pt wide) */
.island { position: absolute; z-index: 3; top: 2.74cqw; left: 50%; translate: -50% 0; width: 31.1cqw; height: 9.2cqw; border-radius: 99px; background: #000; }
.status {
  position: absolute; z-index: 2; top: 2.74cqw; inset-inline: 0; height: 9.2cqw;
  display: grid; grid-template-columns: 1fr 31.1cqw 1fr; align-items: center; justify-items: center;
  color: #fff; font-size: 4.2cqw; font-weight: 600; letter-spacing: -0.01em; font-family: var(--f-sans);
}
.status-time { grid-column: 1; direction: ltr; }
.status-icons { grid-column: 3; height: 3.3cqw; width: auto; fill: #fff; color: #fff; }
.home-bar { position: absolute; z-index: 2; bottom: 2cqw; left: 50%; translate: -50% 0; width: 34.6cqw; height: 1.25cqw; border-radius: 99px; background: rgb(255 255 255 / 0.9); }

/* ---------- Story ---------- */
.story { padding-top: var(--s-12); }
.story .section-head { margin-bottom: var(--s-6); }
.story-desktop { display: none; }

.step-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: var(--fs-sm); background: var(--c-accent-dim); color: var(--c-accent-text);
  box-shadow: inset 0 0 0 1.5px rgb(137 80 215 / 0.5);
}

/* Phones and tablets: one phone per step, swiped sideways */
.carousel { margin-inline: calc(var(--gutter) * -1); }
.slides {
  display: flex; gap: var(--s-4); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: var(--s-2) calc((100vw - var(--slide-w)) / 2) var(--s-10);
  --slide-w: min(84vw, 380px);
}
.slides::-webkit-scrollbar { display: none; }
.slide {
  flex: none; width: var(--slide-w); scroll-snap-align: center; scroll-snap-stop: always;
  display: grid; justify-items: center; gap: var(--s-5);
  transition: opacity var(--d-med) var(--ease-out), transform var(--d-spring) var(--ease-spring);
}
.slide:not(.is-active) { opacity: 0.4; transform: scale(0.94); }
.slide-cap { display: flex; gap: var(--s-3); align-items: flex-start; width: 100%; min-height: 6.2em; }
.slide-cap h3 { font-size: var(--fs-lg); font-weight: 800; line-height: var(--lh-snug); }
.slide-cap p { color: var(--c-t2); font-size: var(--fs-sm); margin-top: 2px; text-wrap: pretty; }
.device-slide { --pw: min(72vw, 320px, calc((100svh - 230px) * 0.46)); }
.dots { display: flex; justify-content: center; gap: var(--s-2); margin-top: calc(var(--s-6) * -1); }
.dot { width: 8px; height: 8px; border-radius: 99px; background: rgb(255 255 255 / 0.22); transition: width var(--d-spring) var(--ease-spring), background-color var(--d-fast) var(--ease-out); }
.dot[aria-current="true"] { width: 24px; background: var(--c-accent); }
/* Hit area larger than the visible dot */
.dot { position: relative; }
.dot::after { content: ""; position: absolute; inset: -10px -4px; }

/* Desktop: the phone stays put while the steps scroll */
.story-track { position: relative; height: calc(var(--steps) * 70svh + 100svh); max-width: var(--maxw); margin: 0 auto; }
.story-sticky {
  position: sticky; top: 0; height: 100svh;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; column-gap: var(--s-16);
  align-items: center; padding: calc(var(--nav-h) + var(--s-8)) 0 var(--s-6);
}
.device-story { --pw: min(calc((100svh - var(--nav-h) - 120px) * 0.455), 400px); grid-column: 2; grid-row: 1; }
.device-story .shot { grid-area: 1 / 1; display: grid; opacity: 0; transition: opacity var(--d-med) var(--ease-out); }
.device-story .shot img { grid-area: 1 / 1; }
.story-sticky[data-step="1"] [data-screen="1"],
.story-sticky[data-step="2"] [data-screen="2"],
.story-sticky[data-step="3"] [data-screen="3"],
.story-sticky[data-step="4"] [data-screen="4"],
.story-sticky[data-step="5"] [data-screen="5"],
.story-sticky[data-step="6"] [data-screen="6"] { opacity: 1; }

.steps { grid-column: 1; grid-row: 1; display: grid; gap: var(--s-2); align-content: center; }
.step {
  display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-4) var(--s-5); border-radius: var(--r-lg);
  border: 1px solid transparent; opacity: 0.38;
  transition: opacity var(--d-med) var(--ease-out), background-color var(--d-med) var(--ease-out), border-color var(--d-med) var(--ease-out);
}
.step h3 { font-size: var(--fs-lg); font-weight: 800; line-height: var(--lh-snug); }
.step p { color: var(--c-t2); font-size: var(--fs-sm); margin-top: 2px; text-wrap: pretty; }
.story-sticky[data-step="1"] [data-step-item="1"],
.story-sticky[data-step="2"] [data-step-item="2"],
.story-sticky[data-step="3"] [data-step-item="3"],
.story-sticky[data-step="4"] [data-step-item="4"],
.story-sticky[data-step="5"] [data-step-item="5"],
.story-sticky[data-step="6"] [data-step-item="6"] { opacity: 1; background: var(--c-surface); border-color: var(--c-border); }

.progress { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: 220px; height: 4px; border-radius: var(--r-pill); background: rgb(255 255 255 / 0.08); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 100%; background: var(--g-accent); transform-origin: left; transform: scaleX(var(--story-p, 0.17)); }
html[dir="rtl"] .progress-fill { transform-origin: right; }

@media (min-width: 1000px) and (min-height: 620px) {
  .story-desktop { display: block; }
  .story-mobile { display: none; }
  .story .section-head { margin-bottom: 0; }
}

@keyframes talk { from { height: 18%; } to { height: 100%; } }

/* ---------- Features ---------- */
.features { padding-top: var(--s-24); padding-bottom: var(--s-16); }
.bento { max-width: var(--maxw); margin: 0 auto; display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
.card {
  position: relative; padding: var(--s-6); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-surface-2), var(--c-surface));
  border: 1px solid var(--c-border); box-shadow: var(--sh-card);
  display: grid; align-content: start; gap: var(--s-2);
  transition: border-color var(--d-med) var(--ease-out), transform var(--d-spring) var(--ease-spring);
}
@media (hover: hover) { .card:hover { border-color: rgb(137 80 215 / 0.45); transform: translateY(-3px); } }
.card h3 { font-size: var(--fs-lg); font-weight: 800; line-height: var(--lh-snug); }
.card p { color: var(--c-t2); font-size: var(--fs-sm); }
.icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--c-accent-dim); margin-bottom: var(--s-2); }
.icon svg { width: 22px; height: 22px; fill: var(--c-accent-text); }

.privacy-demo { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
.field { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: rgb(255 255 255 / 0.03); border: 1px dashed var(--c-border); font-size: var(--fs-sm); }
.field-k { color: var(--c-t3); }
.field s { color: var(--c-t3); text-decoration-color: var(--c-red); text-decoration-thickness: 2px; direction: ltr; }
.field-on { border-style: solid; border-color: rgb(137 80 215 / 0.5); background: var(--c-accent-dim); }
.field-on b { font-weight: 700; }

/* Cards rise into place as they scroll in, tied to scroll position, not time */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal both var(--ease-out); animation-timeline: view(); animation-range: entry 0% cover 28%; }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(40px) scale(0.98); } }

/* ---------- Final CTA ---------- */
.final { padding-block: var(--s-16) var(--s-24); text-align: center; display: grid; justify-items: center; gap: var(--s-4); position: relative; }
.final::before { content: ""; position: absolute; inset: 10% 0 0; z-index: -1; background: radial-gradient(50% 50% at 50% 45%, rgb(137 80 215 / 0.18), transparent 70%); pointer-events: none; }
.final-bars { display: flex; align-items: center; gap: 6px; height: 56px; margin-bottom: var(--s-2); }
.final-bars i { display: block; width: 6px; height: 40%; border-radius: var(--r-pill); background: var(--g-accent); }
.final-bars i:nth-child(3n) { height: 75%; } .final-bars i:nth-child(4n) { height: 55%; } .final-bars i:nth-child(5) { height: 100%; }
.final-sub { color: var(--c-t2); max-width: 30ch; font-size: var(--fs-lg); margin-bottom: var(--s-4); }
.soon { color: var(--c-t3); font-size: var(--fs-xs); }
@media (prefers-reduced-motion: no-preference) {
  .final-bars i { animation: talk 1.2s var(--ease-in-out) infinite alternate; animation-play-state: paused; }
  .final-bars.is-live i { animation-play-state: running; }
  .final-bars i:nth-child(2n) { animation-duration: 0.9s; }
  .final-bars i:nth-child(3n) { animation-duration: 1.4s; animation-delay: -0.5s; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--c-border); padding: var(--s-10) var(--gutter) calc(var(--s-10) + env(safe-area-inset-bottom)); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: grid; justify-items: center; gap: var(--s-5); text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-5); font-size: var(--fs-sm); }
.footer-links a { color: var(--c-t2); text-decoration: none; transition: color var(--d-fast) var(--ease-out); }
.footer-links a:hover { color: var(--c-t1); }
.copy { color: var(--c-t3); font-size: var(--fs-xs); }
.socials { display: flex; justify-content: center; gap: var(--s-2); }
.socials a {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: var(--c-t2); background: rgb(255 255 255 / 0.05); border: 1px solid var(--c-glass-edge);
  transition: color var(--d-fast) var(--ease-out), background-color var(--d-fast) var(--ease-out);
}
.socials a:hover { color: var(--c-t1); background: rgb(255 255 255 / 0.1); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.socials svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; }
.socials svg .dot-fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- View transition for language switch ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--d-med); animation-timing-function: var(--ease-out); }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  /* Two columns: five cards fill two pairs and one full-width closing card */
  .card-end { grid-column: span 2; }
}

@media (min-width: 1000px) {
  .hero { align-items: center; padding-bottom: var(--s-16); }
  .bento { grid-template-columns: repeat(3, 1fr); }
  .card-end { grid-column: auto; }
  .card-wide { grid-column: span 2; grid-row: span 1; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s-8); align-items: start; }
  .card-wide > .icon, .card-wide > h3, .card-wide > p { grid-column: 1; }
  .card-wide > .privacy-demo { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
}

/* ---------- Reduced motion: keep crossfades, drop movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .slide, .slide:not(.is-active) { transform: none; transition: opacity var(--d-med) var(--ease-out); }
  .btn, .store-btn, .seg-thumb, .card { transition-property: background-color, border-color, box-shadow, color; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Legal and support pages: terms, privacy, support (AR and EN files)
   ========================================================================== */
:root { --c-t-read: #c7c7cc; --measure: 68ch; }

/* Language switch on these pages links to the other file */
a.seg-btn, span.seg-btn { display: grid; place-items: center; text-decoration: none; }
.seg-btn[aria-current="page"] { color: var(--c-t1); }
a.seg-btn:hover { color: var(--c-t1); }

.legal {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--nav-h) + var(--s-16)) var(--gutter) var(--s-16);
  color: var(--c-t-read); font-size: var(--fs-md); line-height: 1.75;
  overflow-wrap: break-word;
}
html[lang="ar"] .legal { line-height: 1.95; }
.legal h1 { color: var(--c-t1); font-size: var(--fs-h2); line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; margin-bottom: var(--s-2); }
html[lang="ar"] .legal h1 { letter-spacing: 0; line-height: 1.3; }
.legal h2 { color: var(--c-t1); font-size: var(--fs-lg); line-height: var(--lh-snug); font-weight: 800; margin: var(--s-12) 0 var(--s-3); text-wrap: balance; }
.legal p { margin-bottom: var(--s-4); text-wrap: pretty; }
.legal strong { color: var(--c-t1); font-weight: 700; }
.legal a { color: var(--c-accent-text); text-decoration: underline; text-decoration-color: rgb(184 146 255 / 0.4); text-underline-offset: 3px; }
.legal a:hover { text-decoration-color: currentColor; }
.legal .last-updated { color: var(--c-t3); font-size: var(--fs-sm); margin-bottom: var(--s-10); }
.legal .intro { color: var(--c-t2); font-size: var(--fs-lg); margin-bottom: var(--s-8); }
.legal ul { margin-bottom: var(--s-4); display: grid; gap: var(--s-2); }
.legal ul li { position: relative; padding-inline-start: var(--s-6); }
.legal ul li::before {
  content: ""; position: absolute; inset-inline-start: var(--s-1); top: 0.75em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-accent);
}

.legal .contact-block {
  padding: var(--s-5) var(--s-6); margin-bottom: var(--s-4); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--c-surface-2), var(--c-surface));
  border: 1px solid var(--c-border);
}
.legal .contact-block p { margin-bottom: var(--s-1); }
.legal .contact-block p:last-child { margin-bottom: 0; }
.legal .contact-block .response-time { color: var(--c-t3); font-size: var(--fs-sm); margin-top: var(--s-2); }

/* Support FAQ: native disclosure, the + turns into × to show it is open */
.legal .faq { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.legal .faq details {
  border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-border);
  transition: border-color var(--d-med) var(--ease-out), background-color var(--d-med) var(--ease-out);
}
.legal .faq details[open] { border-color: rgb(137 80 215 / 0.5); background: var(--c-surface-2); }
.legal .faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 56px; padding: var(--s-4) var(--s-5); cursor: pointer; list-style: none;
  color: var(--c-t1); font-weight: 700; line-height: var(--lh-snug);
}
.legal .faq summary::-webkit-details-marker { display: none; }
.legal .faq summary::after {
  content: "+"; flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-accent-dim); color: var(--c-accent-text);
  font-size: 1.25rem; font-weight: 500; line-height: 1;
  transition: transform var(--d-spring) var(--ease-spring);
}
.legal .faq details[open] summary::after { transform: rotate(45deg); }
.legal .faq .answer { padding: 0 var(--s-5) var(--s-5); color: var(--c-t2); }
.legal .faq .answer p { margin-bottom: var(--s-3); }
.legal .faq .answer p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .legal .faq summary::after { transition: none; }
}
