@font-face {
  font-family: Cairo;
  src: url("/fonts/Cairo-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-display: swap;
  font-optical-sizing: auto;
}

:root {
  --ink: #0f172a;
  --muted: #57534e;
  --paper: #f4efe6;
  --card: #fffdf8;
  --line: #d9d0c0;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --warm: #c2410c;
  --header: rgba(244, 239, 230, 0.72);
  --header-scrolled: rgba(244, 239, 230, 0.9);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --press-ms: 160ms;
  --ui-ms: 200ms;
  --radius: 14px;
  --tap: 2.75rem;
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: 4.75rem;
  color-scheme: light;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.7 Cairo, Tahoma, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--teal-dark);
  text-underline-offset: 0.18em;
}

.skip {
  position: absolute;
  inset-inline-start: 0.75rem;
  top: 0.5rem;
  z-index: 20;
  padding: 0.35rem 0.7rem;
  background: var(--card);
  color: var(--ink);
  transform: translateY(-120%);
  transition: transform var(--press-ms) var(--ease-out);
}

.skip:focus {
  transform: translateY(0);
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.35rem 1.15rem 3.5rem;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: background-color var(--ui-ms) var(--ease-out);
}

.site-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  height: 14px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(244, 239, 230, 0.85), transparent);
}

body.is-scrolled .site-head {
  background: var(--header-scrolled);
}

.site-head .inner {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.65rem 1.15rem 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  min-height: var(--tap);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.15rem;
  font-size: 0.95rem;
}

nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.4rem 0.55rem;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
}

nav a[aria-current="page"] {
  color: var(--teal-dark);
  font-weight: 700;
}

.lang-btn,
.btn {
  font: inherit;
  cursor: pointer;
  min-height: var(--tap);
  border-radius: var(--radius);
  touch-action: manipulation;
  transition: transform var(--press-ms) var(--ease-out), background-color var(--ui-ms) ease, color var(--ui-ms) ease, border-color var(--ui-ms) ease;
}

.lang-btn {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.25rem 0.7rem;
  color: var(--ink);
}

.lang-btn:active,
.btn:active,
.brand:active {
  transform: scale(0.97);
}

h1 {
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 1.15rem 0 0.55rem;
}

h2 {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.5rem;
}

h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 1.25rem 0 0.3rem;
}

p, li { margin: 0.5rem 0; }
ul { padding-inline-start: 1.2rem; }

.lede {
  font-size: 1.06rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.15rem 0 0.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.55rem 1.15rem;
  border: 0;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.btn:hover,
.btn:focus-visible {
  color: #fff;
  background: var(--teal-dark);
}

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--card);
  color: var(--teal-dark);
  border-color: var(--teal);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.95rem;
  margin: 0.75rem 0 1.15rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

caption {
  text-align: start;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  text-align: start;
  vertical-align: top;
}

tr:last-child td { border-bottom: 0; }

th {
  background: #ece6d8;
  font-weight: 700;
}

td.price {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
  font-weight: 600;
}

tr.plan-pro td:first-child {
  border-inline-start: 3px solid var(--teal);
  font-weight: 700;
}

.dl-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.95rem 0 0.4rem;
}

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--teal);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.07);
  transition: transform var(--press-ms) var(--ease-out), border-color var(--ui-ms) ease, box-shadow var(--ui-ms) ease;
}

.dl-card:active {
  transform: scale(0.98);
}

.dl-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dl-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dl-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.dl-card strong {
  display: block;
  font-size: 1.02rem;
  line-height: 1.35;
}

.dl-card .meta {
  margin: 0.2rem 0 0;
}

.dl-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

.dl-go::after {
  content: attr(data-label-ar);
  color: #fff;
}

html[lang="en"] .dl-go::after {
  content: attr(data-label-en);
  color: #fff;
}

.dl-go svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  flex-shrink: 0;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0.7rem 0 1.1rem;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.toc a { text-decoration: none; }

.site-foot {
  margin-top: 2.6rem;
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  position: relative;
}

.site-foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  transform: translateY(-100%);
  background: linear-gradient(to top, rgba(244, 239, 230, 0.9), transparent);
  pointer-events: none;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.en-block { display: none; }
html[lang="en"] { direction: ltr; }
html[lang="en"] .ar-block { display: none; }
html[lang="en"] .en-block { display: block; }
html[lang="en"] span.ar-inline { display: none; }
span.en-inline { display: none; }
html[lang="en"] span.en-inline { display: inline; }

.compare th,
.compare td {
  text-align: center;
  white-space: nowrap;
}

.compare th:first-child,
.compare td:first-child {
  text-align: start;
  white-space: normal;
  min-width: 8.5rem;
}

.compare .yes {
  color: var(--teal-dark);
  font-weight: 700;
}

.compare .no { color: #a8a29e; }

.compare .opt {
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: normal;
}

.channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.15rem;
}

