/* Dawa2 website. Brand tokens from the app's "Tend" palette (apps/mobile/src/ui/theme.ts). */
:root {
  --bg: #f6f4ef;
  --bg2: #efece5;
  --surface: #ffffff;
  --ink: #1a2422;
  --ink2: #4c5856;
  --ink3: #5f6a68;
  --line: #e3dfd6;
  --primary: #0f766e;
  --on-primary: #ffffff;
  --soft: #dcefeb;
  --on-soft: #0b5f59;
  --mint: #5ec4b6;
  --mint-ink: #0f766e;
  --hero: #0b4f4a;
  --hero-ink: #f6f4ef;
  --hero-ink2: #c4e3de;
  --shadow: 0 24px 60px -20px rgba(11, 79, 74, 0.35);
  --radius: 24px;
  --font-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --font-head: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light dark;
}
:lang(ar) {
  --font-body: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  --font-head: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111615;
    --bg2: #161c1b;
    --surface: #1a201f;
    --ink: #e7ecea;
    --ink2: #b3bebb;
    --ink3: #94a09d;
    --line: #303938;
    --primary: #3cbfb1;
    --on-primary: #06211e;
    --soft: #173b37;
    --on-soft: #8fe0d5;
    --mint-ink: #3cbfb1;
    --hero: #173b37;
    --hero-ink: #e7ecea;
    --hero-ink2: #b3d6d0;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme='dark'] {
  --bg: #111615;
  --bg2: #161c1b;
  --surface: #1a201f;
  --ink: #e7ecea;
  --ink2: #b3bebb;
  --ink3: #94a09d;
  --line: #303938;
  --primary: #3cbfb1;
  --on-primary: #06211e;
  --soft: #173b37;
  --on-soft: #8fe0d5;
  --mint-ink: #3cbfb1;
  --hero: #173b37;
  --hero-ink: #e7ecea;
  --hero-ink2: #b3d6d0;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, .btn, .brand { font-family: var(--font-head); }
a { color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 36px; width: auto; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .logo-light { display: none !important; }
  :root:not([data-theme='light']) .logo-dark { display: block !important; }
}
:root[data-theme='dark'] .logo-light { display: none !important; }
:root[data-theme='dark'] .logo-dark { display: block !important; }

/* Light / dark switch */
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink2); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun { display: none; }
  :root:not([data-theme='light']) .theme-toggle .moon { display: block; }
}
:root[data-theme='dark'] .theme-toggle .sun { display: none; }
:root[data-theme='dark'] .theme-toggle .moon { display: block; }
.links { display: flex; gap: 22px; margin-inline-start: auto; }
.links a { text-decoration: none; color: var(--ink2); font-weight: 500; font-size: 15px; }
.links a:hover { color: var(--ink); }
.lang-switch {
  text-decoration: none; font-weight: 500; font-size: 14px; color: var(--ink2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-weight: 700; border-radius: 999px; padding: 12px 22px; font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 14px; box-shadow: none; }
.btn svg { width: 20px; height: 20px; }

/* ── Hero ────────────────────────────────────────────── */
.hero { padding: 72px 0 56px; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500;
  color: var(--ink2); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
h1 { font-size: clamp(36px, 5.4vw, 58px); line-height: 1.1; margin: 20px 0 16px; letter-spacing: -0.01em; }
[dir='rtl'] h1 { line-height: 1.3; letter-spacing: 0; }
.lead { font-size: clamp(17px, 2vw, 19px); color: var(--ink2); max-width: 560px; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.meta { margin-top: 14px; font-size: 14px; color: var(--ink3); }
.phones { position: relative; height: 560px; }
.phone {
  position: absolute; width: 250px; border-radius: 38px; padding: 9px;
  background: #0c1110; box-shadow: var(--shadow);
}
.phone img { border-radius: 30px; }
/* --mx / --my (-1…1) follow the pointer over the hero; the phones lean toward it at different depths. */
.phones .phone { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.phone.front {
  inset-inline-start: 10%; top: 0; z-index: 2;
  transform: translate3d(calc(var(--mx, 0) * 14px), calc(var(--my, 0) * 10px), 0);
}
.phone.back {
  inset-inline-start: 42%; top: 56px; z-index: 1; opacity: 0.96;
  transform: translate3d(calc(var(--mx, 0) * -9px), calc(var(--my, 0) * -6px), 0) rotate(6deg);
}
[dir='rtl'] .phone.back { transform: translate3d(calc(var(--mx, 0) * -9px), calc(var(--my, 0) * -6px), 0) rotate(-6deg); }

/* ── Trust strip ─────────────────────────────────────── */
.trust { border-block: 1px solid var(--line); background: var(--bg2); }
.trust ul {
  list-style: none; margin: 0; padding: 18px 0; display: flex; flex-wrap: wrap;
  justify-content: center; gap: 12px 36px;
}
.trust li { display: flex; align-items: center; gap: 8px; color: var(--ink2); font-weight: 500; font-size: 15px; }
.trust svg { width: 18px; height: 18px; color: var(--mint-ink); }

/* ── Sections ────────────────────────────────────────── */
section.block { padding: 88px 0; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 38px); line-height: 1.2; margin: 0 0 12px; }
.section-head p { color: var(--ink2); margin: 0; font-size: 17px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
}
.feature .icon {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  background: var(--soft); color: var(--on-soft); margin-bottom: 16px;
}
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--ink2); font-size: 15px; }

/* ── Gallery ─────────────────────────────────────────── */
.gallery-bar { display: flex; justify-content: center; margin-bottom: 28px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px; background: var(--surface); }
.seg button {
  font: inherit; font-size: 14px; font-weight: 500; border: 0; background: transparent; color: var(--ink2);
  padding: 8px 18px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-pressed='true'] { background: var(--primary); color: var(--on-primary); }
.gallery { display: flex; gap: 20px; overflow-x: auto; padding: 8px 4px 20px; scroll-snap-type: x mandatory; }
.gallery figure { margin: 0; flex: 0 0 220px; scroll-snap-align: start; text-align: center; }
.gallery .phone { position: static; width: 220px; padding: 7px; border-radius: 32px; }
.gallery .phone img { border-radius: 26px; }
.gallery figcaption { margin-top: 12px; font-weight: 500; color: var(--ink2); font-size: 15px; }

/* ── Install ─────────────────────────────────────────── */
.install { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.download-card {
  background: var(--hero); color: var(--hero-ink); border-radius: 32px; padding: 32px; box-shadow: var(--shadow);
}
.download-card h3 { margin: 0 0 4px; font-size: 24px; }
.download-card p { color: var(--hero-ink2); margin: 0 0 20px; }
.download-card .btn-primary { background: var(--hero-ink); color: var(--hero); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 18px; }
.facts div { background: rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 12px 14px; }
.facts dt { font-size: 12px; color: var(--hero-ink2); }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.checksum { font-size: 12px; color: var(--hero-ink2); word-break: break-all; }
.checksum code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.steps li {
  counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 18px 20px 18px 64px; position: relative;
}
[dir='rtl'] .steps li { padding: 18px 64px 18px 20px; }
.steps li::before {
  content: counter(step); position: absolute; inset-inline-start: 18px; top: 18px; width: 30px; height: 30px;
  border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary);
  font-weight: 700; font-size: 14px;
}
.steps h4 { margin: 0 0 4px; font-size: 16px; }
.steps p { margin: 0; color: var(--ink2); font-size: 15px; }
.note {
  margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--bg2);
  color: var(--ink2); font-size: 14px; border: 1px solid var(--line);
}

