/* Fonts are self-hosted (OFL): Shrikhand, Lalezar, IBM Plex Sans Arabic, Courier Prime. */
/* latin */
@font-face {
  font-family: 'Shrikhand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/shrikhand-latin-400.woff2) format('woff2');
  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;
}
/* arabic */
@font-face {
  font-family: 'Lalezar';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/lalezar-arabic-400.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/plexar-arabic-400.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/plexar-latin-400.woff2) format('woff2');
  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;
}
/* arabic */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/plexar-arabic-600.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/plexar-latin-600.woff2) format('woff2');
  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;
}
/* latin */
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/courier-latin-400.woff2) format('woff2');
  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;
}
/* latin */
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/courier-latin-700.woff2) format('woff2');
  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;
}

/* 2go.mom placeholder. One idea: the page is a takeaway ticket ("to go", سفري).
   The stamp is the only loud thing. Everything else stays quiet. */

:root {
  --kraft: #d7b98e;      /* the paper bag: page background */
  --kraft-deep: #b8946a; /* the bag's fold: ticket's hard shadow */
  --paper: #fffdf7;      /* thermal ticket paper */
  --ink: #2a1f17;        /* warm near-black print */
  --ink-soft: #5a4634;   /* secondary text, 5.4:1 on kraft */
  --cobalt: #2945c4;     /* rubber stamp ink */

  --display: "Shrikhand", Georgia, serif;
  --display-ar: "Lalezar", "Geeza Pro", "Noto Kufi Arabic", sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Courier Prime", "Courier New", ui-monospace, monospace;

  --zig: 14px;
  color-scheme: light;
}

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

html {
  background: var(--kraft);
  color: var(--ink);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body { margin: 0; }

a { color: inherit; }

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

.page {
  /* clip, not hidden, and here rather than on body (body's overflow passes to the
     viewport): the stamp's entrance overhangs the edge on phones for a moment. */
  overflow-x: clip;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 74rem;
  margin-inline: auto;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(clamp(1.25rem, 5vw, 3.5rem), env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(clamp(1.25rem, 5vw, 3.5rem), env(safe-area-inset-left));
}

/* Header ------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block-start: 0.5rem;
}

.mark {
  font-family: var(--display);
  font-size: 1.625rem;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.mark .dot { color: var(--cobalt); }

.lang {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 1.1rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.lang:hover { background: var(--ink); color: var(--paper); }

/* On the English page, the one Arabic word in the switch uses the system's
   Arabic face, so English visitors don't download the Arabic font for it. */
html:lang(en) .lang:lang(ar) { font-family: system-ui, -apple-system, "Geeza Pro", sans-serif; }

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

.hero {
  display: grid;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(0.5rem, 3vw, 2rem);
}

@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

h1 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.875rem, 1.4rem + 6.4vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 11ch;
}

:lang(ar) h1 {
  font-family: var(--display-ar);
  font-size: clamp(3.25rem, 1.9rem + 6vw, 7rem);
  line-height: 1.4;
  letter-spacing: 0;
  max-width: none;
  margin-block-end: 1rem;
}

.lede {
  /* Keeps the fallback the same size while Plex loads. Body text only:
     display faces set their own size, and inheriting this ratio would rescale them. */
  font-size-adjust: from-font;
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink);
  text-wrap: pretty;
}

:lang(ar) .lede { line-height: 1.85; }

/* Ticket ------------------------------------------------------------- */

.ticket-wrap {
  position: relative;
  justify-self: center;
  width: min(100%, 23.5rem);
  margin: 0;
}

/* A hard, flat offset in the bag's darker brown, not a soft grey blur.
   On its own layer so the stamp above it casts no shadow. */
.ticket-shadow { filter: drop-shadow(0 7px 0 var(--kraft-deep)); }

@media (min-width: 60rem) {
  .ticket-wrap { rotate: 2.5deg; justify-self: end; }
  [dir="rtl"] .ticket-wrap { rotate: -2.5deg; }
}

.ticket {
  background: var(--paper);
  /* Blank paper at the bottom is where the stamp lands. */
  padding: calc(var(--zig) + 1.25rem) 1.5rem calc(var(--zig) + 5.25rem);
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.45;
  /* Torn top and bottom edges. */
  mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) 50% 0 / var(--zig) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / var(--zig) 51% repeat-x;
}

:lang(ar) .ticket { font-family: var(--body); font-size: 0.9375rem; line-height: 1.6; }

.t-shop {
  margin: 0 0 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.ticket ul { list-style: none; margin: 0; padding: 0; }

.row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
}

.row + .row { margin-block-start: 0.35rem; }

.row .lead {
  flex: 1 1 1.5rem;
  min-width: 1rem;
  border-block-end: 2px dotted color-mix(in srgb, var(--ink) 45%, transparent);
  translate: 0 -0.3em;
}

.row > :first-child { white-space: nowrap; }
.row .val { text-align: end; }

@media (max-width: 26rem) {
  .ticket { font-size: 0.875rem; padding-inline: 1.15rem; }
}

.q { font-weight: 700; }

.cut {
  border: 0;
  border-block-start: 2px dashed color-mix(in srgb, var(--ink) 40%, transparent);
  margin: 1rem 0;
}

.t-label { margin: 0 0 0.5rem; }

.stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.stages li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.stages li::before {
  content: "";
  inline-size: 0.8em;
  block-size: 0.8em;
  border: 1.5px solid var(--ink);
  flex: none;
}

.t-note { margin: 0.6rem 0 0; color: var(--ink-soft); }

.t-thanks { margin: 1.1rem 0 0; text-align: center; }

/* The stamp: the one loud moment. */
.stamp {
  position: absolute;
  inset-block-end: 1.75rem;
  inset-inline-end: -0.6rem;
  margin: 0;
  padding: 0.3rem 0.9rem 0.45rem;
  border: 3px solid var(--cobalt);
  border-radius: 0.55rem;
  outline: 1.5px solid var(--cobalt);
  outline-offset: 3px;
  color: var(--cobalt);
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.1;
  white-space: nowrap;
  rotate: -11deg;
  mix-blend-mode: multiply;
}

:lang(ar) .stamp {
  font-family: var(--display-ar);
  font-size: 2.5rem;
  line-height: 1.35;
  padding: 0.1rem 1.1rem 0.2rem;
  rotate: 9deg;
}

@media (prefers-reduced-motion: no-preference) {
  .ticket { animation: print 0.95s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }
  .stamp { animation: stamp 0.42s cubic-bezier(0.3, 1.5, 0.5, 1) 1.1s both; }
}

@keyframes print {
  from { clip-path: inset(0 0 100% 0); translate: 0 -1.25rem; }
  to { clip-path: inset(0 0 -2% 0); translate: 0 0; }
}

@keyframes stamp {
  from { opacity: 0; scale: 1.7; }
  55% { opacity: 1; }
  to { opacity: 1; scale: 1; }
}

/* Footer ------------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.foot p { margin: 0; }

/* 404 ---------------------------------------------------------------- */

.lost {
  align-self: center;
  display: grid;
  gap: 1rem;
}

.lost h1 { max-width: none; font-size: clamp(2.25rem, 1.2rem + 4.5vw, 4rem); margin: 0; }
.lost p { margin: 0; font-size: 1.125rem; }
.lost .ar { font-family: var(--body); }
.lost .ar h1, .lost h1.ar { font-family: var(--display-ar); line-height: 1.3; }

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