:root {
  --ink: #12232e;
  --deep: #1c3442;
  --cream: #f6f2ea;
  --sand: #e3b27a;
  --copper: #9c5a22;
  --soft: #c8d3d8;
  --line: rgba(227, 178, 122, 0.28);
  --head: 'Alexandria', Tahoma, sans-serif;
  --body: 'Almarai', Tahoma, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* The sky and the land, behind everything */
.sky { position: fixed; inset: 0; background: var(--ink); }
.sun {
  position: fixed; width: 60vmax; height: 60vmax; left: 0; top: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 178, 122, 0.3), rgba(156, 90, 34, 0.1) 40%, transparent 68%);
  will-change: transform;
}
.dunes { position: fixed; left: -12vw; right: -12vw; bottom: 0; height: 34vh; pointer-events: none; will-change: transform; }
.dunes svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#sand { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

/* Slides */
#deck { position: fixed; inset: 0; z-index: 3; }
.slide {
  position: absolute; inset: 0; display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px); align-items: center;
  padding: clamp(72px, 9vh, 110px) clamp(72px, 8vw, 150px) clamp(84px, 11vh, 120px);
  perspective: 1400px;
}
.slide.active { display: grid; }
.copy { display: flex; flex-direction: column; gap: clamp(14px, 2.4vh, 26px); max-width: 680px; z-index: 2; }
.eyebrow { font-weight: 700; font-size: clamp(16px, 1.5vw, 22px); color: var(--sand); }
h1, h2 { font-family: var(--head); font-weight: 800; line-height: 1.32; letter-spacing: 0; }
h1 { font-size: clamp(38px, 5.2vw, 84px); }
h2 { font-size: clamp(32px, 4.1vw, 68px); }
.lead { font-size: clamp(18px, 1.7vw, 26px); line-height: 1.7; color: var(--soft); }
.w { display: inline-block; will-change: transform, opacity; }
.points { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.points li {
  font-size: clamp(17px, 1.5vw, 23px); line-height: 1.5; padding-inline-start: 26px; position: relative;
}
.points li::before {
  content: ''; position: absolute; inset-inline-start: 0; top: .55em; width: 11px; height: 11px;
  background: var(--sand); transform: rotate(45deg);
}
.stage { position: relative; height: min(68vh, 620px); display: flex; align-items: center; justify-content: center; transform-style: preserve-3d; }
.mock { will-change: transform, opacity; }

/* 0: hero */
.hero-word { position: relative; height: clamp(90px, 15vh, 170px); }
.arch {
  overflow: hidden; border-radius: 999px 999px 0 0; border: 2px solid var(--sand);
  box-shadow: 0 0 0 14px rgba(227, 178, 122, .08), 0 0 0 30px rgba(227, 178, 122, .05);
}
.arch img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stage .arch { width: min(62%, 420px); height: 100%; }

/* 1: phone */
.phone {
  width: min(300px, 44vh); height: 100%; max-height: 620px; padding: 14px; border-radius: 42px; background: var(--ink);
  border: 2px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 10px;
}
.phone img { width: 100%; height: 22%; object-fit: cover; border-radius: 28px; }
.phone .name { text-align: center; font-family: var(--head); font-weight: 700; color: var(--sand); font-size: 20px; }
.tiles { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; }
.tile { display: flex; align-items: center; justify-content: center; text-align: center; background: var(--deep); border-radius: 16px; font-weight: 700; font-size: 16px; }
.tile.hot { background: var(--copper); }

/* 2: invoice */
.invoice {
  position: relative; width: min(380px, 92%); padding: 34px 32px; background: var(--cream); color: var(--ink); border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: 16px; overflow: visible;
}
.invoice h3 { font-family: var(--head); font-size: 26px; }
.row { display: flex; justify-content: space-between; gap: 20px; font-size: 19px; padding-bottom: 12px; border-bottom: 1px dashed #c8bda9; }
.row b { color: var(--copper); }
.stamp {
  position: absolute; inset-inline-start: 26px; bottom: 26px; padding: 8px 20px; font-family: var(--head); font-weight: 800; font-size: 28px;
  color: #1f7a54; border: 4px solid #1f7a54; border-radius: 10px; transform: rotate(-12deg); background: rgba(246, 242, 234, .85);
}
.pay { position: absolute; padding: 12px 20px; border-radius: 12px; background: var(--deep); border: 1px solid var(--line); font-weight: 700; font-size: 18px; white-space: nowrap; }

/* 3: gate */
.door { position: absolute; top: 0; bottom: 0; width: 50.5%; z-index: 6; background: linear-gradient(180deg, #2a2118, #17222a); border: 0 solid var(--sand); display: flex; align-items: center; justify-content: center; }
.door.r { right: 0; border-left-width: 2px; }
.door.l { left: 0; border-right-width: 2px; }
.door span { font-family: var(--head); font-size: clamp(30px, 5vw, 76px); font-weight: 800; color: var(--sand); }
.pass {
  width: min(330px, 92%); padding: 24px; background: var(--deep); border-radius: 24px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; align-items: center; box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}
.code { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; width: 216px; height: 216px; padding: 14px; background: var(--cream); border-radius: 14px; }
.code i { background: var(--ink); border-radius: 2px; }
.pass p { font-weight: 700; font-size: 19px; text-align: center; }
.pass small { font-size: 16px; color: var(--sand); }

/* 4: path */
.path { position: relative; width: min(460px, 100%); height: 100%; }
.path svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.node {
  position: absolute; inset-inline-start: 0; display: flex; align-items: center; gap: 16px; width: 100%;
  font-size: clamp(16px, 1.45vw, 21px); font-weight: 700; line-height: 1.4;
}
.node b {
  flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--ink);
  font-family: var(--head); font-size: 24px;
}

/* 5: services */
.svc { position: absolute; bottom: 2%; left: 50%; width: min(420px, 100%); text-align: center; transform: translateX(-50%); padding: 14px 20px; border-radius: 16px; background: rgba(18, 35, 46, .82); border: 1px solid var(--line); }
.svc h3 { font-family: var(--head); font-size: clamp(22px, 2.2vw, 32px); color: var(--sand); }
.svc p { font-size: clamp(16px, 1.3vw, 19px); color: var(--soft); margin-top: 4px; }
.sand-spot { position: absolute; left: 50%; top: 40%; width: 76%; height: 74%; transform: translate(-50%, -50%); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: clamp(14px, 1.15vw, 17px); font-weight: 700; color: var(--soft); transition: background .3s, color .3s; }
.chip.on { background: var(--sand); color: var(--ink); }

/* 6: notifications */
.toasts { width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; }
.toast { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--cream); color: var(--ink); border-radius: 18px; font-weight: 700; font-size: clamp(16px, 1.4vw, 20px); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.toast i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--copper); }

/* 7: dashboard */
.board { width: 100%; max-width: 640px; padding: 16px; background: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 40px 90px rgba(0, 0, 0, .55); transform-style: preserve-3d; }
.board header { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 14px; font-family: var(--head); font-weight: 700; color: var(--sand); font-size: 19px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.panel { min-height: clamp(70px, 12vh, 112px); display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; background: var(--deep); border-radius: 12px; font-size: clamp(14px, 1.2vw, 18px); font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: clamp(70px, 13vh, 120px); padding-top: 12px; }
.bars i { flex: 1; height: 100%; background: linear-gradient(180deg, var(--sand), var(--copper)); border-radius: 6px 6px 0 0; transform-origin: bottom; }

/* 8: security */
.seal { position: absolute; font-weight: 700; font-size: clamp(14px, 1.2vw, 18px); padding: 10px 16px; border-radius: 999px; background: var(--deep); border: 1px solid var(--sand); white-space: nowrap; }

/* 9: stages */
.stage-card { position: absolute; bottom: 0; left: 50%; width: min(460px, 100%); transform: translateX(-50%); text-align: center; }
.stage-card h3 { font-family: var(--head); font-size: clamp(28px, 3vw, 46px); color: var(--sand); }
.stage-card p { font-size: clamp(17px, 1.5vw, 22px); line-height: 1.5; color: var(--soft); margin-top: 6px; }

/* 10: end */
.again { align-self: flex-start; padding: 14px 28px; background: var(--sand); color: var(--ink); font-weight: 700; font-size: 18px; border-radius: 999px; }
.again:focus-visible, .ctl:focus-visible, .dots button:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

/* The controls */
.hud { position: fixed; z-index: 6; inset-inline-end: 24px; top: 50%; transform: translateY(-50%); }
.dots { display: flex; flex-direction: column; gap: 10px; }
.dots button { width: 24px; height: 24px; display: grid; place-items: center; }
.dots button::after { content: ''; width: 9px; height: 9px; background: var(--sand); opacity: .35; transform: rotate(45deg); transition: .3s; }
.dots button.on::after { opacity: 1; transform: rotate(45deg) scale(1.7); }
.foot { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 3vw, 32px); }
.bar { flex: 1; height: 3px; background: rgba(227, 178, 122, .2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sand); transform-origin: right; transform: scaleX(0); }
.count { font-family: var(--head); font-size: 16px; color: var(--cream); min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; }
.ctl { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); background: var(--sand); font-size: 22px; font-weight: 700; }

