/* The Grid — landing site.
   Built from the app's own vocabulary: white ground, black ink, flat team-colour
   blocks and a condensed display face. No frameworks, no build step. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/BigShouldersDisplay-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/BigShouldersDisplay-ExtraBold.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Alexandria";
  src: url("fonts/Alexandria-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Alexandria";
  src: url("fonts/Alexandria-ExtraBold.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  --ground: #ffffff;
  --ink: #0e0e10;
  --muted: #5b5f66;
  --surface: #f4f4f6;
  --rule: #e3e4e7;
  --light: #e5330f;          /* start-light red, the app's accent */
  /* The colour slabs follow the team picked on the page */
  --team: #e5330f;
  --team-ink: #ffffff;

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: min(1120px, 100% - 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.on-dark a:focus-visible, .on-dark button:focus-visible { outline-color: #fff; }
p { margin: 0 0 1rem; max-width: 34rem; }
.wrap { width: var(--page); margin-inline: auto; }

/* Display type: condensed capitals in Latin, heavy Alexandria in Arabic */
h1, h2, .display {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: 0;
  margin: 0;
}
h1 { font-size: clamp(3.75rem, 13vw, 10rem); }
h2 { font-size: clamp(2.75rem, 7vw, 5.25rem); margin-bottom: 1.25rem; }
h3 { font: 700 1.125rem/1.3 var(--body); margin: 1.75rem 0 0.25rem; }

html[lang="ar"] { --display: "Alexandria", "Geeza Pro", Tahoma, sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] .display {
  text-transform: none;
  line-height: 1.12;
}
html[lang="ar"] h1 { font-size: clamp(2.75rem, 9vw, 6.5rem); }
html[lang="ar"] h2 { font-size: clamp(2.125rem, 5.2vw, 3.75rem); }
html[lang="ar"] body { line-height: 1.75; }

/* ---------- Header ---------- */
.site-header { background: var(--ink); color: #fff; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 1rem;
}
.wordmark {
  display: inline-flex; flex-direction: column; gap: 0.3rem;
  text-decoration: none; color: #fff;
  font: 900 1.75rem/0.8 "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  letter-spacing: 0.01em;
}
.wordmark .dots { display: flex; gap: 0.22rem; direction: ltr; }
.wordmark .dots i { width: 0.48rem; height: 0.48rem; border-radius: 50%; background: var(--light); }
.site-nav { display: flex; gap: 1.5rem; font-size: 0.9375rem; font-weight: 600; }
.site-nav a { text-decoration: none; padding-block: 0.5rem; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero { background: var(--ink); color: #fff; }
.hero .wrap { padding-block: 2.5rem 0; }
.hero-copy { padding-bottom: 3rem; }
.hero p { color: #c9cbd1; font-size: 1.1875rem; margin-top: 1.75rem; }
.hero .status {
  display: inline-block; margin-top: 0.75rem;
  color: #fff; font-weight: 700; font-size: 1rem;
  border-inline-start: 4px solid var(--light); padding-inline-start: 0.75rem;
}

/* The same Home screen on each kind of device, standing on the hero's edge.
   Always arranged left to right: these are pictures of hardware. */
.stage {
  direction: ltr;
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(0.75rem, 2.5vw, 2rem);
  margin-bottom: calc(-1 * clamp(4rem, 9vw, 7rem));
}
.stage figure { margin: 0; flex: 0 1 auto; min-width: 0; }
.stage img { width: 100%; background: #fff; border: 0.45rem solid #2a2b30; }
.stage .s-phone { width: 19%; }
.stage .s-phone img { border-radius: 2rem; }
.stage .s-duo { width: 24%; }
.stage .s-duo img { border-radius: 1.5rem; }
.stage .s-wide { width: 34%; }
.stage .s-wide img { border-radius: 1.25rem; }
.stage .s-tablet { width: 50%; }
.stage .s-tablet img { border-radius: 1.25rem; border-width: 0.6rem; }
.stage.few .s-phone { width: 24%; }
.stage.few .s-duo { width: 30%; }
.stage figcaption {
  margin-top: 0.75rem; text-align: center; color: var(--muted);
  font-size: 0.875rem; font-weight: 600;
}

/* The start lights: five come on, one by one, and stay on. Tap to run it again. */
.lights {
  display: inline-flex; gap: clamp(0.4rem, 1.4vw, 0.75rem);
  padding: 0; margin: 0 0 2.25rem; border: 0; background: none; cursor: pointer;
  direction: ltr;
}
.lights span {
  width: clamp(2.25rem, 7vw, 3.75rem); aspect-ratio: 1; border-radius: 50%;
  background: var(--light);
  box-shadow: 0 0 2.5rem rgba(229, 51, 15, 0.55);
  animation: light-on 0.01s linear both;
}
.lights span:nth-child(1) { animation-delay: 0.5s; }
.lights span:nth-child(2) { animation-delay: 1.1s; }
.lights span:nth-child(3) { animation-delay: 1.7s; }
.lights span:nth-child(4) { animation-delay: 2.3s; }
.lights span:nth-child(5) { animation-delay: 2.9s; }
/* Dark until its turn (the "backwards" fill holds this frame through the delay), red ever after */
@keyframes light-on {
  from { background: #2a2b30; box-shadow: none; }
  to { background: var(--light); box-shadow: 0 0 2.5rem rgba(229, 51, 15, 0.55); }
}
.lights.replay span { animation: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lights span { animation: none; }
}

/* ---------- Phones ---------- */
.phone { margin: 0; }
.phone img {
  width: 100%;
  border: 0.5rem solid var(--ink);
  border-radius: 2.5rem;
  background: #fff;
}
.phone.duo img { border-radius: 1.75rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section.after-hero { padding-top: clamp(9rem, 17vw, 13rem); }
.section + .section { border-top: 2px solid var(--ink); }
.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.split.flip .copy { order: 2; }
.lede { font-size: 1.1875rem; color: var(--muted); }
.copy ul { list-style: none; margin: 1.5rem 0 0; padding: 0; max-width: 34rem; }
.copy li { padding: 0.8rem 0; border-top: 1px solid var(--rule); }
.copy li strong { display: block; }
.copy li span { color: var(--muted); }

/* Two phones standing on a flat slab in the picked team's colour */
.slab {
  background: var(--team);
  border-radius: 0.625rem;
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1.25rem, 3vw, 2.25rem) 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: end; overflow: hidden;
  transition: background-color 0.25s ease;
}
.slab .phone img { border-bottom: 0; border-radius: 2rem 2rem 0 0; }
.slab .phone:nth-child(2) { transform: translateY(2.5rem); }
.slab.single { grid-template-columns: minmax(0, 20rem); justify-content: center; }
.slab.wide { display: block; padding: clamp(1rem, 2.5vw, 1.75rem); }
.slab.wide img { width: 100%; border-radius: 0.5rem; }

/* ---------- Team picker ---------- */
.teams {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.5rem; margin-top: 2rem; padding: 0; list-style: none;
}
.team {
  width: 100%; min-height: 5.5rem;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 0.5rem;
  padding: 0.75rem; border: 0.25rem solid transparent; border-radius: 0.625rem;
  background: var(--c); color: var(--k);
  font: 900 1.625rem/0.9 "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  text-transform: uppercase; text-align: start; cursor: pointer;
}
.team[aria-pressed="true"] { border-color: var(--ink); }
.team .tick {
  align-self: flex-start; width: 1.125rem; height: 1.125rem; border-radius: 50%;
  border: 2px solid currentColor; opacity: 0.4; flex: none;
}
.team[aria-pressed="true"] .tick { opacity: 1; background: currentColor; }
.picked { margin-top: 1rem; color: var(--muted); font-size: 0.9375rem; min-height: 1.5em; }

/* ---------- App Store button (shown once the app is live) ---------- */
.store {
  display: inline-block; margin-top: 1rem;
  background: #fff; color: var(--ink);
  font-weight: 700; font-size: 1.0625rem; text-decoration: none;
  padding: 0.95rem 1.5rem; border-radius: 0.625rem;
}
.store:hover { background: var(--light); color: #fff; }
.store-note { display: block; margin-top: 0.75rem; color: #c9cbd1; font-size: 0.9375rem; }

/* ---------- Arabic: a band of its own, centred ---------- */
.section.arabic { background: var(--ink); color: #fff; border-top: 0; text-align: center; }
.section.arabic + .section { border-top: 0; }
.arabic .script {
  font-family: "Alexandria", "Geeza Pro", Tahoma, sans-serif; font-weight: 900;
  font-size: clamp(3rem, 10vw, 7.5rem); line-height: 1.15; margin: 0 0 0.5rem;
  color: #fff; max-width: none;
}
.arabic h2 { margin-inline: auto; max-width: 18ch; }
.arabic .lede { color: #c9cbd1; margin-inline: auto; }
.arabic-shots {
  direction: ltr;
  display: flex; justify-content: center; align-items: center;
  gap: clamp(0.75rem, 2.5vw, 2rem); margin: 3.5rem auto 0; max-width: 54rem;
}
.arabic-shots .phone { flex: 1 1 0; min-width: 0; }
.arabic-shots .phone img { border-color: #2a2b30; }
.arabic-shots .phone:nth-child(2) { flex-grow: 1.25; }
.arabic-facts {
  list-style: none; padding: 0; margin: 3.5rem auto 0; max-width: 60rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem);
  text-align: start;
}
.arabic-facts li { border-top: 2px solid #fff; padding-top: 0.9rem; }
.arabic-facts strong { display: block; }
.arabic-facts span { color: #c9cbd1; }

/* ---------- Devices: the same app on each screen it is laid out for ---------- */
.device-row {
  list-style: none; margin: 3rem 0 0; padding: 0; direction: ltr;
  display: flex; align-items: flex-end; gap: clamp(1rem, 3vw, 2.5rem);
}
.device-row li { min-width: 0; }
.device-row img { width: 100%; background: #fff; border: 0.45rem solid var(--ink); border-radius: 1.5rem; }
.device-row .d-phone { flex: 0 1 17%; }
.device-row .d-phone img { border-radius: 2rem; }
.device-row .d-duo { flex: 0 1 22%; }
.device-row .d-wide { flex: 0 1 31%; }
.device-row .d-tablet { flex: 1 1 44%; }
.device-row.few { justify-content: flex-start; }
.device-row.few .d-phone { flex-basis: 15rem; }
.device-row.few .d-duo { flex-basis: 19rem; }
.device-notes {
  list-style: none; padding: 0; margin: 2.5rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: clamp(1.25rem, 3vw, 2.5rem);
}
.device-notes li { border-top: 2px solid var(--ink); padding-top: 0.9rem; }
.device-notes strong { display: block; }
.device-notes span { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c9cbd1; font-size: 0.9375rem; }
.site-footer .wrap { padding-block: 3rem; display: grid; gap: 1.5rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: #fff; font-weight: 600; }
.site-footer p { max-width: 46rem; margin: 0; }
.site-footer small { font-size: 0.8125rem; color: #9a9da6; }

/* ---------- Text pages (privacy) ---------- */
.prose { padding-block: clamp(3rem, 7vw, 5rem); }
.prose h1 { font-size: clamp(3rem, 9vw, 6rem); margin-bottom: 1rem; }
html[lang="ar"] .prose h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); }
.prose h2 {
  font: 700 1.375rem/1.3 var(--body); text-transform: none;
  margin: 2.75rem 0 0.75rem; padding-top: 1rem; border-top: 2px solid var(--ink);
}
html[lang="ar"] .prose h2 { font: 700 1.375rem/1.5 var(--body); }
.prose p, .prose ul, .prose table { max-width: 44rem; }
.prose ul { padding-inline-start: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.9875rem; }
.prose th, .prose td { text-align: start; vertical-align: top; padding: 0.65rem 0.75rem 0.65rem 0; border-top: 1px solid var(--rule); }
.prose th { font-weight: 700; width: 32%; }
.updated { color: var(--muted); }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .arabic-facts { grid-template-columns: 1fr; }
  .stage { flex-wrap: wrap; }
  .stage .s-tablet, .stage .s-wide { width: 100%; }
  .stage .s-phone, .stage.few .s-phone { width: 38%; }
  .stage .s-duo, .stage.few .s-duo { width: 48%; }
  .device-row { flex-wrap: wrap; }
  .device-row .d-tablet, .device-row .d-wide { flex-basis: 100%; }
  .device-row .d-phone, .device-row.few .d-phone { flex-basis: 38%; }
  .device-row .d-duo, .device-row.few .d-duo { flex-basis: 48%; }
  .split.flip .copy { order: 0; }
  .site-nav { gap: 1rem; }
  .site-nav .optional { display: none; }
}
