/* Sayr landing — brand 1.1 (BRAND.md): flat sand and teal fields, one terracotta per viewport,
   Amiri Bold voice, IBM Plex Sans Arabic information. The route-diagram grammar lives in .route. */

:root {
  --teal: #0D4F47;
  --teal-deep: #08322D;
  --sand: #F4EFE6;
  --terra: #C75B45;
  --ink: #17211F;
  --muted: #6E7B77;        /* 18px+ only on sand (4.3:1) */
  --muted-strong: #55615D; /* small text on sand (6:1) */
  --line: #DFD8CB;
  --white: #FFFFFF;
  --sand-on-teal: #B9C8C3;
  --hair-on-teal: #2A6A61;

  --display: "Amiri", "Geeza Pro", serif;
  --sans: "IBM Plex Sans Arabic", "Geeza Pro", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--teal) var(--sand); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 1.0625rem/1.75 var(--sans);
  caret-color: var(--teal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--teal); color: var(--sand); }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .28em; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.on-teal :focus-visible, .method :focus-visible, .demo :focus-visible, .close :focus-visible, .foot :focus-visible { outline-color: var(--sand); }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--teal); color: var(--sand); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }

.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  background: var(--sand);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-mark img { height: 40px; width: auto; }
.nav-links { display: flex; gap: 26px; margin-inline-start: auto; font-weight: 500; font-size: .98rem; }
.nav-links a { text-decoration: none; color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color .2s; }
.nav-links a:hover { border-bottom-color: var(--teal); }
.lang {
  font: 600 .9rem/1 var(--sans); color: var(--teal);
  background: transparent; border: 1.5px solid var(--teal); border-radius: 999px;
  min-width: 44px; height: 36px; padding: 0 12px; cursor: pointer;
  transition: background .2s, color .2s;
}
.lang:hover { background: var(--teal); color: var(--sand); }
.nav-wa { display: none; }
@media (max-width: 720px) {
  .nav { gap: 10px; padding-block: 10px; }
  .nav-links { display: none; }
  .nav-mark img { height: 34px; }
  .lang { margin-inline-start: auto; height: 44px; min-width: 48px; }
  .nav-wa {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    color: var(--teal); box-shadow: inset 0 0 0 1.5px var(--teal); text-decoration: none;
  }
  .nav-wa:active { background: var(--teal); color: var(--sand); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: 999px;
  font: 700 1.1875rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s var(--ease);
}
.btn-accent { background: var(--terra); color: var(--white); box-shadow: 0 6px 18px -8px rgba(199, 91, 69, .7); }
.btn-accent:hover { background: #B44F3B; transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(199, 91, 69, .75); }
.btn-accent:active { transform: translateY(0); }
.btn-quiet { color: var(--ink); padding: 0 6px; font-weight: 600; font-size: 1.05rem; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; }
.btn-quiet:hover { text-decoration-color: var(--teal); }
.btn-lg { min-height: 64px; padding: 0 36px; font-size: 1.25rem; }

/* ---------- hero ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(28px, 6vh, 64px) var(--gutter) 40px; }
.hero-copy { max-width: 47rem; }
.hero h1 { font-size: clamp(2.35rem, 1.2rem + 4.2vw, 4.5rem); line-height: 1.3; color: var(--teal); }
:lang(en) .hero-copy { max-width: 60rem; }
:lang(en) .hero h1 { font-size: clamp(2.2rem, 1.1rem + 3.3vw, 4rem); line-height: 1.12; letter-spacing: -.01em; }
.lede { margin-top: 18px; font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); line-height: 1.7; max-width: 38rem; color: var(--ink); }
.actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

/* ---------- the route (shared by the hero and the examples) ---------- */
.route-figure { margin: clamp(36px, 6vh, 56px) 0 0; }
.route { position: relative; height: 300px; }
.route svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.route .local { stroke: rgba(23, 33, 31, .28); stroke-width: 4; stroke-linecap: round; fill: none; transition: stroke .6s var(--ease); }
.route .express {
  stroke: var(--teal); stroke-width: 12; stroke-linecap: round; fill: none;
  stroke-dasharray: 1 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.1s var(--ease) calc(var(--r, 0) * .28s);
}
.route[data-state="after"] .express { stroke-dashoffset: 0; }
.route[data-state="after"] .local { stroke: rgba(23, 33, 31, .16); }

.route ol { list-style: none; margin: 0; padding: 0; }
.st { position: absolute; width: 0; height: 0; }
.st .dot {
  position: absolute; left: 0; top: 0; translate: -50% -50%;
  width: 24px; height: 24px; border-radius: 50%; scale: .84;
  background: var(--sand); border: 3px solid var(--ink);
  transition: scale .5s var(--ease), background .4s, border-color .4s, box-shadow .4s;
  transition-delay: calc(.35s + var(--i) * .07s);
}
.st .lbl {
  position: absolute; width: var(--lw, 140px); translate: -50% 0; left: 0;
  text-align: center; line-height: 1.4;
}
.st.up .lbl { bottom: 26px; }
.st.down .lbl { top: 26px; }
.st .nm { display: block; font-weight: 500; font-size: .95rem; color: var(--ink); transition: color .4s; transition-delay: calc(.35s + var(--i) * .07s); }
.st .tg {
  display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.6;
  opacity: 0; translate: 0 4px;
  transition: opacity .4s var(--ease), translate .4s var(--ease);
  transition-delay: calc(.5s + var(--i) * .07s);
}
.st.up .tg { margin-top: 0; margin-bottom: 6px; }
.st.up .lbl { display: flex; flex-direction: column-reverse; align-items: center; }
.route[data-state="after"] .st .tg { opacity: 1; translate: 0 0; }

/* after: automated stations become express pass-through marks */
.route[data-state="after"] .st[data-kind="auto"] .dot { scale: .42; background: var(--sand); border-color: var(--sand); }
.route[data-state="after"] .st[data-kind="auto"] .nm { color: var(--muted-strong); }
.st[data-kind="auto"] .tg { background: var(--teal); color: var(--sand); }
/* checked by the team: an interchange ring */
.route[data-state="after"] .st[data-kind="review"] .dot { scale: 1.25; background: var(--sand); border: 5px solid var(--teal); box-shadow: inset 0 0 0 3px var(--sand), inset 0 0 0 7px var(--ink); }
.st[data-kind="review"] .tg { background: var(--sand); color: var(--teal); box-shadow: inset 0 0 0 1.5px var(--teal); }
/* kept by the team: a solid terminal */
.route[data-state="after"] .st[data-kind="human"] .dot { scale: 1; background: var(--ink); border: 4px solid var(--sand); box-shadow: 0 0 0 2.5px var(--ink); }
.st[data-kind="human"] .tg { background: var(--ink); color: var(--sand); }

/* vertical routes (narrow screens) */
.route.is-vertical .st .lbl { translate: 0 -50%; text-align: start; width: var(--lw); }
.route.is-vertical .st .lbl { inset-inline-start: 26px; left: auto; display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
[dir="ltr"] .route.is-vertical .st .lbl { left: 26px; }
[dir="rtl"] .route.is-vertical .st .lbl { right: 26px; left: auto; }
.route.is-vertical .st .tg { margin: 0; }

.route-bar {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  font-size: .95rem; color: var(--muted-strong);
}
.route-cap span:first-child { font-weight: 600; color: var(--ink); }
.route-tally { font-variant-numeric: tabular-nums; }
.switch { margin-inline-start: auto; display: inline-flex; padding: 4px; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.switch button {
  font: 600 .92rem/1 var(--sans); border: 0; background: transparent; color: var(--ink);
  padding: 10px 18px; border-radius: 999px; cursor: pointer; transition: background .25s, color .25s;
}
.switch button[aria-pressed="true"] { background: var(--teal); color: var(--sand); }

/* ---------- legend ---------- */
.legend-band { max-width: var(--max); margin: 0 auto; padding: clamp(56px, 9vh, 96px) var(--gutter) clamp(56px, 9vh, 96px); }
.legend-band h2 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); line-height: 1.35; color: var(--teal); max-width: 22ch; }
.legend { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px clamp(24px, 4vw, 56px); }
.legend li { padding-top: 22px; border-top: 2px solid var(--ink); }
.legend h3 { font-size: 1.65rem; line-height: 1.4; margin-top: 14px; }
.legend p { margin-top: 8px; color: var(--ink); max-width: 34ch; }
.key svg { width: 96px; height: 36px; overflow: visible; }
.key line { stroke-width: 4; stroke-linecap: round; }
.key-auto line { stroke: var(--teal); stroke-width: 10; }
.key-auto rect { fill: var(--sand); }
.key-review line { stroke: var(--teal); stroke-width: 10; }
.key-review circle:first-of-type { fill: var(--sand); stroke: var(--teal); stroke-width: 5; }
.key-review circle:last-of-type { fill: var(--sand); stroke: var(--ink); stroke-width: 2.5; }
.key-human line { stroke: rgba(23, 33, 31, .28); }
.key-human circle { fill: var(--ink); stroke: var(--sand); stroke-width: 3.5; }
@media (max-width: 820px) { .legend { grid-template-columns: 1fr; } .legend p { max-width: 46ch; } }

/* ---------- method: the four legs ---------- */
.method { background: var(--teal); color: var(--sand); }
.method > * { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.method { padding: clamp(64px, 11vh, 120px) 0; }
.method-head h2 { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem); line-height: 1.3; }
.method-head p { margin-top: 14px; font-size: 1.15rem; color: var(--sand-on-teal); max-width: 40rem; }
.legs { list-style: none; margin-top: 52px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(20px, 3vw, 40px); position: relative; }
.legs::before { content: ""; position: absolute; top: 13px; inset-inline: var(--gutter); height: 4px; border-radius: 4px; background: var(--sand); opacity: .35; }
.leg { position: relative; padding-top: 48px; }
.leg-stop { position: absolute; top: 2px; inset-inline-start: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); border: 5px solid var(--sand); }
.leg:last-child .leg-stop { background: var(--sand); box-shadow: 0 0 0 3px var(--teal), 0 0 0 5.5px var(--sand); }
.leg h3 { font-size: 1.9rem; line-height: 1.35; }
.leg p { margin-top: 10px; color: var(--sand); opacity: .92; max-width: 30ch; }
@media (max-width: 900px) {
  .legs { grid-template-columns: 1fr; gap: 34px; }
  .legs::before { top: 6px; bottom: 6px; height: auto; width: 4px; inset-inline-start: calc(var(--gutter) + 11px); inset-inline-end: auto; }
  .leg { padding-top: 0; padding-inline-start: 50px; }
  .leg p { max-width: 46ch; }
}

/* ---------- examples ---------- */
.examples { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 11vh, 120px) var(--gutter); }
.examples-head h2 { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem); line-height: 1.3; color: var(--teal); }
.examples-head p { margin-top: 12px; font-size: 1.1rem; max-width: 40rem; }
.tabs { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 10px; }
.tabs button {
  font: 600 1rem/1.2 var(--sans); color: var(--ink);
  background: transparent; border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 12px 20px; cursor: pointer; transition: background .25s, color .25s, border-color .25s;
}
.tabs button:hover { border-color: var(--teal); color: var(--teal); }
.tabs button[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: var(--sand); }
.route-figure--panel { margin-top: 30px; background: var(--white); border-radius: 28px; padding: clamp(18px, 3vw, 40px); box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(8, 50, 45, .35); }
.route-figure--panel .route-bar { border-top-color: var(--line); }
.route-figure--panel .switch { background: var(--sand); }
.route-figure--panel .st .dot { background: var(--white); }
.route-figure--panel .route[data-state="after"] .st[data-kind="auto"] .dot { background: var(--white); border-color: var(--white); }
.route-figure--panel .route[data-state="after"] .st[data-kind="review"] .dot { background: var(--white); box-shadow: inset 0 0 0 3px var(--white), inset 0 0 0 7px var(--ink); }
.route-figure--panel .route[data-state="after"] .st[data-kind="human"] .dot { border-color: var(--white); }

