:root {
  --ink: #f7f5ef;
  --ink-muted: rgba(247, 245, 239, 0.68);
  --night: #091a16;
  --forest: #17473d;
  --teal: #2f6b5e;
  --gold: #dda956;
  --paper: #f4f0e7;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --heading: "Cairo", "Tajawal", system-ui, sans-serif;
  --body: "Tajawal", "Cairo", system-ui, sans-serif;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

/* One continuous cinematic background shared by all three chapters. */
.ambient {
  position: fixed;
  inset: -5%;
  z-index: -2;
  overflow: hidden;
  background: var(--night);
}

.ambient > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.78) contrast(1.08);
  animation: ambient-drift 24s ease-in-out infinite alternate;
}

.ambient__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 21, 18, 0.95), rgba(11, 38, 32, 0.72) 54%, rgba(5, 21, 18, 0.88)),
    linear-gradient(180deg, rgba(9, 26, 22, 0.3), rgba(9, 26, 22, 0.92));
  transition: background 1.2s ease;
}

.ambient__glow {
  position: absolute;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.16;
  animation: glow-float 14s ease-in-out infinite alternate;
}

.ambient__glow--one {
  inset: -15% auto auto 6%;
  background: #dca958;
}

.ambient__glow--two {
  inset: auto 5% -25% auto;
  background: #35a58d;
  animation-delay: -7s;
}

body[data-panel="discover"] .ambient__veil {
  background:
    linear-gradient(90deg, rgba(8, 31, 26, 0.96), rgba(22, 71, 61, 0.82), rgba(7, 27, 23, 0.94)),
    rgba(9, 26, 22, 0.45);
}

body[data-panel="download"] .ambient__veil {
  background:
    radial-gradient(circle at 72% 46%, rgba(221, 169, 86, 0.18), transparent 32%),
    linear-gradient(120deg, rgba(4, 18, 15, 0.97), rgba(18, 57, 48, 0.88));
}

/* Persistent navigation */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 56px);
  pointer-events: none;
}

.site-header a {
  pointer-events: auto;
}

.header-brand,
.header-actions {
  display: flex;
  align-items: center;
}

.header-brand {
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.header-brand img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.header-brand span {
  font-family: var(--heading);
  font-weight: 800;
  font-size: 0.98rem;
}

.header-actions {
  gap: 22px;
}

.header-count {
  color: rgba(255, 255, 255, 0.46);
  direction: ltr;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

.header-count b {
  color: var(--gold);
  font-size: 0.98rem;
}

.header-privacy {
  color: var(--ink-muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.25s ease;
}

.header-privacy:hover,
.header-privacy:focus-visible {
  color: var(--gold);
  outline: none;
}

.section-nav {
  position: fixed;
  z-index: 30;
  inset-inline-end: clamp(12px, 2.5vw, 34px);
  top: 50%;
  display: grid;
  gap: 16px;
  transform: translateY(-50%);
}

.section-nav__item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.72rem;
  text-decoration: none;
  transition: color 0.35s ease;
}

.section-nav__item span {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}

.section-nav__item i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
  transition: width 0.45s var(--ease), background 0.35s ease;
}

.section-nav__item:hover span,
.section-nav__item:focus-visible span,
.section-nav__item.is-active span {
  opacity: 1;
  transform: translateX(0);
}

.section-nav__item.is-active {
  color: var(--gold);
}

.section-nav__item.is-active i {
  width: 28px;
}

.section-nav__item:focus-visible {
  outline: none;
}

/* Three full-screen chapters */
.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

.panel__content {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding: 110px clamp(28px, 6vw, 76px) 68px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
}

/* Intro */
.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: center;
  gap: clamp(40px, 8vw, 110px);
}

.intro-copy {
  display: grid;
  justify-items: start;
  gap: 28px;
}

.intro-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.intro-brand > img {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
}

