/*
 * The coming-soon page (ADR-0367), from Figma 0vmhQD15A7Bcfee9iHwM9s, page "Coming soon".
 * Wide screens are drawn in units of the 1440 x 900 frame, scaled with the window's height (--u);
 * phones in units of the 390 x 844 frame, scaled with its width (--p). The map is placed by where
 * Cairo falls (scripts/render_map.py prints it) and never mirrored: Arabic sits east of the Nile.
 */

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/geist-latin-wght-normal.19f9c92546.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Alexandria draws the Arabic headline, its full stop too, as in the designs. */
@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/assets/alexandria-arabic-600-normal.73aaa55f3a.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Alexandria";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/assets/alexandria-latin-600-normal.89da855469.woff2") format("woff2");
  unicode-range: U+002E;
}

/* snizu Arabic (ADR-0247): the text cut for running text, the UI cut for one-line controls. */
@font-face {
  font-family: "snizu Arabic";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/assets/snizuArabic-Regular.fb2e3c4c94.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+25CC, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "snizu Arabic UI";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/assets/snizuArabicUI-Medium.41f0235de3.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+25CC, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --night: #04130e;
  --white: #ffffff;
  --white-78: rgb(255 255 255 / 0.78);
  --white-60: rgb(255 255 255 / 0.6);
  --ink-900: #18201c;
  --ink-400: #636d69;
  --saffron-500: #f2b036;
  --saffron-hover: #f5bf55;
  --saffron-300: #f8d27f;
  --focus: #8ad9bc;

  --font-text: "Geist Variable", "snizu Arabic", ui-sans-serif, system-ui, sans-serif;
  --font-control: "Geist Variable", "snizu Arabic UI", ui-sans-serif, system-ui, sans-serif;
  --font-display-arabic: "Alexandria", "Geist Variable", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* One pixel of the 1440 x 900 frame. */
  --u: clamp(0.72px, calc(100svh / 900), 1.5px);
}

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

html {
  background: var(--night);
  color: var(--white);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgb(248 210 127 / 0.35);
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}

.visually-hidden,
.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- The map: the hero's film, frozen on its way north ---------- */

.map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.map-stage {
  position: relative;
  height: 100%;
  width: min(100%, calc(1440 * var(--u)));
  margin-inline: auto;
}

.map picture,
.map img {
  position: absolute;
  inset: 0;
}

.map img {
  /* Cairo 852.7 into the image lands 816.7 into the stage (Figma EN). */
  inset: auto;
  top: calc(-101.9 * var(--u));
  left: calc(-36 * var(--u));
  width: calc(1448.8 * var(--u));
  height: calc(1166.7 * var(--u));
  max-width: none;
}

[dir="rtl"] .map img {
  /* Cairo 863.3 short of the stage's far edge (Figma AR). */
  left: calc(100% - 1716 * var(--u));
}

.map-waiting {
  animation: fade-in 1.2s var(--ease) both;
}

.map-sent {
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}

[data-state="sent"] .map-sent {
  opacity: 1;
}

/* ---------- Bar: the word alone, since the fennec is on screen ---------- */

.bar {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(88 * var(--u));
  padding-inline: calc(48 * var(--u));
}

/* The word sits high in its box, as Figma's "Nav brand": its letters' middle meets the label's. */
.brand {
  display: block;
  padding-bottom: calc(14.5 * var(--u));
}

.brand img {
  display: block;
  width: calc(79 * var(--u));
  height: auto;
}

.language {
  font-family: var(--font-control);
  font-size: max(14px, calc(15 * var(--u)));
  font-weight: 500;
  line-height: 1.33;
  color: var(--white-78);
  transition: color 180ms ease-out;
}

.language:hover {
  color: var(--white);
}

/* ---------- The words and the field ---------- */

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: min(100%, calc(1440 * var(--u)));
  min-height: 100svh;
  margin-inline: auto;
  padding: calc(40 * var(--u)) calc(112 * var(--u)) calc(48 * var(--u));
}

.copy {
  width: min(100%, calc(540 * var(--u)));
  animation: rise 0.8s var(--ease) 0.1s both;
}

