/* Passriva — bysamra. One stylesheet. No external requests, no third-party anything. */

:root {
  color-scheme: only light;

  --page: #FBFAF7;
  --tile: #FFFFFF;
  --tile-tint: #F1F4EF;
  --text: #14352B;
  --text-2: #5A665F;
  --brand: #194F40;
  --brand-soft: #D8E4D6;

  --line: #E4E2D8;
  --tile-line: #EAE8DF;
  --accent: #194F40;          /* interactive / focus */
  --on-accent: #FBFAF7;

  --band-bg: #194F40;
  --band-fg: #FBFAF7;
  --band-fg-2: #D8E4D6;
  --band-line: rgba(251, 250, 247, 0.26);

  --page-veil: rgba(251, 250, 247, 0.82);

  /* one elevation recipe: tight contact + wide ambient, green-tinted */
  --elev: 0 1px 2px rgba(20, 53, 43, 0.055), 0 14px 34px -10px rgba(20, 53, 43, 0.14);
  --elev-lift: 0 1px 2px rgba(20, 53, 43, 0.06), 0 26px 56px -16px rgba(20, 53, 43, 0.20);

  --radius: 22px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --measure: 34rem;
  --section-pad: clamp(3.5rem, 8vw, 7rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slide: -24px;             /* hero tile entry, start side */
}

html[dir="rtl"] { --slide: 24px; }

@media (min-width: 48rem) { :root { --radius: 28px; } }

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 106.25%;                 /* 17px body */
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 7.75rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", "SF Arabic", system-ui, "Segoe UI", "Noto Sans Arabic", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
}
html[lang="ar"] body { line-height: 1.8; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: var(--section-pad); }

/* ---------- type ---------- */

h1, h2, h3 { color: inherit; font-weight: 700; }

h1 {
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 22ch;
  margin-inline: auto;
}
html[lang="ar"] h1 { line-height: 1.28; letter-spacing: 0; }
@media (min-width: 75rem) { h1 { max-width: 34ch; } }

h2 {
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 2.5rem;
}

.sub-line {
  max-width: 48ch;
  margin: -1.75rem auto 2.5rem;
  color: var(--text-2);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  text-align: center;
}
html[lang="ar"] h2 { line-height: 1.35; letter-spacing: 0; }

h3 { font-size: 1.0625rem; line-height: 1.4; margin: 0 0 0.4rem; font-weight: 600; }

p { margin: 0 0 1rem; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.0625rem, 1.9vw, 1.3125rem);
  line-height: 1.5;
  color: var(--text-2);
  max-width: 46ch;
}
html[lang="ar"] .lead { line-height: 1.75; }

.small { font-size: 0.875rem; color: var(--text-2); }
.center { text-align: center; }
.center h1, .center h2, .center p { margin-inline: auto; }

a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: from-font; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; inset-inline-start: 0.75rem; top: -5rem; z-index: 60;
  background: var(--tile); color: var(--text);
  border: 1px solid var(--line); border-radius: 0.65rem; padding: 0.75rem 1rem;
  transition: top 0.15s var(--ease);
}
.skip:focus { top: 0.75rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
  .site-header {
    background: var(--page-veil);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
}

.bar { display: flex; align-items: center; gap: 0.5rem; padding-block: 0.6rem; }

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 44px; padding: 0.35rem 0;
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; text-decoration: none;
  margin-inline-end: auto;
}
.brand img { display: block; width: 28px; height: 28px; border-radius: 0.5rem; }

.nav-links { display: none; }
@media (min-width: 60rem) {
  .nav-links {
    display: flex; align-items: center; gap: 0.25rem;
    margin: 0; padding: 0; list-style: none;
    margin-inline: auto;
  }
  .nav-links a {
    display: inline-flex; align-items: center; min-height: 44px;
    padding: 0.5rem 0.8rem; border-radius: 999px;
    font-size: 0.9375rem; color: var(--text-2); text-decoration: none;
    transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
  }
  .nav-links a:hover { color: var(--text); background: var(--tile-tint); }
}

