:root {
  --paper: #f4ede0;
  --paper-2: #efe5d3;
  --card: #fbf7ef;
  --line: #e2d6c0;
  --ink: #2b1e19;
  --ink-soft: #7a6656;
  --ink-faint: #a8957f;
  --rubric: #8b261e;
  --brass: #b8863b;
  --plaque: #2e221b;
  --plaque-text: #f3e4c8;
  --radius: 16px;
  --max: 1160px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.85;
}

a { color: var(--rubric); text-underline-offset: 4px; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 12px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ─── Header ─── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand span { font-family: "Amiri", serif; font-size: 23px; font-weight: 700; }
.bar nav { display: flex; gap: 28px; font-size: 15px; font-weight: 600; }
.bar nav a { color: var(--ink-soft); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--rubric); }

/* ─── Hero ─── */
.hero { padding: 80px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.hero h1 { font-family: "Amiri", serif; font-size: 72px; line-height: 1.2; }
.hero .tag { font-family: "Amiri", serif; font-size: 28px; color: var(--rubric); margin: 4px 0 18px; }
.hero .lead { font-size: 19px; color: var(--ink-soft); max-width: 520px; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.store {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 12px;
  background: var(--plaque); color: var(--plaque-text);
  text-decoration: none; font-weight: 600; font-size: 16px;
}
.store.soon { opacity: .55; pointer-events: none; }
.store small { font-weight: 400; opacity: .8; }

.demo {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 36px 32px 30px; text-align: center;
  box-shadow: 0 24px 60px -30px rgba(43, 30, 25, .35);
}
.demo .icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 8px 22px rgba(43, 30, 25, .2); }
.demo .line {
  font-family: "Amiri", serif; font-size: 44px; line-height: 1.6;
  min-height: 1.6em; margin-top: 18px; transition: color .3s;
}
.demo .line.dotted { color: var(--rubric); }
.demo .hint { color: var(--ink-faint); font-size: 15px; margin: 6px 0 20px; }
.demo .btns { display: flex; justify-content: center; gap: 10px; }

.btn {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 10px 22px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  transition: border-color .2s, background .2s;
}
.btn:hover { border-color: var(--ink-faint); }
.btn.primary { background: var(--plaque); color: var(--plaque-text); border-color: var(--plaque); }

/* ─── Sections ─── */
.band { padding: 88px 0; }
.band.alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.band h2, .doc h2 { font-family: "Amiri", serif; font-size: 40px; line-height: 1.3; color: var(--rubric); }
.section-lead { color: var(--ink-soft); font-size: 18px; margin: 8px 0 36px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li {
  counter-increment: s; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
}
.steps li::before {
  content: counter(s, arabic-indic);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--plaque); color: var(--plaque-text); font-weight: 700; margin-bottom: 14px;
}
.steps b { display: block; font-size: 19px; margin-bottom: 4px; }
.steps p { color: var(--ink-soft); font-size: 16px; margin: 0; }
.rasm { font-family: "Amiri", serif; font-size: 1.25em; line-height: 1; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px;
}
.card b { display: block; font-size: 19px; margin-bottom: 6px; }
.card b::before {
  content: ""; display: block; width: 28px; height: 3px; border-radius: 2px;
  background: var(--brass); margin-bottom: 14px;
}
.card p { color: var(--ink-soft); font-size: 16px; line-height: 1.75; margin: 0; }

/* ─── Support ─── */
.support-grid { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; }
.support-grid h2 { margin-bottom: 28px; }
details {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  margin-bottom: 10px; padding: 0 22px;
}
summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; font-size: 17px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink-faint); font-size: 22px; line-height: 1; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 0 16px; color: var(--ink-soft); font-size: 16px; }
details > div p:last-child { margin: 0; }

.contact {
  position: sticky; top: 96px;
  background: var(--plaque); color: var(--plaque-text);
  border-radius: 20px; padding: 30px 26px;
}
.contact h3 { font-family: "Amiri", serif; font-size: 30px; margin-bottom: 6px; }
.contact p { opacity: .82; font-size: 16px; }
.mail-link {
  display: block; color: var(--plaque-text); font-size: 21px; font-weight: 600;
  direction: ltr; text-align: right; margin: 18px 0 14px; word-break: break-all;
}
.btn.ghost { background: transparent; color: var(--plaque-text); border-color: rgba(243, 228, 200, .35); width: 100%; }
.btn.ghost:hover { border-color: var(--plaque-text); }
.contact .note { font-size: 14px; opacity: .65; margin: 16px 0 0; }

/* ─── Policy page ─── */
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.page-head h1 { font-family: "Amiri", serif; font-size: 56px; line-height: 1.25; }
.page-head .updated { color: var(--ink-faint); font-size: 15px; margin: 6px 0 0; }

.doc-grid { display: grid; grid-template-columns: 260px minmax(0, 760px); gap: 64px; padding-top: 48px; padding-bottom: 80px; }
.toc { position: sticky; top: 96px; align-self: start; font-size: 15px; }
.toc b { display: block; color: var(--ink-faint); font-size: 13px; margin-bottom: 10px; }
.toc ol { margin: 0; padding: 0 0 0 0; list-style: none; border-right: 2px solid var(--line); }
.toc li a {
  display: block; padding: 6px 16px; margin-right: -2px; border-right: 2px solid transparent;
  color: var(--ink-soft); text-decoration: none;
}
.toc li a:hover { color: var(--rubric); border-right-color: var(--rubric); }

.doc > p:first-child { font-size: 19px; }
.doc h2 { font-size: 30px; margin: 40px 0 12px; }
.doc ul { padding-right: 22px; margin: 0 0 12px; }
.doc li { margin-bottom: 8px; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* ─── Footer ─── */
.foot { background: var(--plaque); color: rgba(243, 228, 200, .7); padding: 28px 0; font-size: 14px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot .brand { color: var(--plaque-text); }
.brand.small img { width: 30px; height: 30px; border-radius: 8px; }
.brand.small span { font-size: 19px; }
.foot nav { display: flex; gap: 22px; }
.foot a { color: var(--plaque-text); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--plaque); color: var(--plaque-text); padding: 9px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ─── Tablet ─── */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 64px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .support-grid { grid-template-columns: 1fr; }
  .contact { position: static; }
  .doc-grid { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
}

/* ─── Phone ─── */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 18px; }
  .bar { height: 60px; }
  .bar nav { gap: 14px; font-size: 14px; }
  .bar nav a:nth-child(2) { display: none; }
  .brand span { font-size: 20px; }
  .hero h1 { font-size: 50px; }
  .hero .tag { font-size: 24px; }
  .hero .lead { font-size: 17px; }
  .demo { padding: 28px 18px 24px; }
  .demo .line { font-size: 34px; }
  .band { padding: 60px 0; }
  .band h2 { font-size: 32px; }
  .steps, .grid { grid-template-columns: 1fr; }
  .page-head { padding: 40px 0 28px; }
  .page-head h1 { font-size: 40px; }
  .doc h2 { font-size: 26px; }
  .foot-row { flex-direction: column; text-align: center; }
}
