/*
 * Abraj landing page. Plain CSS, no build step.
 * Colours and fonts come from app/src/theme/tokens.json. Layout uses logical properties, so RTL needs no overrides.
 */

@font-face {
  font-family: "Abraj Display";
  src: url("fonts/display-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Abraj Body";
  src: url("fonts/body-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Abraj Body";
  src: url("fonts/body-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg-deep: #0a0e2a;
  --bg-base: #10153a;
  --bg-elevated: #181e4a;
  --surface-dark: #171c47;
  --surface-dark-alt: #221f52;
  --surface-light: #fbf6ef;
  --surface-light-alt: #f7ecea;

  --on-dark: #fbf7f0;
  --on-dark-2: #cfcbe6;
  --on-dark-3: #a6a2c8;
  --on-light: #1a1d45;
  --on-light-2: #45436b;

  --gold-300: #f2ddb0;
  --gold-400: #e4bf7c;
  --gold-500: #d2a35a;
  --gold-from: #f3d9a4;
  --gold-to: #d09f55;
  --blush-100: #fce8ef;
  --blush-200: #f5c9d9;
  --blush-300: #e9a3bf;

  --line-dark: #ffffff1f;
  --line-light: #1a1d451a;

  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;

  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(56px, 10vw, 112px);

  --font-display: "Abraj Display", "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Abraj Body", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

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

html {
  background: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--on-dark);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.8;
  background:
    url("assets/stars.svg") top center / 640px 640px repeat,
    radial-gradient(120% 620px at 50% 560px, #2a245e8c, transparent 72%) no-repeat,
    linear-gradient(180deg, var(--bg-deep), var(--bg-base) 38%, var(--bg-deep));
}

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

ul {
  padding: 0;
  list-style: none;
}

h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.35;
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 2vw, 2.75rem);
}

h3 {
  font-size: clamp(1.625rem, 1.4rem + 1vw, 2rem);
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold-300);
  outline-offset: 3px;
  border-radius: 6px;
}

.latin {
  unicode-bidi: isolate;
}

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

.section {
  padding-block-start: var(--section);
}

.section-head {
  max-width: 40rem;
  margin-block-end: clamp(24px, 4vw, 40px);
}

.section-head p {
  margin-block-start: 8px;
  color: var(--on-dark-2);
}

/* Shared gold wordmark, same treatment as the app header. */
.wordmark {
  display: block;
  padding-block: 0.1em 0.2em;
  color: var(--gold-400);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--gold-from), var(--gold-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block-start: clamp(28px, 7vw, 72px);
  overflow: clip;
  text-align: center;
}

.hero-grid {
  display: grid;
  gap: clamp(28px, 6vw, 56px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(4.75rem, 3rem + 11vw, 8.5rem);
}

.promise {
  margin-block-start: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.2rem + 2.6vw, 3rem);
  font-weight: 700;
  line-height: 1.4;
}

.promise span {
  display: inline-block;
  margin-inline: 0.12em;
}

.promise .p-sign {
  color: var(--gold-300);
}

.promise .p-cup {
  color: var(--on-dark);
}

.promise .p-ties {
  color: var(--blush-200);
}

.lede {
  max-width: 34rem;
  margin: 16px auto 0;
  color: var(--on-dark-2);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-block-start: 20px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.chips li {
  padding: 6px 14px;
  color: var(--on-dark-2);
  background: #171c47b3;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
}

.sky {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 460px);
  margin-inline: auto;
  padding-block-start: 28px;
}

.sky-wheel {
  position: absolute;
  inset-block-start: -6px;
  left: 50%;
  width: min(136%, 620px);
  aspect-ratio: 1;
  opacity: 0.3;
  transform: translateX(-50%);
  pointer-events: none;
}

.sky-wheel svg {
  display: block;
  width: 100%;
  height: 100%;
  animation: turn 280s linear infinite;
}

.sky-moon {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 2%;
  width: clamp(44px, 13vw, 72px);
  height: clamp(44px, 13vw, 72px);
}

.twinkle {
  position: absolute;
  color: var(--gold-300);
  animation: twinkle 5s ease-in-out infinite;
}

.twinkle.t1 {
  inset-block-start: 22%;
  inset-inline-start: 3%;
  width: 22px;
  height: 22px;
}

.twinkle.t2 {
  inset-block-start: 46%;
  inset-inline-end: 1%;
  width: 16px;
  height: 16px;
  animation-delay: -1.8s;
}

.twinkle.t3 {
  inset-block-start: 66%;
  inset-inline-start: 6%;
  width: 12px;
  height: 12px;
  animation-delay: -3.2s;
}

@keyframes turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.72);
  }
}

/* ---------- Phone frame around real screenshots ---------- */