/* ---------- demo ---------- */
.demo {
  background: var(--teal-deep); color: var(--sand);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(32px, 6vw, 96px);
  padding: clamp(64px, 11vh, 120px) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.demo h2 { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem); line-height: 1.3; }
.demo p { margin-top: 16px; font-size: 1.12rem; color: var(--sand); opacity: .92; max-width: 34rem; }
.demo-route { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 0; position: relative; max-width: 30rem; }
.demo-route::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 9px; width: 8px; border-radius: 8px; background: var(--teal); }
.demo-route li { position: relative; padding: 9px 0; padding-inline-start: 44px; font-weight: 500; color: var(--sand); }
.demo-route li::before { content: ""; position: absolute; inset-inline-start: 7px; top: 50%; translate: 0 -50%; width: 12px; height: 12px; border-radius: 50%; background: var(--sand); }
.demo-route li.d-review::before { inset-inline-start: 0; width: 26px; height: 26px; background: var(--teal-deep); border: 5px solid var(--teal); box-shadow: inset 0 0 0 3px var(--teal-deep), inset 0 0 0 7px var(--sand); }

.phone { width: clamp(250px, 26vw, 320px); }
.phone-screen {
  position: relative; aspect-ratio: 9 / 16; border-radius: 40px; overflow: hidden;
  background: #04201D;
  box-shadow: 0 0 0 10px #04201D, 0 0 0 11.5px var(--hair-on-teal), 0 40px 70px -30px rgba(0, 0, 0, .6);
}
.phone-screen video { width: 100%; height: 100%; object-fit: cover; }
.phone-tag { position: absolute; top: 16px; inset-inline-start: 16px; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(8, 50, 45, .82); color: var(--sand); }
.sound {
  position: absolute; bottom: 16px; inset-inline-start: 50%; translate: 50% 0;
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .85rem/1 var(--sans); color: var(--sand);
  background: rgba(8, 50, 45, .86); border: 1px solid var(--hair-on-teal); border-radius: 999px;
  padding: 10px 16px; cursor: pointer; white-space: nowrap;
}
[dir="ltr"] .sound { translate: -50% 0; }
.sound .ico { width: 18px; height: 18px; }
.sound .sound-on { display: none; }
.sound[aria-pressed="true"] .sound-on { display: inline; }
.sound[aria-pressed="true"] .sound-off { display: none; }
@media (max-width: 820px) {
  .demo { grid-template-columns: 1fr; justify-items: center; }
  .demo-copy { justify-self: stretch; }
  .phone { width: min(78vw, 300px); }
}