.intro-brand h1 {
  font-family: var(--heading);
  font-size: clamp(3.3rem, 7vw, 6.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.intro-lead {
  font-family: var(--heading);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
}

.intro-text {
  max-width: 35rem;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.85;
}

.intro-art {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.orbit--outer {
  inset: 4%;
  animation: orbit-spin 34s linear infinite;
}

.orbit--outer::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  top: 18%;
  right: 7%;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 24px var(--gold);
}

.orbit--inner {
  inset: 19%;
  border-style: dashed;
  opacity: 0.58;
  animation: orbit-spin 24s linear infinite reverse;
}

.orbit-core {
  position: relative;
  z-index: 2;
  width: min(48%, 248px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(221, 169, 86, 0.32);
  background:
    radial-gradient(circle at 40% 35%, rgba(221, 169, 86, 0.3), transparent 58%),
    rgba(7, 27, 23, 0.55);
  box-shadow: 0 0 60px rgba(221, 169, 86, 0.14);
  backdrop-filter: blur(10px);
}

.orbit-quote {
  position: relative;
  width: 72%;
  max-width: 9.5ch;
  height: 2.8em;
  overflow: hidden;
  text-align: center;
}

.orbit-quote span {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  padding-inline: 0.1em;
  font-family: var(--heading);
  font-size: clamp(0.98rem, 1.55vw, 1.22rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-40%) scale(0.92);
  filter: blur(4px);
  animation: quote-cycle 18s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.orbit-quote span:nth-child(1) { animation-delay: 0s; }
.orbit-quote span:nth-child(2) { animation-delay: 3s; }
.orbit-quote span:nth-child(3) { animation-delay: 6s; }
.orbit-quote span:nth-child(4) { animation-delay: 9s; }
.orbit-quote span:nth-child(5) { animation-delay: 12s; }
.orbit-quote span:nth-child(6) { animation-delay: 15s; }

.floating-label {
  position: absolute;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  background: rgba(7, 27, 23, 0.64);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  backdrop-filter: blur(14px);
}

.floating-label--top {
  top: 20%;
  inset-inline-start: -2%;
}

.floating-label--bottom {
  bottom: 15%;
  inset-inline-end: 0;
}

.scroll-cue {
  position: absolute;
  inset-inline-start: clamp(28px, 6vw, 76px);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  text-decoration: none;
}

.scroll-cue i {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  position: relative;
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 12px;
  width: 7px;
  height: 7px;
  border-inline-end: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  animation: cue-bounce 1.8s ease-in-out infinite;
}

/* Store buttons: both icons live in identical fixed boxes. */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-btn {
  min-width: 196px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--ink);
  text-decoration: none;
  backdrop-filter: blur(16px);
  transition: transform 0.3s var(--ease), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.store-btn:hover,
.store-btn:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(221, 169, 86, 0.6);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
  outline: none;
}

.store-btn.is-preferred {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.store-btn.is-dimmed {
  opacity: 0.68;
}

.store-btn__icon-shell {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
}

.store-btn__icon-shell img,
.store-btn__icon-shell svg {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.store-btn__text {
  display: grid;
  gap: 2px;
  line-height: 1.15;
  text-align: start;
  direction: ltr;
}

.store-btn__text small {
  font-size: 0.68rem;
  opacity: 0.68;
}

.store-btn__text strong {
  font-family: var(--heading);
  font-size: 1rem;
  white-space: nowrap;
}

/* Feature chapter */
.discover-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.76fr) minmax(0, 1.24fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
}

.section-heading {
  display: grid;
  gap: 19px;
}

.section-heading h2,
.download-copy h2 {
  font-family: var(--heading);
  font-size: clamp(2.8rem, 5.7vw, 5.8rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.section-heading__title,
.download-title {
  display: grid;
  gap: 0.28em;
}

.section-heading__title span,
.download-title span {
  display: block;
}

.download-title {
  gap: 0.72em;
  line-height: 1.28;
}

.section-heading > p,
.download-copy > p {
  max-width: 31rem;
  color: var(--ink-muted);
}

.feature-rail {
  display: grid;
}

.feature-item {
  position: relative;
  display: grid;
  grid-template-columns: 46px 56px 1fr;
  grid-template-areas:
    "num icon title"
    "num icon text";
  align-items: center;
  column-gap: 18px;
  padding: 24px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: padding 0.35s var(--ease), border-color 0.35s ease;
}

.feature-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.feature-item.is-highlighted {
  padding-inline: 18px;
  border-color: rgba(221, 169, 86, 0.55);
  background: linear-gradient(90deg, rgba(221, 169, 86, 0.08), transparent);
}

.feature-item.is-highlighted .feature-item__icon {
  border-color: var(--gold);
  background: rgba(221, 169, 86, 0.1);
}

.feature-item.is-highlighted .feature-item__number {
  color: var(--gold);
}

.feature-item:hover {
  padding-inline: 18px;
  border-color: rgba(221, 169, 86, 0.46);
}

.feature-item__number {
  grid-area: num;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.feature-item__icon {
  grid-area: icon;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: var(--gold);
}

.feature-item__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-item h3 {
  grid-area: title;
  font-family: var(--heading);
  font-size: 1.22rem;
}

.feature-item p {
  grid-area: text;
  color: var(--ink-muted);
  font-size: 0.91rem;
}

/* Download chapter */
.download-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(50px, 9vw, 130px);
}

.download-mark {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.download-core {
  position: relative;
  z-index: 2;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(221, 169, 86, 0.35);
  background:
    radial-gradient(circle at 40% 35%, rgba(221, 169, 86, 0.35), transparent 60%),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 70px rgba(221, 169, 86, 0.16);
}

.download-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(221, 169, 86, 0.24);
}

.download-ring--one {
  inset: 9%;
  animation: ring-pulse 4.5s ease-in-out infinite;
}

.download-ring--two {
  inset: 24%;
  border-color: rgba(255, 255, 255, 0.16);
  animation: ring-pulse 4.5s ease-in-out 0.8s infinite;
}

.download-copy {
  display: grid;
  justify-items: start;
  gap: 23px;
}

.store-btn--light {
  background: var(--paper);
  border-color: var(--paper);
  color: #142b25;
}

.store-btn--light:hover,
.store-btn--light:focus-visible {
  background: #fff;
  border-color: #fff;
}

.site-footer {
  position: absolute;
  inset-inline: clamp(28px, 6vw, 76px);
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.72rem;
}

.site-footer a {
  text-decoration: none;
  transition: color 0.25s ease;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--gold);
}

.header-privacy:focus-visible,
.section-nav__item:focus-visible,
.site-footer a:focus-visible,
.store-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Entrance and section transition system */
[data-motion] {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  transition:
    opacity 0.85s var(--ease),
    transform 0.85s var(--ease);
  transition-delay: calc(var(--motion-index, 0) * 90ms + 120ms);
  will-change: opacity, transform;
}

.panel.is-active [data-motion] {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.panel.is-leaving-up [data-motion] {
  opacity: 0;
  transform: translate3d(0, -24px, 0);
}

.panel.is-leaving-down [data-motion] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
}

@keyframes ambient-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(1.2%, -1.2%, 0); }
}

@keyframes glow-float {
  from { transform: translate3d(-3%, 0, 0) scale(0.92); }
  to { transform: translate3d(5%, 6%, 0) scale(1.08); }
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes cue-bounce {
  0%, 100% { transform: translateY(-2px) rotate(45deg); }
  50% { transform: translateY(4px) rotate(45deg); }
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(0.98); opacity: 0.55; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes quote-cycle {
  0%, 2% {
    opacity: 0;
    transform: translateY(-28%) scale(0.9);
    filter: blur(6px);
  }
  6%, 14% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    filter: blur(0);
  }
  17%, 100% {
    opacity: 0;
    transform: translateY(-72%) scale(1.04);
    filter: blur(5px);
  }
}

@media (max-width: 860px) {
  html {
    scroll-snap-type: y proximity;
  }

  .intro-layout,
  .discover-layout,
  .download-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .intro-art,
  .download-mark {
    display: none;
  }

  .panel__content {
    padding-inline: clamp(24px, 8vw, 64px);
  }

  .intro-copy,
  .download-copy {
    max-width: 620px;
  }

  .intro-brand h1 {
    font-size: clamp(3.2rem, 12vw, 5.8rem);
  }

  .section-heading h2,
  .download-copy h2 {
    font-size: clamp(2.6rem, 10vw, 4.8rem);
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 16px 18px;
  }

  .header-brand span,
  .header-count,
  .section-nav__item span {
    display: none;
  }

  .section-nav {
    inset-inline-end: 12px;
  }

  .section-nav__item.is-active i {
    width: 20px;
  }

  .panel {
    min-height: 100svh;
  }

  .panel__content {
    padding: 92px 24px 64px;
  }

  .intro-brand {
    gap: 15px;
  }

  .intro-brand > img {
    width: 64px;
    height: 64px;
    border-radius: 19px;
  }

  .intro-brand h1 {
    font-size: clamp(3rem, 15vw, 4.7rem);
  }

  .store-buttons {
    width: 100%;
  }

  .store-btn {
    min-width: 0;
    flex: 1 1 calc(50% - 6px);
    height: 62px;
    padding: 8px 10px;
    gap: 7px;
  }

  .store-btn__icon-shell {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .store-btn__icon-shell img,
  .store-btn__icon-shell svg {
    width: 34px;
    height: 34px;
  }

  .store-btn__text strong {
    font-size: 0.82rem;
  }

  .store-btn__text small {
    font-size: 0.58rem;
  }

  .feature-item {
    grid-template-columns: 28px 44px 1fr;
    column-gap: 11px;
    padding-block: 17px;
  }

  .feature-item__icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .feature-item p {
    font-size: 0.8rem;
  }

  .scroll-cue {
    display: none;
  }

  .site-footer {
    inset-inline: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
    scroll-snap-type: none;
  }

  .ambient > img,
  .ambient__glow,
  .orbit,
  .scroll-cue i::after,
  .download-ring,
  .orbit-quote span {
    animation: none !important;
  }

  .orbit-quote span:first-child {
    opacity: 1 !important;
    transform: none !important;
  }

  .orbit-quote span:not(:first-child) {
    display: none;
  }

  [data-motion] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
