:root {
  --qareeb-maroon: #8d123b;
  --qareeb-deep: #21030d;
  --qareeb-ink: #160208;
  --qareeb-plum: #4a061c;
  --rose: #df4c79;
  --soft-rose: #fae9ef;
  --champagne: #d9b66c;
  --amber: #f7a313;
  --ivory: #fffaf6;
  --paper: #fbf5f2;
  --smoke: #efe3e5;
  --charcoal: #2c2023;
  --muted: #77656b;
  --white: #ffffff;
  --green: #12b886;
  --shadow: 0 22px 65px rgba(67, 8, 28, 0.18);
  --shadow-soft: 0 12px 36px rgba(67, 8, 28, 0.12);
  --radius: 8px;
  --phone-radius: 30px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 246, 0.96), rgba(251, 245, 242, 0.96)),
    var(--paper);
  color: var(--qareeb-ink);
  font-family: "Cairo", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(141, 18, 59, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 18, 59, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  font-family: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

p,
h1,
h2,
h3,
figure {
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 42px;
  background: rgba(255, 250, 246, 0.88);
  border-bottom: 1px solid rgba(141, 18, 59, 0.12);
  box-shadow: 0 12px 30px rgba(33, 3, 13, 0.06);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-mark img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(33, 3, 13, 0.12);
}

.brand-mark span {
  display: grid;
  gap: 0;
}

.brand-mark strong {
  color: var(--qareeb-maroon);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.1;
}

.brand-mark small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.topnav a {
  min-width: 108px;
  padding: 9px 14px;
  color: var(--qareeb-plum);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  border: 1px solid rgba(141, 18, 59, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  transition: 180ms ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--white);
  background: var(--qareeb-maroon);
  outline: none;
}

.toolbar {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 4px;
  border: 1px solid rgba(141, 18, 59, 0.18);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(33, 3, 13, 0.08);
}

.lang-switch button {
  min-width: 54px;
  padding: 8px 10px;
  color: var(--qareeb-plum);
  font-size: 0.82rem;
  font-weight: 900;
  border-radius: 999px;
  background: transparent;
}

.lang-switch button.is-active {
  color: var(--white);
  background: var(--qareeb-maroon);
}

.pdf-button,
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--qareeb-maroon), #650722);
  box-shadow: 0 16px 32px rgba(141, 18, 59, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.pdf-button:hover,
.primary-link:hover,
.secondary-link:hover,
.pdf-button:focus-visible,
.primary-link:focus-visible,
.secondary-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(141, 18, 59, 0.28);
  outline: none;
}

.hero {
  position: relative;
  min-height: 82vh;
  padding: 76px 42px 30px;
  color: var(--white);
  isolation: isolate;
  overflow: hidden;
  background: var(--qareeb-deep);
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media {
  background-image: url("assets/screen-home.png");
  background-size: cover;
  background-position: center top;
  opacity: 0.28;
}

.hero-overlay {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(22, 2, 8, 0.92), rgba(73, 6, 28, 0.83) 44%, rgba(22, 2, 8, 0.72)),
    linear-gradient(180deg, rgba(141, 18, 59, 0.12), rgba(22, 2, 8, 0.88));
}

.hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 9px;
  background: linear-gradient(90deg, var(--champagne), var(--rose), var(--qareeb-maroon), var(--champagne));
  opacity: 0.9;
}

.hero-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 52px;
  align-items: center;
}

.hero-copy {
  max-width: 690px;
}

.hero-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  padding: 12px;
  margin-bottom: 28px;
  background: var(--white);
  border-radius: 26px;
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28);
}

.eyebrow,
.section-kicker {
  color: var(--champagne);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 16px;
  font-size: 4.9rem;
  font-weight: 900;
  line-height: 0.98;
}

.hero-subtitle {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.25rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.secondary-link {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.hero-showcase {
  position: relative;
  min-height: 610px;
}

.phone-frame {
  position: absolute;
  width: 272px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 233, 239, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--phone-radius);
  box-shadow: 0 36px 82px rgba(0, 0, 0, 0.36);
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 76px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(33, 3, 13, 0.2);
  z-index: 2;
}

.phone-frame img {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top center;
  border-radius: 24px;
}

.phone-main {
  inset-block-start: 0;
  inset-inline-end: 62px;
}

.phone-secondary {
  inset-block-start: 110px;
  inset-inline-start: 10px;
  width: 244px;
  transform: rotate(-5deg);
}

.hero-metrics {
  width: min(1180px, 100%);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.2);
}

.hero-metrics div {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-metrics strong {
  color: var(--champagne);
  font-size: 1.25rem;
  font-weight: 900;
}

.hero-metrics span {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0;
}

.section-intro {
  padding-bottom: 70px;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 60px;
  align-items: start;
}

.intro-grid h2,
.section-heading h2,
.pdf-panel h2 {
  color: var(--qareeb-deep);
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.18;
}

.intro-grid p,
.section-heading p,
.pdf-panel p,
.layer-card p,
.workflow-step p,
.system-node span {
  color: var(--muted);
  font-weight: 600;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.72fr);
  gap: 54px;
  align-items: end;
  margin-bottom: 34px;
}