.curtain { position: fixed; inset: 0; z-index: 9; background: var(--ink); pointer-events: none; }

@media (max-width: 860px) {
  .slide {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: start;
    gap: 14px; padding: 24px 18px 76px;
  }
  .copy { gap: 8px; max-width: none; }
  h1 { font-size: 32px; }
  h2 { font-size: 27px; }
  .lead { font-size: 16px; line-height: 1.55; }
  .points { gap: 6px; }
  .points li { font-size: 15px; }
  .stage { height: 100%; min-height: 0; }
  .hud { display: none; }
  .hero-word { height: 74px; }
  .phone { width: min(210px, 56vw); border-radius: 30px; padding: 9px; gap: 5px; }
  .phone img { border-radius: 20px; }
  .phone .name { font-size: 15px; }
  .tile { font-size: 13px; border-radius: 10px; }
  .invoice { padding: 18px; gap: 8px; }
  .invoice h3 { font-size: 20px; }
  .row { font-size: 15px; padding-bottom: 7px; }
  .stamp { font-size: 20px; bottom: 12px; inset-inline-start: 12px; }
  .pay { font-size: 14px; padding: 8px 12px; }
  .code { width: 140px; height: 140px; padding: 9px; gap: 3px; }
  .pass { padding: 14px; gap: 8px; }
  .pass p { font-size: 15px; }
  .node b { width: 40px; height: 40px; font-size: 18px; }
  .node { gap: 10px; font-size: 15px; }
  .chip { font-size: 12px; padding: 5px 9px; }
  .chips { gap: 5px; }
  .toast { padding: 10px 12px; font-size: 14px; }
  .toasts { gap: 8px; }
  .panel { font-size: 12px; min-height: 48px; padding: 6px; }
  .board { padding: 10px; }
  .board header { font-size: 15px; padding: 2px 4px 8px; }
  .grid { gap: 6px; }
  .seal { font-size: 12px; padding: 6px 10px; }
  .svc { padding: 8px 10px; }
  .dunes { height: 22vh; }
}

