/* Veynder – calm, private, trustworthy. Logical properties throughout for RTL. */

:root {
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #efebe3;
  --ink: #1e2a2c;
  --muted: #5a6567;
  --line: #e2dbcf;
  --accent: #2e5b4e;
  --accent-hover: #244a3f;
  --accent-ink: #ffffff;
  --accent-soft: #e3ece6;
  --warm: #8f5e2e; /* 5:1 on --bg (WCAG AA for the italic tagline) */
  --danger: #a3392b;
  --ok: #2e6b4a;
  --focus: #2e5b4e;
  --shadow: 0 1px 2px rgb(30 42 44 / 0.04), 0 8px 24px rgb(30 42 44 / 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a1b;
    --surface: #1a2224;
    --surface-2: #20292b;
    --ink: #e8e5de;
    --muted: #a5adab;
    --line: #2c3739;
    --accent: #8dbfa8;
    --accent-hover: #a3cdb9;
    --accent-ink: #10201a;
    --accent-soft: #1f2e29;
    --warm: #d6a46d;
    --danger: #e58b7d;
    --ok: #8dcfa8;
    --focus: #a3cdb9;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

:lang(ar) {
  --font-body: "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, "Arabic Typesetting", sans-serif;
  --font-head: "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
html[dir="rtl"] body { line-height: 1.8; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
html[dir="rtl"] :is(h1, h2, h3, h4) { letter-spacing: 0; line-height: 1.45; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: max(20px, env(safe-area-inset-left)); }
.narrow { max-width: 760px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.fineprint { color: var(--muted); font-size: 0.95rem; max-width: 70ch; margin-block-start: 2rem; }

.skip {
  position: absolute; inset-inline-start: 1rem; inset-block-start: -100px;
  background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; border-radius: 8px; z-index: 100;
}
.skip:focus { inset-block-start: 1rem; }

/* ---------- Icons ---------- */
.icon { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon .knob { fill: var(--surface); }
html[dir="rtl"] .icon-dir { transform: scaleX(-1); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-block-end: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-size: 1.3rem; font-weight: 600; }
.brand-mark { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.brand-mark .brand-dot { fill: var(--accent); stroke: none; }
html[dir="rtl"] .brand-mark { transform: scaleX(-1); }
.main-nav { display: none; gap: 1.4rem; margin-inline-start: auto; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: 0.97rem; }
.main-nav a:hover { color: var(--ink); }
.lang-switch { display: flex; gap: 0.25rem; margin-inline-start: auto; background: var(--surface-2); padding: 0.25rem; border-radius: 999px; }
.main-nav + .lang-switch { margin-inline-start: 0; }
.lang-switch a { color: var(--muted); text-decoration: none; font-size: 0.88rem; font-weight: 600; padding: 0.3rem 0.7rem; border-radius: 999px; line-height: 1.4; }
.lang-switch a[lang="ar"] { font-family: "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif; font-weight: 500; }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
@media (min-width: 900px) {
  .main-nav { display: flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 600; font-size: 1rem;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 0.7rem 1.35rem; min-height: 46px; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; min-height: 52px; }
[data-back] .icon { transform: scaleX(-1); }
html[dir="rtl"] [data-back] .icon { transform: none; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem); }
.section-head { margin-block-end: 2.5rem; }
.section-head.center { text-align: center; }
.section-head.center .lead { margin-inline: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Hero */
.hero { padding-block: clamp(2.5rem, 1rem + 6vw, 6rem) clamp(3rem, 2rem + 4vw, 5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--accent-soft); color: var(--accent); border-radius: 999px;
  padding: 0.35rem 0.9rem; font-size: 0.88rem; font-weight: 600; margin-block-end: 1.5rem;
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warm); flex: none; }
.tagline { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-style: italic; color: var(--warm); }
.hero-tagline { font-size: 1.15rem; margin-block-end: 0.75rem; }
html[dir="rtl"] .tagline { text-align: right; }
.hero h1 { max-width: 20ch; }
html[dir="rtl"] .hero h1 { max-width: 24ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block: 2rem 1.25rem; }
.note { font-size: 0.95rem; color: var(--muted); max-width: 52ch; }
.hero-art { display: none; justify-self: center; width: min(100%, 360px); }
.relay-art { width: 100%; height: auto; }
.relay-art .ring { fill: none; stroke: var(--line); stroke-width: 1.2; }
.relay-art .r3 { stroke: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.relay-art .line { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.relay-art .line.faint { stroke-dasharray: 2 6; opacity: 0.6; }
.relay-art .node { fill: var(--accent); }
.relay-art .node.hollow { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.relay-art .node.accent { fill: var(--warm); }
html[dir="rtl"] .relay-art { transform: scaleX(-1); }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.35fr 1fr; }
  .hero-art { display: block; }
}

/* Problem */
.problem { background: var(--surface); border-block: 1px solid var(--line); }
.question-list { list-style: none; padding: 0; margin: 2rem 0; display: grid; gap: 0.75rem; }
.question-list li {
  position: relative; padding: 1rem 1.25rem; padding-inline-start: 3rem;
  background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.question-list li::before {
  content: "?"; position: absolute; inset-inline-start: 1.1rem; inset-block-start: 1rem;
  font-family: var(--font-head); color: var(--warm); font-weight: 700;
}
html[dir="rtl"] .question-list li::before { content: "؟"; }
.closing { font-family: var(--font-head); font-size: 1.2rem; }

/* How */
.steps { list-style: none; padding: 0; margin: 0 0 3rem; display: grid; gap: 1rem; counter-reset: none; }
.step-card { position: relative; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step-num {
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; margin-block-end: 1rem;
}
.step-card p { color: var(--muted); margin: 0; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step-card:not(:last-child)::after {
    content: ""; position: absolute; inset-block-start: 2.6rem; inset-inline-end: -1rem; width: 1rem; height: 1.5px;
    background: var(--accent); opacity: 0.4;
  }
}
.components { display: grid; gap: 1rem; }
.component, .limits { padding: 1.75rem; }
.component p { color: var(--muted); margin: 0; }
html[dir="rtl"] .component h3 { text-align: right; }
.component-icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-block-end: 1rem; }
.limits { background: var(--surface-2); box-shadow: none; }
.limits ul { margin: 0; padding-inline-start: 1.2rem; color: var(--muted); }
.limits li { margin-block-end: 0.35rem; }
@media (min-width: 900px) { .components { grid-template-columns: 1fr 1fr 1fr; } }

/* Areas */
.areas { background: var(--surface); border-block: 1px solid var(--line); }
.area-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
.area { display: flex; align-items: center; gap: 0.9rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.area .icon { color: var(--accent); width: 1.6em; height: 1.6em; }
@media (min-width: 560px) { .area-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .area-grid { grid-template-columns: repeat(4, 1fr); } }

/* Privacy */
.privacy-grid { display: grid; gap: 2rem 2.5rem; }
.privacy-item p { color: var(--muted); margin: 0; }
@media (min-width: 720px) { .privacy-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Survey ---------- */
.survey-section { background: var(--surface-2); }
.survey, .done { padding: clamp(1.25rem, 0.8rem + 2vw, 2.25rem); }
.survey-head { margin-block-end: 1.5rem; }
.step-label { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin-block-end: 0.5rem; }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 33.333%; background: var(--accent); border-radius: 4px; transition: width .3s ease; }
.progress[data-step="2"] .progress-bar { width: 66.666%; }
.progress[data-step="3"] .progress-bar { width: 100%; }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step legend { font-family: var(--font-head); font-size: clamp(1.2rem, 1rem + 0.8vw, 1.45rem); font-weight: 600; line-height: 1.35; padding: 0; margin-block-end: 1.25rem; }
html[dir="rtl"] .step legend { line-height: 1.6; }
.price { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; border-radius: 8px; padding: 0.4rem 0.85rem; margin-block: -0.25rem 1.25rem; }
.options { display: grid; gap: 0.6rem; }
@media (min-width: 560px) { .step[data-step="3"] .options { grid-template-columns: 1fr 1fr; } }
.option {
  position: relative; display: flex; align-items: center; gap: 0.8rem;
  padding: 0.9rem 1.1rem; min-height: 54px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.option:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.option input:checked ~ .option-mark { border-color: var(--accent); }
.option input:checked ~ .option-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.other-field { margin-block-start: 1rem; }
.other-field label, .field-label { display: block; font-weight: 600; margin-block-end: 0.4rem; }
textarea, input[type="email"] {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem;
}
textarea:focus, input[type="email"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
html[dir="rtl"] input[type="email"] { text-align: right; }
.hint { font-size: 0.88rem; color: var(--muted); margin: 0.4rem 0 0; }
.hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.5em; margin: 1rem 0 0; }
.form-error:empty { min-height: 0; margin: 0; }
.form-ok { color: var(--ok); font-weight: 600; margin: 0.75rem 0 0; }
.form-ok:empty { margin: 0; }
.survey-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-block-start: 1.75rem; flex-wrap: wrap; }
.survey-actions [data-back] { margin-inline-end: auto; }

.done:focus { outline: none; }
.done-head { display: flex; gap: 1rem; align-items: flex-start; }
.done-head p { color: var(--muted); }
.done-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--accent-soft); color: var(--ok); flex: none; }
.waitlist, .share { border-block-start: 1px solid var(--line); padding-block-start: 1.5rem; margin-block-start: 1.5rem; }
.check { display: flex; gap: 0.65rem; align-items: flex-start; margin-block: 0.85rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-block-start: 0.25rem; accent-color: var(--accent); flex: none; }
#waitlist .btn { margin-block-start: 0.5rem; }
#waitlist input[type="email"] { margin-block-end: 0.5rem; }

/* FAQ */
.faq-list { border-block-start: 1px solid var(--line); margin-block-start: 2rem; }
.faq details { border-block-end: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 0; cursor: pointer; list-style: none; font-weight: 600; font-size: 1.07rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--accent); transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-block-end: 1.15rem; margin: 0; max-width: 68ch; }

/* Policy page */
.policy h2 { font-size: 1.35rem; margin-block-start: 2.25rem; }
.policy ul { padding-inline-start: 1.25rem; }
.policy li { margin-block-end: 0.5rem; }

/* Footer */
.site-footer { border-block-start: 1px solid var(--line); padding-block: 2.5rem calc(2.5rem + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.95rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; }
.footer-brand { font-family: var(--font-head); font-size: 1.2rem; color: var(--ink); font-weight: 600; margin-block-end: 0.25rem; }
.footer-meta { text-align: end; }
.footer-meta p { margin-block-end: 0.35rem; }
@media (max-width: 640px) { .footer-meta { text-align: start; } }
