:root {
  --counter: #e9eef2;
  --ink: #16243b;
  --muted: #56667b;
  --paper: #ffffff;
  --tag: #f4c430;
  --tag-ink: #3b2f00;
  --paid: #17805a;
  --line: #cfd8e1;
  --radius-s: 6px;
  --radius-l: 18px;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --mono: 'IBM Plex Mono', 'IBM Plex Sans Arabic', Consolas, monospace;
  --width: 1120px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--counter);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
}

a { color: inherit; }

:focus-visible { outline: 3px solid var(--tag); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(var(--width), 100% - 32px); margin-inline: auto; }

/* الشريط العلوي */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--tag);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.langs { display: flex; gap: 4px; }

.langs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.langs button[aria-pressed='true'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* الواجهة: العنوان والوصل */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  padding-block: 40px 72px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 15ch;
}

.hero p { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 46ch; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius-s);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--ink);
}

.btn-main { background: var(--ink); color: var(--paper); }

.btn-main:hover { background: #22365a; }

.btn-plain { background: transparent; }

.btn-plain:hover { background: var(--paper); }

.btn svg { width: 20px; height: 20px; flex: none; }

/* الوصل يخرج من الطابعة: الحركة الوحيدة في الصفحة */
.printer {
  justify-self: center;
  width: min(330px, 100%);
}

.printer-slot {
  height: 22px;
  border-radius: 12px 12px 4px 4px;
  background: var(--ink);
  position: relative;
  z-index: 2;
  box-shadow: inset 0 -6px 0 #0c1626;
}

.receipt {
  margin-inline: 14px;
  margin-top: -8px;
  background: var(--paper);
  padding: 26px 22px 34px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #1f2a37;
  transform-origin: top;
  animation: print 1.6s steps(14, end) 0.3s both;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  filter: drop-shadow(0 10px 18px rgba(22, 36, 59, 0.12));
}

@keyframes print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-14px); }
  to { clip-path: inset(0 0 0 0); transform: translateY(0); }
}

.receipt .store { text-align: center; font-weight: 700; font-size: 15px; }

.receipt .meta { text-align: center; color: #6b7785; margin-bottom: 10px; }

.receipt .row { display: flex; justify-content: space-between; gap: 12px; }

.receipt .rule { border-top: 1px dashed #9aa6b2; margin: 8px 0; }

.receipt .total { font-weight: 700; font-size: 16px; }

.receipt .paid { color: var(--paid); }

.receipt .thanks { text-align: center; margin-top: 12px; }

.receipt .row > span:last-child { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }

/* الأقسام */
section { padding-block: 64px; }

section + section { border-top: 1px solid var(--line); }

h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.25; margin: 0 0 12px; }

.lead { color: var(--muted); max-width: 60ch; margin: 0 0 36px; }

/* الأوضاع الثلاثة: كيف تعمل الأجهزة معاً */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }

.mode { padding-inline: 28px; }

.mode:first-child { padding-inline-start: 0; }

.mode + .mode { border-inline-start: 1px solid var(--line); }

.mode h3 { margin: 14px 0 6px; font-size: 21px; }

.mode p { margin: 0; color: var(--muted); }

.mode .devices { display: flex; align-items: end; gap: 8px; height: 56px; color: var(--ink); }

.mode .devices svg { height: 100%; width: auto; }

/* الميزات */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 56px; }

.feature h3 { font-size: 19px; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }

.feature h3::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--tag);
  flex: none;
}

.feature ul { margin: 0; padding-inline-start: 22px; color: var(--muted); }

.feature li + li { margin-top: 4px; }

/* الأسعار (مخفية حتى تُكتب) */
.prices[hidden] { display: none; }

/* التواصل: بطاقة سعر */
.contact {
  background: var(--tag);
  color: var(--tag-ink);
  border-radius: var(--radius-l);
  padding: 44px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  inset-inline-start: 22px;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--counter);
  box-shadow: inset 0 0 0 3px rgba(59, 47, 0, 0.25);
}

.contact h2 { margin-top: 6px; }

.contact p { margin: 0; }

.contact .actions { justify-content: flex-end; }

.contact .btn { border-color: var(--tag-ink); }

.contact .btn-main { background: var(--tag-ink); color: var(--tag); }

.contact .btn-plain:hover { background: rgba(255, 255, 255, 0.35); }

/* التذييل */
footer { padding-block: 32px 48px; color: var(--muted); font-size: 15px; }

footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* صفحات النصوص (الخصوصية والشروط) */
.doc { background: var(--paper); border-radius: var(--radius-l); padding: 48px clamp(20px, 5vw, 64px); margin-block: 16px 48px; }

.doc h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 6px; }

.doc .updated { color: var(--muted); margin: 0 0 32px; }

.doc h2 { font-size: 22px; margin: 32px 0 8px; }

.doc p, .doc li { max-width: 72ch; }

.doc ul { padding-inline-start: 22px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 16px 56px; }
  .modes { grid-template-columns: 1fr; gap: 28px; }
  .mode, .mode:first-child { padding-inline: 0; }
  .mode + .mode { border-inline-start: 0; border-top: 1px solid var(--line); padding-top: 28px; }
  .features { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; padding: 40px 24px 28px; }
  .contact .actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .receipt { animation: none; }
}