.phone {
  position: relative;
  width: 100%;
  aspect-ratio: 720 / 1515;
  padding: 7px;
  background: linear-gradient(160deg, #2c2966, var(--bg-deep) 45%, #2c2966);
  border: 1px solid #e4bf7c66;
  border-radius: 38px;
  box-shadow:
    0 28px 56px -18px #03051ae6,
    0 0 44px -12px #d2a35a59;
}

.phone img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  color: var(--on-dark-2);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
  background: var(--bg-base);
  border-radius: 31px;
}

/*
 * A screenshot file that is missing: Chromium renders ::before and ::after on a broken image,
 * so the frame shows a calm moon and a short label instead of the broken-image icon.
 * Browsers that do not fall back to the alt text on the same navy surface.
 */
.phone img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-base) url("assets/moon.svg") center 38% / 34% no-repeat;
  border-radius: inherit;
}

.phone img::after {
  content: attr(data-missing);
  position: absolute;
  inset-inline: 16px;
  inset-block-start: 58%;
  color: var(--on-dark-2);
}

.hero-phone {
  position: relative;
  width: min(74%, 300px);
  max-height: 520px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent);
  mask-image: linear-gradient(180deg, #000 78%, transparent);
}

.hero-phone .phone {
  box-shadow: none;
}

/* ---------- Three pillars ---------- */

.pillars {
  display: grid;
  gap: 16px;
}

.pillar {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 5vw, 28px);
  border-radius: var(--r-xl);
}

.pillar p {
  margin-block-start: 8px;
}

.pillar-sign {
  color: var(--on-dark-2);
  background: var(--surface-dark);
  border: 1px solid var(--line-dark);
}

.pillar-sign h3 {
  color: var(--gold-400);
}

.pillar-cup {
  color: var(--on-light-2);
  background: var(--surface-light);
}

.pillar-ties {
  color: var(--on-light-2);
  background: var(--blush-200);
}

.pillar-cup h3,
.pillar-ties h3 {
  color: var(--on-light);
}

/* Arched window: the towers in «أبراج», holding the app's own illustrations. */
.arch {
  display: block;
  align-self: center;
  position: relative;
  width: min(62%, 248px);
  aspect-ratio: 248 / 236;
  margin-block-end: 16px;
  background:
    url("assets/stars.svg") center / 320px 320px,
    linear-gradient(180deg, var(--surface-dark-alt), var(--bg-deep));
  border: 1px solid #e4bf7c80;
  border-radius: 999px 999px var(--r-lg) var(--r-lg);
}

.arch svg {
  position: absolute;
  inset: 14% 7% 6%;
  width: 86%;
  height: 80%;
}

/* ---------- Coffee photo note ---------- */

.note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  align-items: start;
  margin-block-start: 16px;
  padding: clamp(18px, 4vw, 24px);
  color: var(--on-light-2);
  font-size: 0.9375rem;
  line-height: 1.8;
  background: var(--surface-light-alt);
  border-radius: var(--r-lg);
}

.note svg {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  margin-block-start: 2px;
  color: var(--on-light);
}

.note strong {
  color: var(--on-light);
  font-size: 1rem;
}

/* ---------- Screenshots ---------- */

.shots {
  display: flex;
  gap: 16px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 8px var(--gutter) 24px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-500) transparent;
}

.shots:focus-visible {
  outline-offset: -3px;
}

.shot {
  flex: 0 0 min(68vw, 260px);
  scroll-snap-align: start;
}

.shot figcaption {
  margin-block-start: 14px;
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.shots-note {
  color: var(--on-dark-3);
  font-size: 0.875rem;
}

/* ---------- بصمتك ---------- */

.print {
  position: relative;
  display: grid;
  gap: clamp(24px, 5vw, 48px);
  padding: clamp(24px, 6vw, 56px);
  overflow: clip;
  background: linear-gradient(150deg, var(--surface-dark-alt), var(--surface-dark) 60%);
  border: 1px solid #e4bf7c4d;
  border-radius: var(--r-xl);
}

.print-wheel {
  position: absolute;
  inset-block-end: -32%;
  inset-inline-start: -14%;
  width: min(92%, 520px);
  aspect-ratio: 1;
  opacity: 0.12;
  pointer-events: none;
}

.print-wheel svg {
  display: block;
  width: 100%;
  height: 100%;
}

.print-copy {
  position: relative;
}

.print h2 {
  color: var(--gold-400);
}

.print-copy p {
  margin-block-start: 10px;
  color: var(--on-dark-2);
}

.trio {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-self: center;
  text-align: center;
}

.trio li {
  display: grid;
  justify-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 0.9rem + 1vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
}

.orb {
  display: grid;
  place-items: center;
  width: clamp(68px, 20vw, 112px);
  aspect-ratio: 1;
  color: var(--gold-300);
  background: radial-gradient(circle, #e4bf7c2e, transparent 70%);
  border: 1px solid #e4bf7c80;
  border-radius: 50%;
}

.orb svg {
  width: 46%;
  height: 46%;
}

/* ---------- Sharing and Plus ---------- */

.duo {
  display: grid;
  gap: 16px;
}

.panel {
  padding: clamp(24px, 5vw, 40px);
  border-radius: var(--r-xl);
}

.panel h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
}

.panel p {
  margin-block-start: 10px;
}

.panel-share {
  color: var(--on-light-2);
  background: var(--surface-light);
}

.panel-share h2 {
  color: var(--on-light);
}

.panel-plus {
  color: var(--on-dark-2);
  background: var(--surface-dark);
  border: 1px solid var(--line-dark);
}

.panel-plus h2 {
  color: var(--gold-400);
}

.panel-plus .crown {
  display: block;
  width: 64px;
  height: 64px;
  margin-block-end: 12px;
}

/* An illustration of the two card shapes. It is art, and it is not a capture of a share card. */
.cards-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin-block-end: 24px;
}