.headline {
  margin: 0;
  font-family: var(--font-text);
  font-size: calc(104 * var(--u));
  font-weight: 600;
  line-height: calc(100 * var(--u));
  letter-spacing: -0.025em;
  white-space: nowrap;
}

[lang="ar"] .headline {
  font-family: var(--font-display-arabic);
  font-size: calc(96 * var(--u));
  line-height: calc(108 * var(--u));
  letter-spacing: 0;
}

.sub {
  margin: calc(32 * var(--u)) 0 0;
  font-size: max(15px, calc(18 * var(--u)));
  line-height: 1.5556;
  color: var(--white-78);
}

[lang="ar"] .sub {
  margin-top: calc(24 * var(--u));
  line-height: 1.7222;
}

.phone-break {
  display: none;
}

.notify {
  position: relative;
  margin-top: calc(48 * var(--u));
}

[lang="ar"] .notify {
  margin-top: calc(27 * var(--u));
}

.field {
  display: flex;
  align-items: center;
  gap: calc(16 * var(--u));
  height: max(56px, calc(76 * var(--u)));
  padding: calc(8 * var(--u));
  padding-inline-start: calc(32 * var(--u));
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 calc(18 * var(--u)) calc(50 * var(--u)) calc(-8 * var(--u)) rgb(0 0 0 / 0.45);
  transition: box-shadow 180ms ease-out;
}

.field:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* One ring at a time: a wrong address takes the focus ring's place. */
[data-state="invalid"] .field,
[data-state="invalid"] .field:has(input:focus-visible) {
  outline: 2px solid var(--saffron-500);
  outline-offset: 3px;
}

.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-900);
  font-family: var(--font-text);
  font-size: max(16px, calc(22 * var(--u)));
  line-height: 1.45;
  outline: none;
}

[lang="ar"] .field input {
  font-size: max(16px, calc(20 * var(--u)));
  text-align: right;
}

.field input::placeholder {
  color: var(--ink-400);
  opacity: 1;
}

.send,
.done {
  flex: none;
  height: max(44px, calc(60 * var(--u)));
  border: 0;
  border-radius: 999px;
  background: var(--saffron-500);
  color: var(--ink-900);
}

.send {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding-inline: calc(26 * var(--u));
  font-family: var(--font-control);
  font-size: max(15px, calc(17 * var(--u)));
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 180ms ease-out,
    scale 180ms ease-out,
    opacity 180ms ease-out;
}

[lang="ar"] .send {
  font-weight: 500;
}

.send:hover {
  background: var(--saffron-hover);
}

.send:active {
  scale: 0.97;
}

.send:focus-visible {
  outline-offset: 3px;
  border-radius: 999px;
}

.arrow {
  width: calc(16 * var(--u));
  min-width: 14px;
  height: auto;
  transition: translate 180ms ease-out;
}

.send:hover .arrow {
  translate: 3px 0;
}

[dir="rtl"] .arrow {
  scale: -1 1;
}

[dir="rtl"] .send:hover .arrow {
  translate: -3px 0;
}

.done {
  display: none;
  width: max(44px, calc(60 * var(--u)));
  place-items: center;
}

.done svg {
  width: calc(22 * var(--u));
  min-width: 18px;
  height: auto;
}

[data-state="sending"] .send {
  opacity: 0.72;
  cursor: progress;
}

[data-state="sent"] .send {
  display: none;
}

[data-state="sent"] .done {
  display: grid;
  animation: fold-in 360ms var(--ease) both;
}

.message {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  margin: calc(18 * var(--u)) 0 0;
  padding-inline-start: calc(32 * var(--u));
  font-size: max(14px, calc(16 * var(--u)));
  line-height: 1.5;
  color: var(--white-78);
}

[lang="ar"] .message {
  line-height: 1.75;
}

.message:empty {
  display: none;
}

[data-state="invalid"] .message {
  color: var(--saffron-300);
}

/* ---------- The fennec looks in from the edge, and the small print ---------- */