@media (prefers-reduced-motion: reduce) {
  #sand { display: none; }
}

/* The phone mockup: only the logo on its screen */
.phone { position: relative; width: auto; height: 100%; max-height: 620px; aspect-ratio: 9 / 19.5; flex: none; padding: 0; gap: 0; align-items: center; justify-content: center; border-radius: 15% / 7%; background: radial-gradient(circle at 50% 44%, #24414f, var(--ink) 72%); border: 9px solid #0b161d; box-shadow: 0 0 0 2px var(--line), 0 30px 80px rgba(0, 0, 0, .5); }
.phone::after { content: ''; position: absolute; top: 20%; right: -13px; width: 4px; height: 12%; border-radius: 2px; background: #2a3a44; }
.phone .notch { position: absolute; top: 2%; left: 50%; width: 30%; height: 3.6%; transform: translateX(-50%); border-radius: 999px; background: #0b161d; }
.phone img.screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 13% / 6%; }
.phone .notch { display: none; }
@media (max-width: 860px) {
  .phone { width: auto; padding: 0; border-width: 6px; border-radius: 15% / 7%; }
  .phone::after { right: -10px; width: 3px; }
}

/* The WhatsApp button on the last slide */
a.again { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }

/* Phones: one calm column, nothing floating over anything else */
@media (max-width: 860px) {
  .slide { padding: max(20px, env(safe-area-inset-top)) 20px calc(72px + env(safe-area-inset-bottom)); gap: 12px; }
  .eyebrow { font-size: 14px; }
  h1 { font-size: 30px; line-height: 1.3; }
  h2 { font-size: 25px; line-height: 1.3; }
  .lead { font-size: 15px; }
  .logo { top: 14px; height: 30px; }
  .foot { gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .ctl { width: 40px; height: 40px; font-size: 18px; }
  .count { min-width: 48px; font-size: 14px; }
  .stage .arch { width: min(70%, 240px); height: 100%; max-height: 420px; }

  .slide[aria-label="الفواتير والدفع"] .stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
  .slide[aria-label="الفواتير والدفع"] .phone { grid-column: 1 / -1; justify-self: center; }
  .pay { position: static; text-align: center; padding: 10px 4px; font-size: 13px; white-space: normal; }

  .slide[aria-label="الأمان"] .stage { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-end; gap: 6px; }
  .slide[aria-label="الأمان"] .sand-spot { top: 36% !important; height: 62% !important; width: 80% !important; }
  .seal { position: static; }

  .sand-spot { top: 38%; height: 64%; width: 90%; }
  .svc, .stage-card { bottom: 0; }
  .again { align-self: stretch; justify-content: center; }
}

.logo { position: fixed; z-index: 6; top: 18px; inset-inline-start: clamp(16px, 3vw, 32px); height: clamp(34px, 5vh, 52px); width: auto; }