.language-picker { position: relative; flex: none; }
.language-picker summary {
  display: flex; align-items: center; gap: 0.45rem; min-height: 44px;
  padding: 0.5rem 0.85rem; border: 1px solid var(--line); border-radius: 999px;
  list-style: none; cursor: pointer; font-size: 0.9375rem; color: var(--text-2);
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary:hover, .language-picker[open] summary {
  color: var(--text); border-color: var(--text-2); background: var(--tile);
}
.language-globe { width: 1.1rem; height: 1.1rem; flex: none; }
.language-chevron { width: 0.7rem; height: 0.7rem; flex: none; }
.language-picker[open] .language-chevron { transform: rotate(180deg); }
.language-options {
  position: absolute; inset-inline-end: 0; top: calc(100% + 0.6rem);
  min-width: 11rem; max-width: calc(100vw - 2rem); margin: 0; padding: 0.4rem;
  border: 1px solid var(--line); border-radius: 1rem; background: var(--tile);
  box-shadow: var(--elev-lift); list-style: none;
}
.language-options a {
  display: flex; align-items: center; gap: 1.5rem; justify-content: space-between;
  min-height: 44px; padding: 0.6rem 0.75rem; border-radius: 0.65rem;
  font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
}
.language-options a:hover, .language-options a[aria-current="true"] { background: var(--tile-tint); }
.language-options a[aria-current="true"] { font-weight: 600; }
.language-check { width: 1rem; height: 1rem; flex: none; }

/* anchor rail on small screens */
.rail { border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail ul { display: flex; gap: 0.25rem; margin: 0; padding: 0.15rem var(--gutter) 0.35rem; list-style: none; }
.rail a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.4rem 0.7rem;
  white-space: nowrap; font-size: 0.9375rem; color: var(--text-2); text-decoration: none;
}
@media (min-width: 60rem) { .rail { display: none; } }
@media (min-width: 60rem) { html { scroll-padding-top: 5.5rem; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 51px; padding: 0.85rem 1.6rem; border-radius: 0.9375rem;
  font-size: 1.0625rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  transition: opacity 0.15s var(--ease), transform 0.12s var(--ease);
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-soon {
  background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand); cursor: default;
}
.btn-soon:hover { opacity: 1; }
.btn-soon:active { transform: none; }

.btn-sm { min-height: 44px; padding: 0.5rem 1rem; font-size: 0.9375rem; border-radius: 999px; white-space: nowrap; }

/* below 360 px the header pill would crowd the bar; the hero button is a screen away */
@media (max-width: 22.5rem) {
  .site-header .bar .btn-sm { display: none; }
}

@media (max-width: 30rem) {
  .bar { gap: 0.4rem; }
  .brand { gap: 0.45rem; font-size: 1rem; }
  .brand img { width: 24px; height: 24px; border-radius: 0.4rem; }
  .language-picker summary { padding: 0.5rem 0.65rem; font-size: 0.875rem; }
  .btn-sm { padding: 0.5rem 0.75rem; font-size: 0.875rem; }
}
@media (max-width: 26rem) { .language-chevron { display: none; } }

html[data-beta="soon"] .beta-open { display: none; }
html[data-beta="open"] .beta-soon { display: none; }

/* ---------- tiles ---------- */

.tile {
  background: var(--tile);
  border: 1px solid var(--tile-line);
  border-radius: var(--radius);
  box-shadow: var(--elev);
  padding: clamp(1.25rem, 3vw, 1.85rem);
}
.tile-tint { background: var(--tile-tint); }
.tile-brand { background: var(--band-bg); color: var(--band-fg); border-color: transparent; }
.tile-brand .small, .tile-brand .facts li { color: var(--band-fg-2); }
.tile-brand :focus-visible { outline-color: var(--band-fg); }

.grid-3 { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
@media (min-width: 60rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
@media (min-width: 48rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- the phone ---------- */

.phone {
  --w: 240px;
  position: relative;
  width: var(--w);
  padding: 5px;
  background: #1C1C1E;
  border-radius: calc(var(--w) * 0.125);
  box-shadow: var(--elev-lift);
}
.phone-screen { display: block; overflow: hidden; border-radius: calc(var(--w) * 0.112); background: var(--tile); }
.phone-screen img { display: block; width: 100%; height: auto; }
.phone .island {
  position: absolute; top: calc(5px + var(--w) * 0.028); left: 50%;
  transform: translateX(-50%);
  width: 30%; height: calc(var(--w) * 0.083);
  background: #0A0A0B; border-radius: 999px;
}
.phone-cut {
  overflow: hidden;
  height: calc(var(--w) * var(--cut, 1.42));
  padding-bottom: 0;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}
.phone-cut .phone-screen { border-end-start-radius: 0; border-end-end-radius: 0; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(1rem, 2vw, 1.25rem) clamp(2rem, 5vw, 3.5rem); }
.hero .lead { margin-bottom: 1.5rem; }
.hero-note { margin-top: 0.85rem; }

.showcase {
  position: relative;
  margin-top: clamp(1.25rem, 2.5vw, 1.5rem);
  display: grid;
  justify-items: center;
}

.wash {
  position: absolute; inset: -6% 0 6%;
  background: radial-gradient(ellipse 60% 55% at 50% 45%, var(--brand-soft) 0%, transparent 70%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.showcase .phone, .showcase .float { position: relative; z-index: 1; }

.float {
  width: 100%;
  max-width: 24rem;
  padding: clamp(0.85rem, 2vw, 1rem);
  background: var(--tile);
  border: 1px solid var(--tile-line);
  border-radius: var(--radius);
  box-shadow: var(--elev-lift);
}
.showcase .mrz-float { margin-top: 0; }
.showcase .result-float { margin-top: 1rem; }

.arcs { display: block; width: 2.5rem; height: 2.5rem; color: var(--brand); margin: 1rem auto 0; }
.arcs path { fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; }

@media (min-width: 48rem) { .showcase .phone { --w: 280px; } }

/* The floating composition needs room for a tile on each side of the phone
   without ever covering the screen, so it only starts at 1200 px.
   Everything is anchored to the phone's centre line (50% +/- half the frame,
   165px), which keeps the geometry identical at every width. */
@media (min-width: 75rem) {
  .showcase { display: block; }
  .showcase .phone { --w: 320px; margin-inline: auto; }
  .showcase .float, .showcase .mrz-float, .showcase .result-float {
    position: absolute; margin: 0; z-index: 2; max-width: none; width: auto;
  }
  .wash { inset: -8% 0 4%; }
  /* start side: ends 1px before the phone frame, aligned with "Printed lines" */
  .showcase .mrz-float { inset-inline-start: 0; inset-inline-end: calc(50% + 166px); top: 47%; }
  /* end side: arcs at the "Passport chip" row, result tile below and further out */
  .showcase .arcs {
    position: absolute; inset-inline-start: calc(50% + 178px); top: 65%;
    z-index: 3; width: 3rem; height: 3rem; margin: 0;
  }
  .showcase .result-float { inset-inline-start: calc(50% + 240px); inset-inline-end: 0; top: 57%; }
}

/* machine-readable lines */

.mrz { position: relative; overflow: hidden; container-type: inline-size; }
.mrz-line {
  position: relative; z-index: 1; display: block;
  direction: ltr; unicode-bidi: isolate; text-align: left;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 500; color: var(--text); letter-spacing: 0.02em;
  font-size: min(2.7vw, 1.125rem); line-height: 1.8; white-space: pre;
}
@supports (container-type: inline-size) {
  .mrz-line { font-size: min(calc(100cqw / 27.5), 1.125rem); }
}

.sweep {
  position: absolute; inset-block: 0; left: 0; width: 34%;
  background: var(--brand-soft); opacity: 0; pointer-events: none; z-index: 0;
}

/* result tile rows */

.rows { margin: 0; display: grid; gap: 0.5rem; }
.rows > div { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.rows dt { color: var(--text-2); font-size: 0.875rem; margin: 0; }
.rows dd { margin: 0; font-weight: 600; font-size: 0.9375rem; text-align: end; }
.rows .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; direction: ltr; unicode-bidi: isolate; }
.verified { display: inline-flex; align-items: center; gap: 0.35rem; }

.tick { width: 1.15rem; height: 1.15rem; flex: none; color: var(--brand); }
.tick circle { fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.35; }
.tick path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tick-lg { width: 2rem; height: 2rem; }
.tick-muted { color: var(--text-2); }
.tick-muted circle { opacity: 0.45; }

/* ---------- how it works ---------- */

.step-no {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 999px; background: var(--brand-soft); color: #14352B;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9375rem; font-weight: 600;
  margin-bottom: 0.9rem;
}

.step-visual { margin-top: 1.5rem; border-radius: 1rem; overflow: hidden; }
.step-visual img { display: block; width: 100%; height: auto; }

.scanbox {
  position: relative; padding: 1.6rem 0.9rem;
  background: var(--tile-tint); border-radius: 1rem;
  container-type: inline-size; overflow: hidden;
}
.scanbox .mrz-line { font-size: min(calc(100cqw / 27.5), 0.875rem); }
.scanbox::before, .scanbox::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 2px solid var(--brand); opacity: 0.55;
}
.scanbox::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; border-radius: 3px 0 0 0; }
.scanbox::after { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-radius: 0 0 3px 0; }

.draw { display: block; width: 100%; height: auto; color: var(--brand); background: var(--tile-tint); border-radius: 1rem; }
.draw [stroke] { stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.draw .occlude { fill: var(--tile-tint); }

/* ---------- what stays on your phone ---------- */

.stays { display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); align-items: center; }
@media (min-width: 60rem) { .stays { grid-template-columns: 5fr 7fr; } }

.huge {
  font-size: clamp(3.25rem, 8vw, 6rem);
  line-height: 0.98; letter-spacing: -0.035em; font-weight: 700; margin: 0; max-width: none;
}
html[lang="ar"] .huge { line-height: 1.2; letter-spacing: 0; }

.facts { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.facts li { padding-block: 0.85rem; border-top: 1px solid var(--band-line); }
.facts li:last-child { border-bottom: 1px solid var(--band-line); }

.mini { display: grid; gap: 1rem; justify-items: center; text-align: center; }
.mini .phone { --w: 210px; }
.pair { display: flex; justify-content: center; align-items: flex-end; }
.pair .phone { --w: 150px; }
.pair .phone:last-child { margin-inline-start: -2.75rem; margin-bottom: 1.25rem; }
.pair .phone:first-child { position: relative; z-index: 1; }

/* ---------- questions ---------- */

.qa { display: grid; gap: 0.75rem; }
@media (min-width: 60rem) { .qa { grid-template-columns: 1fr 1fr; column-gap: 1.25rem; align-items: start; } }

.qa details {
  background: var(--tile); border: 1px solid var(--tile-line);
  border-radius: 1rem; box-shadow: var(--elev); padding: 0.35rem 1.1rem;
}
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 52px; padding-block: 0.5rem; cursor: pointer;
  font-weight: 600; list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::marker { content: ""; }
.qa .chev {
  flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s var(--ease);
}
.qa details[open] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
.qa details p { padding-bottom: 1rem; color: var(--text-2); max-width: none; }

/* ---------- closing ---------- */

.closing-statement {
  font-size: clamp(1.9rem, 4.4vw, 3.25rem);
  line-height: 1.1; letter-spacing: -0.02em; font-weight: 700;
  margin: 0 auto 1.75rem; max-width: 16ch;
}
html[lang="ar"] .closing-statement { line-height: 1.35; letter-spacing: 0; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); padding-block: 1.5rem 3rem; }
.foot { display: grid; gap: 0.25rem; align-items: center; }
.footlinks { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.footlinks a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-mail { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.foot-credit { margin: 0; }
@media (min-width: 48rem) {
  .foot { grid-template-columns: auto 1fr auto; gap: 1.5rem; }
  .foot-mail { justify-self: center; }
  .foot-credit { justify-self: end; text-align: end; }
}

.mt { margin-top: 1.25rem; }
.note { max-width: 60ch; margin: 1.75rem auto 0; }

bdi, .break { overflow-wrap: anywhere; }

/* ---------- document pages ---------- */

.page { padding-block: clamp(1.5rem, 4vw, 2.5rem) 0.5rem; }
.page h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); max-width: 22ch; margin-inline: 0; }
.prose section { padding-block: 2.25rem; border-top: 1px solid var(--line); }
.prose h2 { margin: 0 0 1rem; font-size: clamp(1.25rem, 2.4vw, 1.5rem); line-height: 1.3; }
@media (min-width: 60rem) {
  .prose .doc { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
  .prose h2 { margin: 0; }
  .prose .doc-body p { max-width: 38rem; }
}
.email-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }

/* ---------- the one load sequence (~1.8 s, once) ---------- */

@keyframes rise   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes slide  { from { opacity: 0; transform: translateX(var(--slide)); } to { opacity: 1; transform: none; } }
@keyframes slide-e{ from { opacity: 0; transform: translateX(calc(var(--slide) * -1)); } to { opacity: 1; transform: none; } }
@keyframes sweep  { from { opacity: 0; transform: translateX(-105%); } 16% { opacity: 1; } 78% { opacity: 1; } to { opacity: 0; transform: translateX(300%); } }
@keyframes arc-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes draw   { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }

html.anim .showcase .phone   { animation: rise 0.5s 0.05s var(--ease) backwards; }
html.anim .mrz-float         { animation: slide 0.4s 0.45s var(--ease) backwards; }
html.anim .mrz-float .sweep  { animation: sweep 0.55s 0.6s var(--ease) both; }
html.anim .showcase .arcs path { animation: arc-in 0.35s var(--ease) backwards; }
html.anim .showcase .arcs path:nth-of-type(1) { animation-delay: 1s; }
html.anim .showcase .arcs path:nth-of-type(2) { animation-delay: 1.1s; }
html.anim .showcase .arcs path:nth-of-type(3) { animation-delay: 1.2s; }
html.anim .result-float      { animation: slide-e 0.4s 1.3s var(--ease) backwards; }
html.anim .result-float .tick path { stroke-dasharray: 16; animation: draw 0.3s 1.5s var(--ease) backwards; }

/* one gentle scroll behaviour, progressive only */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise-soft linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
    @keyframes rise-soft { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  }
}

@media (prefers-reduced-motion: reduce) {
  html.anim .showcase .phone,
  html.anim .mrz-float,
  html.anim .mrz-float .sweep,
  html.anim .showcase .arcs path,
  html.anim .result-float,
  html.anim .result-float .tick path { animation: none; }
  .sweep { opacity: 0; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