.section-heading.compact {
  display: block;
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.layer-card,
.workflow-step,
.screen-card,
.pdf-panel {
  border: 1px solid rgba(141, 18, 59, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.layer-card {
  position: relative;
  min-height: 296px;
  padding: 26px;
  overflow: hidden;
}

.layer-card::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--qareeb-maroon), var(--rose), var(--champagne));
}

.layer-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 26px;
  color: var(--qareeb-maroon);
  font-weight: 900;
  border: 1px solid rgba(141, 18, 59, 0.18);
  border-radius: 999px;
  background: var(--soft-rose);
}

.layer-card h3,
.workflow-step h3 {
  margin-bottom: 10px;
  color: var(--qareeb-deep);
  font-size: 1.32rem;
  font-weight: 900;
  line-height: 1.24;
}

.system-section {
  width: 100%;
  max-width: none;
  padding: 92px max(24px, calc((100vw - 1180px) / 2));
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(33, 3, 13, 0.98), rgba(74, 6, 28, 0.98)),
    linear-gradient(90deg, transparent 49%, rgba(217, 182, 108, 0.16) 50%, transparent 51%);
}

.system-section .section-kicker,
.system-section h2 {
  color: var(--champagne);
}

.system-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: stretch;
}

.system-node {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 168px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.system-node::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -14px;
  width: 14px;
  height: 1px;
  background: rgba(217, 182, 108, 0.68);
}

.system-node:last-child::after {
  display: none;
}

.system-node strong {
  color: var(--white);
  font-size: 1.12rem;
  font-weight: 900;
}

.system-node span {
  color: rgba(255, 255, 255, 0.7);
}

.system-node.accent {
  background: linear-gradient(180deg, rgba(141, 18, 59, 0.72), rgba(74, 6, 28, 0.8));
  border-color: rgba(217, 182, 108, 0.42);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
}

.workflow-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.workflow-step {
  min-height: 252px;
  padding: 28px;
  background: var(--ivory);
}

.workflow-step span {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--champagne);
  font-size: 1.5rem;
  font-weight: 900;
}

.video-section {
  padding-top: 74px;
}

.video-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.video-frame,
.video-notes article {
  border: 1px solid rgba(141, 18, 59, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.video-frame {
  position: relative;
  overflow: hidden;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(250, 233, 239, 0.78)),
    var(--white);
}

.video-frame video,
.video-print-poster {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 6px;
  background: var(--qareeb-deep);
}

.video-print-poster {
  display: none;
}

.video-notes {
  display: grid;
  gap: 14px;
}

.video-notes article {
  display: grid;
  gap: 8px;
  padding: 22px;
}

.video-notes span {
  color: var(--champagne);
  font-weight: 900;
}

.video-notes strong {
  color: var(--qareeb-deep);
  font-size: 1.08rem;
  font-weight: 900;
}

.video-notes p {
  color: var(--muted);
  font-weight: 600;
}

.screens-section {
  padding-top: 74px;
}

.screens-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: start;
}

.legacy-screens {
  display: none;
}

.screen-card {
  overflow: hidden;
  background: var(--white);
}

.screen-card.tall {
  grid-row: span 2;
}

.screen-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  background: var(--qareeb-deep);
}

.screen-card figcaption {
  min-height: 72px;
  padding: 16px 18px 18px;
  color: var(--qareeb-plum);
  font-weight: 900;
  line-height: 1.35;
}

.pdf-section {
  padding-top: 48px;
}

.pdf-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 42px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(250, 233, 239, 0.82)),
    var(--white);
}

.pdf-panel p {
  max-width: 760px;
  margin-top: 14px;
}

.pdf-button.large {
  min-width: 190px;
  min-height: 54px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 34px 24px 48px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.footer img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}

html[dir="rtl"] body {
  text-align: right;
}

html[dir="rtl"] .topnav,
html[dir="rtl"] .toolbar,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .footer {
  direction: rtl;
}

html[dir="rtl"] .phone-secondary {
  transform: rotate(5deg);
}