.channel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 1 1 13rem;
  min-height: 3.1rem;
  padding: 0.6rem 1.15rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  transition: transform var(--press-ms) var(--ease-out), filter var(--ui-ms) ease, box-shadow var(--ui-ms) ease;
}

.channel-btn:active { transform: scale(0.97); }

.channel-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
  flex-shrink: 0;
}

.channel-wa { background: #128c7e; }
.channel-tg { background: #229ed9; }

@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--warm); }
  nav a:hover { color: var(--teal-dark); background: rgba(15, 118, 110, 0.08); }
  .btn:hover { background: var(--teal-dark); color: #fff; }
  .btn-ghost:hover { background: var(--card); color: var(--teal-dark); border-color: var(--teal); }
  .lang-btn:hover { border-color: var(--teal); }
  .dl-card:hover {
    border-color: var(--teal);
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.14);
    color: inherit;
    transform: translateY(-2px);
  }
  .dl-card:hover .dl-go { background: var(--teal-dark); color: #fff; }
  .dl-card:hover .dl-go::after { color: #fff; }
  .channel-btn:hover {
    color: #fff;
    filter: brightness(1.07);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
  }
  .channel-wa:hover,
  .channel-tg:hover { color: #fff; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-head,
  body.is-scrolled .site-head {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip,
  .lang-btn,
  .btn,
  .brand,
  .site-head,
  .dl-card,
  .channel-btn {
    transition: none;
  }
  .lang-btn:active,
  .btn:active,
  .brand:active,
  .dl-card:active,
  .channel-btn:active {
    transform: none;
  }
}

.table-scroll {
  overflow-x: auto;
  margin: 0.75rem 0 0.45rem;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
}

.table-scroll table {
  margin: 0;
  min-width: 36rem;
  border: 0;
  border-radius: 0;
}

.compare thead th {
  position: sticky;
  top: 0;
}

@media (max-width: 28rem) {
  nav { width: 100%; }
  .channel-btn { flex: 1 1 100%; }
}

/* Public plan catalog (brochure + screen) */
.page-catalog .wrap,
.page-catalog .site-head .inner {
  max-width: 72rem;
}

.cat-kicker {
  margin: 1.15rem 0 0;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cat-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.1rem 0 1.25rem;
}

.cat-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
}

.cat-stat strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cat-stat span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.cat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
}

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
}

.cat-tabs button {
  font: inherit;
  cursor: pointer;
  min-height: var(--tap);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  touch-action: manipulation;
}

.cat-tabs button.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-weight: 700;
}

.cat-note {
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0 0 1.15rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0.4rem 0 1.35rem;
}

.plan-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.05rem 1.1rem 1.15rem;
}

.plan-card.is-featured {
  border-color: var(--teal);
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.08);
}

.plan-card .price {
  margin: 0.15rem 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--teal-dark);
}

.plan-card h2 {
  margin: 0;
}

.home-plan-cta {
  margin: 1rem 0 0.4rem;
}

.cell-yes,
.cell-no,
.cell-opt,
.cell-add {
  white-space: nowrap;
  font-size: 0.9rem;
}

.cell-yes {
  color: var(--teal-dark);
  font-weight: 700;
}

.cell-yes::before { content: "مضمّن"; }
html[lang="en"] .cell-yes::before { content: "Included"; }

.cell-no { color: #a8a29e; }
.cell-no::before { content: "غير مضمّن"; }
html[lang="en"] .cell-no::before { content: "Not included"; }

.cell-opt {
  color: var(--teal-dark);
  font-weight: 600;
}

.cell-opt::before { content: "اختياري"; }
html[lang="en"] .cell-opt::before { content: "Optional"; }

.cell-add { font-weight: 600; }
.cell-add::before { content: "إضافة مدفوعة"; }
html[lang="en"] .cell-add::before { content: "Paid add-on"; }

@media (max-width: 56rem) {
  .cat-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: 1fr; }
}

@media (hover: hover) and (pointer: fine) {
  .cat-tabs button:hover:not(.is-active) {
    border-color: var(--teal);
    color: var(--teal-dark);
  }
}

@media print {
  .skip,
  .site-head nav,
  .lang-btn,
  .cat-tabs,
  .cat-actions,
  .channels,
  .no-print {
    display: none !important;
  }

  .site-head {
    position: static;
    background: #fff;
    backdrop-filter: none;
  }

  .site-head::after,
  .site-foot::before {
    display: none;
  }

  body,
  .page-catalog .wrap {
    max-width: none;
    background: #fff;
    color: #111;
    font-size: 11pt;
    line-height: 1.45;
  }

  [data-cat-panel][hidden] {
    display: block !important;
  }

  [data-cat-panel] {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 1.4rem;
  }

  .plan-grid,
  .cat-stats,
  table {
    break-inside: avoid;
  }

  a { color: inherit; text-decoration: none; }

  .btn,
  .dl-card {
    box-shadow: none;
  }
}
