/* Bayan AI. Ink on ivory. Colour only when it means something. */
:root {
  --ink: #0E1F1C;
  --ivory: #F7F3EA;
  --emerald: #2B7556;
  --emerald-light: #82CBA6;
  --emerald-tint: #DCEDE3;
  --saffron: #B0701E;
  --saffron-tint: #F6E8D0;
  --saffron-text: #8A5212;
  --sand: #ECE4D3;
  --stone: #5E625B;
  --line: #DCD3C1;
  --white: #FFFFFF;

  --sans: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 14px;
  --gutter: clamp(20px, 5vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
html.i18n-pending body { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Arabic: one step larger, more line height. */
html[lang="ar"] body {
  --sans: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.85;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow > * { max-width: 760px; }
.narrow > h2 { max-width: 22ch; }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--ivory); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.section-ink :focus-visible { outline-color: var(--emerald-light); }

/* Type */
h1 { font-weight: 300; font-size: clamp(2.7rem, 9vw, 5.4rem); line-height: 1.06; letter-spacing: -0.015em; }
h2 { font-weight: 300; font-size: clamp(1.9rem, 4.6vw, 2.9rem); line-height: 1.18; letter-spacing: -0.01em; max-width: 22ch; }
h3 { font-weight: 500; font-size: 1.1rem; line-height: 1.35; }
html[lang="ar"] h1 { font-size: clamp(2.6rem, 8.5vw, 5rem); line-height: 1.3; letter-spacing: 0; }
html[lang="ar"] h2 { line-height: 1.45; letter-spacing: 0; max-width: 24ch; }
html[lang="ar"] h3 { line-height: 1.6; }
.lead { font-size: 1.2rem; color: var(--stone); max-width: 36em; margin-top: 20px; }
html[lang="ar"] .lead { font-size: 1.15rem; }
.muted { color: var(--stone); }
.small { font-size: 0.875rem; line-height: 1.5; }
html[lang="ar"] .small { font-size: 0.9rem; line-height: 1.75; }
.eyebrow { font-weight: 500; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--stone); margin-bottom: 16px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
h2 + .lead, h2 + p { margin-top: 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ivory); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.logo { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; font-size: 1.5rem; font-weight: 400; letter-spacing: -0.01em; line-height: 1; }
.logo-ar { display: none; font-size: 1.6rem; letter-spacing: 0; }
html[lang="ar"] .logo-en { display: none; }
html[lang="ar"] .logo-ar { display: inline; }
.dot { display: inline-block; width: 0.26em; height: 0.26em; border-radius: 50%; background: var(--emerald); margin-inline-start: 0.06em; }
.logo-ai { font-family: var(--mono); font-size: 0.6rem; color: var(--stone); letter-spacing: 0.04em; transform: translateY(-0.7em); }
.bar-actions { display: flex; align-items: center; gap: 10px; }

.lang-btn { font: inherit; font-size: 0.9rem; font-weight: 500; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; min-height: 40px; min-width: 52px; padding: 0 14px; cursor: pointer; }
.lang-btn:hover { background: var(--sand); }
html[lang="en"] .lang-btn { font-size: 1rem; } /* Arabic glyphs read small */

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 500; font-size: 1rem; text-decoration: none; background: var(--ink); color: var(--ivory); border: 1px solid var(--ink); border-radius: 999px; min-height: 52px; padding: 0 28px; cursor: pointer; transition: background-color .15s ease; }
.btn:hover { background: #1b332e; }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.875rem; white-space: nowrap; }
html[lang="ar"] .btn-sm { font-size: 0.95rem; }
.btn-block { width: 100%; margin-top: 8px; }
.link-quiet { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.link-quiet:hover { text-decoration-color: var(--ink); }

/* Sections */
.section { padding-block: clamp(64px, 10vw, 120px); }
.section-sand { background: var(--sand); }
.section-ink { background: var(--ink); color: var(--ivory); }
.section-ink .eyebrow { color: var(--emerald-light); }
.hero { padding-block: clamp(72px, 14vw, 168px) clamp(64px, 10vw, 112px); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 36px; }
.hero-note { margin-top: 24px; }

/* Steps */
.steps { display: grid; gap: 32px; margin-top: 48px; counter-reset: none; }
.steps li { border-top: 1px solid var(--stone); padding-top: 20px; }
.step-n { display: block; font-family: var(--mono); font-size: 0.8125rem; color: var(--stone); margin-bottom: 16px; }
html[lang="ar"] .step-n { font-family: var(--sans); font-size: 1rem; }
.steps p { color: var(--stone); margin-top: 8px; max-width: 32ch; }

/* Product preview */
.preview-head { margin-bottom: 48px; }
.result { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 32px); max-width: 600px; margin-inline: auto; display: grid; gap: 20px; }
.result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-title { font-weight: 500; font-size: 1.05rem; }
.badge { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--sand); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
html[lang="ar"] .badge { font-family: var(--sans); letter-spacing: 0; text-transform: none; font-size: 0.9rem; }
.draft { background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-size: 1.05rem; }
.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.summary > p:first-child { font-weight: 500; }
.chips { display: flex; gap: 8px; }
.chip { font-size: 0.8125rem; font-weight: 500; border-radius: 999px; padding: 4px 12px; }
html[lang="ar"] .chip { font-size: 0.9rem; }
.chip-clear { background: var(--emerald-tint); color: var(--emerald); }
.chip-flag { background: var(--saffron-tint); color: var(--saffron-text); }

.flag { background: var(--saffron-tint); border-radius: 14px; border-inline-start: 4px solid var(--saffron); padding: 20px; display: grid; gap: 6px; }
.flag-title { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--saffron-text); margin-bottom: 8px; }
.flag-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--saffron); flex: none; }
.label { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--saffron-text); margin-top: 10px; }
html[lang="ar"] .label { font-family: var(--sans); letter-spacing: 0; text-transform: none; font-size: 0.9rem; font-weight: 500; }
.label.ref { font-family: var(--mono); text-transform: none; font-size: 0.8125rem; color: var(--saffron-text); letter-spacing: 0.02em; }
html[lang="ar"] .label.ref { font-family: var(--sans); }
.claim { font-weight: 500; }
.fix { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 14px; display: grid; gap: 6px; }
.fix .label { margin-top: 0; color: var(--stone); }
.fix-text { font-size: 1.05rem; }
.fake-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fake-btn { font-size: 0.8125rem; font-weight: 500; border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }
html[lang="ar"] .fake-btn { font-size: 0.9rem; }
.fake-primary { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.passes { display: grid; gap: 8px; }
.passes li { display: flex; align-items: center; gap: 12px; background: var(--emerald-tint); border-radius: 12px; padding: 12px 16px; font-weight: 500; }
.passes svg { flex: none; }
.foot { max-width: 600px; margin: 16px auto 0; text-align: center; }

/* Cards */
.cards3 { display: grid; gap: 16px; margin-top: 48px; }
.plain-card { background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.plain-card p { color: var(--stone); margin-top: 10px; }

/* Trust */
.trust-list { display: grid; gap: 32px; margin-top: 48px; }
.trust-list li { border-top: 1px solid rgba(247, 243, 234, 0.28); padding-top: 20px; }
.trust-list p { color: #D9D6CC; margin-top: 8px; max-width: 34ch; }
.trust-line { margin-top: 56px; font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 300; color: var(--emerald-light); }

/* Form */
.form-wrap { display: grid; gap: 40px; }
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 36px); }
.field { margin-bottom: 20px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 8px; padding: 0; }
html[lang="ar"] .field > label, html[lang="ar"] .field > legend { font-size: 1rem; }
.req, .opt { font-weight: 400; font-size: 0.8125rem; color: var(--stone); margin-inline-start: 6px; }
html[lang="ar"] .req, html[lang="ar"] .opt { font-size: 0.85rem; }
input[type="text"], input[type="email"], input[type="url"] { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--ivory); border: 1px solid #A89F8B; border-radius: 10px; min-height: 50px; padding: 0 14px; }
input::placeholder { color: var(--stone); opacity: 1; }
input[type="text"]:focus-visible, input[type="email"]:focus-visible, input[type="url"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--saffron); border-width: 2px; }
.err { color: var(--saffron-text); font-size: 0.9rem; margin-top: 8px; font-weight: 500; }
.form-error { background: var(--saffron-tint); color: var(--saffron-text); border-inline-start: 4px solid var(--saffron); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-weight: 500; }
.row2 { display: grid; gap: 0 16px; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border: 1px solid #A89F8B; border-radius: 999px; background: var(--ivory); font-weight: 500; }
.pill input:checked + span { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.pill input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.check a { white-space: nowrap; }
.hp { position: absolute; left: 0; top: 0; clip-path: inset(50%); opacity: 0; pointer-events: none; width: 1px; height: 1px; overflow: hidden; }

.thanks { text-align: center; padding: 24px 8px; display: grid; justify-items: center; gap: 14px; }
.thanks:focus { outline: none; }
.thanks h3 { font-size: 1.5rem; font-weight: 400; }
.thanks p { color: var(--stone); max-width: 36ch; }
[hidden] { display: none !important; }

/* FAQ */
.faq { margin-top: 40px; border-top: 1px solid var(--stone); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; font-weight: 500; font-size: 1.1rem; min-height: 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border-inline-end: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); margin-inline-start: 8px; transition: transform .15s ease; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { color: var(--stone); padding-bottom: 22px; max-width: 60ch; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 36px 48px; font-size: 0.9rem; color: var(--stone); }
html[lang="ar"] .site-footer { font-size: 0.95rem; }
.foot-row { display: flex; flex-wrap: wrap; gap: 10px 32px; align-items: center; }
.foot-row a { color: var(--ink); }

/* Privacy page */
.doc { padding-block: clamp(56px, 9vw, 104px); }
.doc h2 { font-size: 1.35rem; font-weight: 500; max-width: none; letter-spacing: 0; margin-top: 40px; }
.doc h2 + p { margin-top: 10px; }
.doc p { color: var(--stone); max-width: 62ch; }
.doc .draft-note { background: var(--saffron-tint); color: var(--saffron-text); border-radius: 10px; padding: 12px 16px; margin-top: 24px; font-weight: 500; max-width: 62ch; }
.doc .back { display: inline-block; margin-top: 48px; color: var(--ink); font-weight: 500; }

/* Wider screens */
@media (min-width: 720px) {
  .steps, .cards3, .trust-list { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .cards3 { gap: 20px; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .bar { height: 72px; }
  html { scroll-padding-top: 84px; }
}
@media (min-width: 960px) {
  .form-wrap { grid-template-columns: 5fr 7fr; gap: 72px; align-items: start; }
  .form-intro { position: sticky; top: 112px; }
}
@media (max-width: 380px) {
  .btn-sm { padding: 0 12px; }
  .lang-btn { min-width: 46px; padding: 0 10px; }
  .logo { font-size: 1.35rem; }
}

/* Cookie banner */
.cookie { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 80; max-width: 640px; margin-inline: auto; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 6px; }
.cookie-title { font-weight: 500; }
.cookie p:not(.cookie-title):not(.cookie-actions) { color: var(--stone); font-size: 0.95rem; }
.cookie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 8px; }
.cookie-actions a { font-size: 0.9rem; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--sand); }
.link-btn { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (min-width: 720px) { .cookie { inset-inline-start: 24px; inset-inline-end: auto; margin-inline: 0; bottom: 24px; } }

/* Keep paired fields on one line, whatever the label length */
@supports (grid-template-rows: subgrid) {
  .row2 .field { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 0; align-content: start; }
  .row2 .field > label { margin-bottom: 8px; align-self: end; }
}
.row2 .field > label { align-self: start; }
.row2 .field > label .opt { display: block; margin-inline-start: 0; margin-top: 2px; }