.mini-card {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: var(--r-md);
  box-shadow: 0 18px 30px -14px #1a1d4599;
}

/* Thin inner frame, as on the app's share cards. */
.mini-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #d2a35a80;
  border-radius: 10px;
}

.mini-card svg {
  width: 52%;
  height: auto;
  aspect-ratio: 1;
}

.mini-card .wordmark {
  font-size: 1.375rem;
}

.mini-story {
  width: min(40%, 140px);
  aspect-ratio: 9 / 16;
  background:
    url("assets/stars.svg") center / 320px 320px,
    linear-gradient(180deg, var(--surface-dark-alt), var(--bg-deep));
}

.mini-square {
  width: min(34%, 120px);
  aspect-ratio: 1;
  background: var(--surface-light-alt);
}

.mini-square .wordmark {
  color: var(--on-light);
  background: none;
  -webkit-text-fill-color: currentColor;
}

/* ---------- Disclaimer, Play button, footer ---------- */

.disclaimer {
  max-width: 44rem;
  margin-inline: auto;
  color: var(--on-dark-2);
  text-align: center;
}

.disclaimer svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 10px;
  color: var(--gold-400);
}

/*
 * The one Play button. It sits once in the document, and position: sticky keeps it in reach
 * from the first screen until it settles above the footer. No JavaScript.
 */
.dock {
  position: sticky;
  inset-block-end: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  justify-content: center;
  margin-block-start: clamp(32px, 6vw, 56px);
  padding-inline: var(--gutter);
  pointer-events: none;
}

.cta {
  display: inline-flex;
  flex: 0 1 26rem;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 24px;
  color: var(--on-light);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, var(--gold-from), var(--gold-to));
  border-radius: 999px;
  box-shadow:
    0 12px 28px -6px #03051ae6,
    0 0 26px -4px #d2a35a99;
  pointer-events: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px -6px #03051ae6,
    0 0 34px -2px #d2a35ab3;
}

.cta:active {
  transform: translateY(0);
}

.cta:focus-visible {
  outline: 3px solid var(--on-dark);
  outline-offset: 3px;
  border-radius: 999px;
}

.cta svg {
  flex: none;
  width: 22px;
  height: 22px;
}

/* A label until the Play listing is public: it must not look like a button. Remove with the label (README.md). */
.cta-soon,
.cta-soon:hover {
  margin: 0;
  color: var(--on-dark);
  background: #171c47;
  border: 1px solid #e4bf7c66;
  box-shadow: 0 12px 28px -6px #03051ae6;
  transform: none;
}

.foot {
  margin-block-start: clamp(24px, 5vw, 40px);
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
  border-block-start: 1px solid var(--line-dark);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.foot .wordmark {
  font-size: 1.875rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-inline-start: -12px;
}

.foot-links a {
  display: inline-block;
  padding: 10px 12px;
  color: var(--on-dark);
  text-underline-offset: 5px;
  text-decoration-color: #e4bf7c99;
}

.foot-links a:hover {
  color: var(--gold-300);
}

.foot-domain {
  color: var(--on-dark-3);
  font-size: 0.9375rem;
}

/* ---------- Wider screens ---------- */

@media (min-width: 720px) {
  .pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .arch {
    width: min(100%, 248px);
    margin-block-end: 20px;
  }

  .print {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
  }

  .duo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .shots {
    justify-content: safe center;
  }

  .shot {
    flex-basis: 240px;
  }
}

@media (min-width: 960px) {
  .hero {
    text-align: start;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }

  .lede {
    margin-inline: 0;
  }

  .promise span:first-child {
    margin-inline-start: 0;
  }

  .chips {
    justify-content: flex-start;
  }

  .hero-phone {
    width: min(70%, 320px);
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero-phone .phone {
    box-shadow:
      0 28px 56px -18px #03051ae6,
      0 0 44px -12px #d2a35a59;
  }

  .shot {
    flex-basis: 260px;
  }

  .cta {
    flex-basis: 24rem;
  }
}

/* ---------- User preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .sky-wheel svg,
  .twinkle {
    animation: none;
  }

  .cta {
    transition: none;
  }

  .cta:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .wordmark {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }

  .cta {
    border: 2px solid LinkText;
  }
}