.fennec {
  position: absolute;
  left: 0;
  bottom: calc(-8 * var(--u));
  z-index: 1;
  width: calc(110.16 * var(--u));
  height: auto;
  animation: peek 0.7s var(--ease) 0.6s both;
}

.foot {
  position: absolute;
  right: calc(48 * var(--u));
  bottom: calc(40 * var(--u));
  z-index: 1;
  display: flex;
  gap: calc(24 * var(--u));
  font-size: max(12px, calc(13 * var(--u)));
  line-height: 1.385;
  color: var(--white-60);
  /* On narrow windows the lit river can run behind the small print. */
  text-shadow: 0 0 12px var(--night), 0 0 4px var(--night);
}

/* ---------- Phones and tall windows: the 390 x 844 frame ---------- */

@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  :root {
    --p: clamp(0.82px, calc(100vw / 390), 1.3px);
  }

  body {
    display: flex;
    flex-direction: column;
  }

  .map-stage {
    width: 100%;
  }

  .map img,
  [dir="rtl"] .map img {
    /* The hero's phone map, moved down so the light runs from above the field to under the words. */
    top: calc(117.8 * var(--p));
    left: calc(50% - 453.2 * var(--p));
    width: calc(769.9 * var(--p));
    height: calc(868 * var(--p));
  }

  .bar {
    position: relative;
    flex: none;
    height: calc(60 * var(--p));
    padding-inline: calc(16 * var(--p));
  }

  .brand {
    padding-bottom: calc(14.5 * var(--p));
  }

  .brand img {
    width: calc(79 * var(--p));
  }

  .language {
    font-size: 15px;
  }

  .stage {
    flex: 1;
    align-items: stretch;
    width: min(100%, calc(390 * var(--p)));
    min-height: 0;
    padding: calc(32 * var(--p)) calc(16 * var(--p)) 0;
  }

  .copy {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .headline {
    font-size: calc(60 * var(--p));
    line-height: calc(58 * var(--p));
  }

  [lang="ar"] .headline {
    font-size: calc(55 * var(--p));
    line-height: calc(62 * var(--p));
  }

  .sub,
  [lang="ar"] .sub {
    margin-top: calc(18 * var(--p));
    font-size: 15px;
    line-height: 1.5333;
  }

  [lang="ar"] .sub {
    margin-top: calc(15 * var(--p));
    line-height: 1.7333;
  }

  .phone-break {
    display: inline;
  }

  .notify,
  [lang="ar"] .notify {
    margin-top: auto;
    padding-top: calc(32 * var(--p));
  }

  .field {
    gap: calc(12 * var(--p));
    height: calc(60 * var(--p));
    padding: calc(6 * var(--p));
    padding-inline-start: calc(20 * var(--p));
    box-shadow: 0 calc(14 * var(--p)) calc(40 * var(--p)) calc(-8 * var(--p)) rgb(0 0 0 / 0.45);
  }

  .field input,
  [lang="ar"] .field input {
    font-size: max(16px, calc(17 * var(--p)));
  }

  .send,
  .done {
    height: calc(48 * var(--p));
  }

  .send {
    gap: calc(8 * var(--p));
    padding-inline: calc(20 * var(--p));
    font-size: 15px;
  }

  .done {
    width: calc(48 * var(--p));
  }

  .message {
    position: static;
    margin-top: calc(14 * var(--p));
    padding-inline-start: calc(20 * var(--p));
    font-size: 14px;
  }

  .fennec {
    top: calc(392 * var(--p));
    bottom: auto;
    width: calc(68.3 * var(--p));
  }

  .foot {
    position: relative;
    right: auto;
    bottom: auto;
    flex: none;
    gap: calc(16 * var(--p));
    width: min(100%, calc(390 * var(--p)));
    margin-inline: auto;
    padding: calc(28 * var(--p)) calc(16 * var(--p)) calc(34 * var(--p) + env(safe-area-inset-bottom));
    font-size: 12px;
  }
}

/* ---------- Motion ---------- */

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 12px;
  }
}

@keyframes peek {
  from {
    translate: -100% 0;
  }
}

@keyframes fold-in {
  from {
    opacity: 0;
    scale: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