html[dir="rtl"] .system-node::after {
  inset-inline-end: auto;
  inset-inline-start: -14px;
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 12px 22px;
  }

  .topnav {
    display: none;
  }

  .hero {
    padding: 54px 24px 28px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    min-height: 520px;
  }

  .phone-main {
    inset-inline-end: 18%;
  }

  .phone-secondary {
    inset-inline-start: 18%;
  }

  .section-heading,
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .architecture-grid,
  .workflow-timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .system-map {
    grid-template-columns: 1fr;
  }

  .system-node::after {
    display: none;
  }

  .screens-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .topbar {
    position: relative;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .brand-mark {
    min-width: 0;
  }

  .toolbar {
    justify-content: space-between;
  }

  .pdf-button {
    min-width: 132px;
    padding-inline: 14px;
  }

  .hero {
    min-height: auto;
  }

  .hero-logo {
    width: 92px;
    height: 92px;
  }

  .hero h1 {
    font-size: 3.2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-showcase {
    min-height: 440px;
    margin-top: 10px;
  }

  .phone-frame {
    width: 218px;
  }

  .phone-main {
    inset-inline-end: 0;
  }

  .phone-secondary {
    inset-block-start: 84px;
    inset-inline-start: 0;
    width: 200px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .section {
    width: min(100% - 32px, 1180px);
    padding: 66px 0;
  }

  .intro-grid h2,
  .section-heading h2,
  .pdf-panel h2 {
    font-size: 2rem;
  }

  .architecture-grid,
  .workflow-timeline,
  .screens-grid,
  .video-panel,
  .pdf-panel {
    grid-template-columns: 1fr;
  }

  .layer-card,
  .workflow-step {
    min-height: auto;
  }

  .screen-card.tall {
    grid-row: auto;
  }

  .screen-card img {
    max-height: none;
  }
}

@media print {
  @page {
    size: A4;
    margin: 11mm;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body {
    background: var(--white);
    color: var(--qareeb-ink);
    font-size: 10.5pt;
    line-height: 1.45;
  }

  body::before,
  .topbar,
  .print-hidden,
  .hero-actions,
  .pdf-button {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 20mm 10mm 10mm;
    break-inside: avoid;
  }

  .hero-inner {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 18px;
    align-items: center;
  }

  .hero-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 12px;
    border-radius: 12px;
  }

  .hero h1 {
    font-size: 40pt;
  }

  .hero-subtitle {
    font-size: 11pt;
  }

  .hero-showcase {
    min-height: 270px;
  }

  .phone-frame {
    width: 118px;
    padding: 4px;
    border-radius: 16px;
    box-shadow: none;
  }

  .phone-frame::before {
    display: none;
  }

  .phone-frame img {
    border-radius: 13px;
  }

  .phone-main {
    inset-inline-end: 16mm;
  }

  .phone-secondary {
    inset-block-start: 48px;
    inset-inline-start: 8mm;
    width: 108px;
  }

  .hero-metrics {
    margin-top: 12px;
    grid-template-columns: repeat(3, 1fr);
    box-shadow: none;
  }

  .hero-metrics div {
    min-height: auto;
    padding: 10px;
  }

  .hero-metrics strong {
    font-size: 11pt;
  }

  .hero-metrics span {
    font-size: 8.8pt;
  }

  .section,
  .system-section {
    width: 100%;
    padding: 10mm 0;
    break-inside: auto;
  }

  .section-heading,
  .intro-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  .intro-grid h2,
  .section-heading h2,
  .pdf-panel h2 {
    font-size: 18pt;
  }

  .section-kicker,
  .eyebrow {
    font-size: 8pt;
  }

  .architecture-grid,
  .workflow-timeline,
  .screens-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .layer-card,
  .workflow-step,
  .screen-card,
  .pdf-panel,
  .system-node {
    box-shadow: none;
    break-inside: avoid;
  }

  .layer-card {
    min-height: 0;
    padding: 12px;
  }

  .layer-number {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    font-size: 8pt;
  }

  .layer-card h3,
  .workflow-step h3 {
    font-size: 11pt;
    margin-bottom: 5px;
  }

  .layer-card p,
  .workflow-step p,
  .section-heading p,
  .intro-grid p,
  .pdf-panel p {
    font-size: 8.5pt;
  }

  .system-section {
    padding: 10mm;
  }

  .system-map {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }

  .system-node {
    min-height: 0;
    padding: 10px;
  }

  .system-node::after {
    display: none;
  }

  .workflow-step {
    min-height: 0;
    padding: 12px;
  }

  .workflow-step span {
    margin-bottom: 7px;
    font-size: 12pt;
  }

  .video-section {
    break-before: page;
  }

  .video-panel {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 8px;
  }

  .video-frame,
  .video-notes article {
    box-shadow: none;
    break-inside: avoid;
  }

  .video-frame {
    padding: 6px;
  }

  .video-frame video {
    display: none;
  }

  .video-print-poster {
    display: block;
  }

  .video-notes {
    gap: 6px;
  }

  .video-notes article {
    padding: 9px;
  }

  .video-notes strong {
    font-size: 9.5pt;
  }

  .video-notes p {
    font-size: 8pt;
  }

  .screens-grid {
    display: block;
    column-count: 4;
    column-gap: 7px;
    align-items: start;
  }

  .screens-grid .screen-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 7px;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
  }

  .screen-card img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }

  .screens-section {
    break-before: page;
    break-inside: auto;
  }

  .screens-section .section-heading {
    break-after: avoid;
  }

  .all-screens {
    break-inside: auto;
    page-break-inside: auto;
  }

  .screen-card figcaption {
    min-height: 0;
    padding: 8px;
    font-size: 8.5pt;
  }

  .pdf-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }


  .footer {
    padding: 12px 0 0;
  }
}