/* ---------- close + footer ---------- */
.close { background: var(--teal); color: var(--sand); text-align: center; padding: clamp(72px, 13vh, 140px) var(--gutter); display: flex; flex-direction: column; align-items: center; }
.close h2 { font-size: clamp(2.4rem, 1.3rem + 4vw, 4.6rem); line-height: 1.25; }
.close p { margin-top: 16px; font-size: 1.15rem; max-width: 36rem; color: var(--sand); opacity: .92; }
.close .btn { margin-top: 32px; }
.close-num { margin-top: 18px !important; font-size: 1.05rem; letter-spacing: .02em; color: var(--sand-on-teal); opacity: 1 !important; }
.foot {
  background: var(--teal-deep); color: var(--sand-on-teal);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px;
  padding: 28px var(--gutter); font-size: .92rem;
}
.foot img { height: 34px; width: auto; }
.foot a { color: var(--sand); }
.foot span:last-child { margin-inline-start: auto; }

/* ---------- mobile ---------- */
.dock { display: none; }
@media (max-width: 720px) {
  .hero { padding-top: 22px; }
  .hero h1 { font-size: clamp(2.05rem, 1.2rem + 4.6vw, 2.6rem); line-height: 1.35; }
  :lang(en) .hero h1 { font-size: clamp(1.95rem, 1.1rem + 4.4vw, 2.5rem); line-height: 1.15; }
  .lede { font-size: 1.06rem; }
  .actions { flex-direction: column; align-items: stretch; gap: 6px; }
  .actions .btn-accent { justify-content: center; padding-inline: 18px; font-size: 1.06rem; line-height: 1.3; text-align: center; }
  .dock .btn, .close .btn { padding-inline: 18px; }
  .actions .btn-quiet { align-self: center; min-height: 48px; }
  .route-figure { margin-top: 30px; }

  /* the route switch becomes a full-width, thumb-sized control */
  .route-bar { flex-direction: column; align-items: stretch; gap: 10px; font-size: .9rem; }
  .switch { margin-inline-start: 0; width: 100%; }
  .switch button { flex: 1; min-height: 44px; font-size: .95rem; }

  /* example tabs: one swipeable row instead of three stacked lines */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; white-space: nowrap; scroll-snap-align: start; min-height: 46px; }
  .route-figure--panel { border-radius: 22px; padding: 18px 16px; }

  .legend-band, .examples { padding-block: 56px; }
  .method, .demo { padding-block: 64px; }
  .legend { margin-top: 26px; gap: 22px; }
  .legend li { padding-top: 16px; }

  /* demo: headline, text, the phone, then the mini route */
  .demo { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .demo-copy { display: contents; }
  .demo h2 { order: 1; }
  .demo-copy > p { order: 2; }
  .phone { order: 3; align-self: center; margin-top: 36px; }
  .demo-route { order: 4; margin-top: 40px; }
  .sound { min-height: 44px; }

  .close { padding-block: 72px 96px; }
  .close .btn { width: 100%; justify-content: center; }
  .foot { padding-bottom: calc(28px + 76px + env(safe-area-inset-bottom)); }
  .foot a { display: inline-block; padding: 10px 0; }

  /* the WhatsApp action stays one thumb away once the hero button scrolls off */
  .dock {
    display: block; position: fixed; z-index: 30; inset-inline: 0; bottom: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--sand); box-shadow: 0 -1px 0 var(--line);
    translate: 0 110%; transition: translate .35s var(--ease);
  }
  .dock.is-on { translate: 0 0; }
  .dock .btn { width: 100%; justify-content: center; min-height: 52px; font-size: 1.08rem; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) { .dock { transition: none; } }