/* ── Privacy band ────────────────────────────────────── */
.privacy-band {
  background: var(--surface); border: 1px solid var(--line); border-radius: 32px; padding: 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
}
.privacy-band h2 { font-size: clamp(26px, 3.2vw, 34px); margin: 0 0 12px; line-height: 1.2; }
.privacy-band p { color: var(--ink2); margin: 0 0 20px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink2); }
.checks svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--mint-ink); margin-top: 2px; }

/* ── FAQ ─────────────────────────────────────────────── */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 20px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--ink3); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { margin: 0 0 16px; color: var(--ink2); }

/* ── Footer ──────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; margin-top: 40px; }
footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
footer img { height: 30px; width: auto; }
footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
footer a { color: var(--ink2); text-decoration: none; font-size: 14px; }
footer a:hover { color: var(--ink); }
footer small { color: var(--ink3); width: 100%; }

/* ── Policy page ─────────────────────────────────────── */
.policy { max-width: 780px; margin: 0 auto; padding: 56px 20px 24px; }
.policy h1 { font-size: clamp(32px, 4.6vw, 44px); margin-top: 0; }
.policy h2 { font-size: 22px; margin: 36px 0 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.policy p, .policy li { color: var(--ink2); }
.policy a { color: var(--primary); }
.policy code { font-size: 0.92em; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .hero .container, .install, .privacy-band { grid-template-columns: 1fr; }
  .phones { height: 480px; max-width: 420px; margin: 0 auto; width: 100%; }
  .phone { width: 210px; }
  .features { grid-template-columns: 1fr 1fr; }
  .links { display: none; }
  .topbar .lang-switch { margin-inline-start: auto; }
  .topbar .container { gap: 12px; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  section.block { padding: 64px 0; }
  .hero { padding-top: 48px; }
  .privacy-band { padding: 28px 22px; }
  .topbar .btn-sm { display: none; }
}

/* Release line under the hero button, and What's new in the download card */
.release-line { margin-top: 6px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--ink3); }
.release-line a { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.whats-new { background: rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 14px 16px; margin: 0 0 14px; }
.whats-new h4 { margin: 0 0 8px; font-size: 15px; }
.whats-new ul { margin: 0; padding-inline-start: 20px; color: var(--hero-ink2); font-size: 14px; line-height: 1.6; }
.whats-new li + li { margin-top: 4px; }
.download-card .all-versions { margin: 0 0 14px; font-size: 14px; }
.download-card .all-versions a { color: var(--hero-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── Motion ──────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes reveal { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: none; } }
@keyframes float { 50% { translate: 0 -12px; } }
/* The back phone shows the alarm screen, so it buzzes now and then. */
@keyframes buzz {
  0%, 12%, 100% { rotate: 0deg; }
  2%, 6%, 10% { rotate: -2deg; }
  4%, 8% { rotate: 2deg; }
}
@keyframes ping { 75%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.12); opacity: 0.75; } }
@keyframes drift { to { transform: translate(-8%, 10%) scale(1.15); } }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* Hero: text rises in line by line, the phones follow, then float. */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ''; position: absolute; z-index: -1; inset-block-start: -18%; inset-inline-end: -12%;
  width: 62vw; height: 62vw; max-width: 780px; max-height: 780px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 24%, transparent), transparent);
  animation: drift 16s ease-in-out infinite alternate;
}
.hero .container > div:first-child > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.hero .container > div:first-child > :nth-child(2) { animation-delay: 0.08s; }
.hero .container > div:first-child > :nth-child(3) { animation-delay: 0.16s; }
.hero .container > div:first-child > :nth-child(4) { animation-delay: 0.24s; }
.hero .container > div:first-child > :nth-child(n + 5) { animation-delay: 0.32s; }
.phones { animation: rise 1s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.phones::before {
  content: ''; position: absolute; z-index: 0; left: 50%; top: 50%; width: 82%; aspect-ratio: 1;
  border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 30%, transparent), transparent);
  filter: blur(8px); animation: breathe 7s ease-in-out infinite;
}
.phones .phone.front { animation: float 6s ease-in-out infinite; }
.phones .phone.back { animation: float 6s -3s ease-in-out infinite, buzz 5s 1.6s ease-in-out infinite; }
.eyebrow .dot { position: relative; }
.eyebrow .dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--mint);
  animation: ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Sections rise into view as you scroll (the script adds .reveal, so nothing hides without it). */
.reveal { opacity: 0; }
.reveal.in { animation: reveal 0.8s var(--d, 0s) cubic-bezier(0.2, 0.7, 0.2, 1) both; }

/* Buttons and links */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 0.6s ease;
}
.btn-ghost { transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease; }
.links a {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 2px;
  transition: color 0.2s ease, background-size 0.3s ease; padding-bottom: 2px;
}
[dir='rtl'] .links a { background-position: 100% 100%; }
.theme-toggle, .lang-switch { transition: color 0.2s ease, border-color 0.2s ease, transform 0.4s ease; }

/* Cards and lists */
.feature { transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.feature .icon { transition: background-color 0.3s ease, color 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.trust li svg, .checks li svg { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.trust li, .checks li, .gallery figcaption { transition: color 0.2s ease; }
.gallery .phone { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease; }
.download-card { transition: transform 0.35s ease, box-shadow 0.35s ease; }
.facts div { transition: background-color 0.2s ease; }
.steps li { transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.steps li::before { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.privacy-band { transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.faq details { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.faq summary { transition: color 0.2s ease; }
.faq summary::after { content: '+'; transition: transform 0.3s ease; }
.faq details[open] summary::after { content: '+'; transform: rotate(45deg); }
.faq details[open] p { animation: rise 0.35s ease; }

@media (hover: hover) {
  .btn-primary:hover { box-shadow: 0 28px 60px -18px color-mix(in srgb, var(--primary) 70%, transparent); }
  .btn-primary:hover::after { transform: translateX(120%); }
  .btn-primary:hover svg { animation: nudge 0.8s ease-in-out infinite; }
  .btn-ghost:hover { border-color: var(--primary); background: var(--soft); color: var(--on-soft); }
  .links a:hover { background-size: 100% 2px; }
  .theme-toggle:hover { border-color: var(--primary); transform: rotate(20deg); }
  .lang-switch:hover { color: var(--ink); border-color: var(--primary); }

  .trust li:hover { color: var(--ink); }
  .trust li:hover svg { transform: scale(1.25); }

  .feature:hover {
    transform: translateY(-6px); box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  }
  .feature:hover .icon { background: var(--primary); color: var(--on-primary); transform: scale(1.08) rotate(-6deg); }

  .gallery figure:hover .phone { transform: translateY(-6px) scale(1.02); }
  .gallery figure:hover figcaption { color: var(--ink); }

  .download-card:hover { transform: translateY(-4px); box-shadow: 0 32px 70px -22px rgba(11, 79, 74, 0.55); }
  .facts div:hover { background: rgba(255, 255, 255, 0.14); }

  .steps li:hover {
    transform: translateX(4px); box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  }
  [dir='rtl'] .steps li:hover { transform: translateX(-4px); }
  .steps li:hover::before { transform: scale(1.15); }

  .privacy-band:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); box-shadow: var(--shadow); }
  .checks li:hover { color: var(--ink); }
  .checks li:hover svg { transform: scale(1.2) rotate(-8deg); }

  .faq details:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
  .faq summary:hover { color: var(--primary); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Light/dark switches (see the footer script): the page fades smoothly; on a theme switch the
   sun/moon turns into the other icon. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: ease; }
.vt-theme .theme-toggle { view-transition-name: theme-toggle; }
.vt-theme::view-transition-old(theme-toggle) { animation: theme-icon-out 0.45s ease both; }
.vt-theme::view-transition-new(theme-toggle) { animation: theme-icon-in 0.45s ease both; }
@keyframes theme-icon-out { to { opacity: 0; transform: rotate(90deg) scale(0.4); } }
@keyframes theme-icon-in { from { opacity: 0; transform: rotate(-90deg) scale(0.4); } }
