html, body { background: #F4F3F8; color: #16151C; }

:root {
  --paper: #F4F3F8;
  --stone: #E9E7F0;
  --card: #FBFAFD;
  --ink: #16151C;
  --ink-2: #4A4857;
  --ink-3: #6B6879;
  --line: #CFCCDA;
  --accent: #6D28D9;
  --night: #0B0A12;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(20px, 5vw, 72px);
}
html[lang='ar'] { --font-sans: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
html[lang='ar'] body { letter-spacing: 0; line-height: 1.7; }
h1, h2, h3, p, ol, ul, dl, dd, figure, pre { margin: 0; }
a { color: inherit; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--paper); border-radius: 999px; }
.skip:focus { top: 12px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
html[lang='ar'] .eyebrow { font-family: var(--font-sans); letter-spacing: 0; font-size: 0.875rem; font-weight: 600; }

h1 {
  font-size: clamp(44px, 7.2vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 600;
}
h2 {
  font-size: clamp(32px, 4.6vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
}
html[lang='ar'] h1, html[lang='ar'] h2 { letter-spacing: 0; line-height: 1.15; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; color: var(--accent); }
html[lang='ar'] .serif { font-family: var(--font-sans); font-style: normal; font-weight: 700; }
.lede { font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); max-width: 34em; margin-top: 28px; }
.note { font-size: 0.875rem; color: var(--ink-3); margin-top: 18px; }

/* Actions are pills. */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.pill:hover { background: var(--accent); }
.pill:active { transform: scale(0.98); }
.pill--small { min-height: 40px; padding: 0 18px; font-size: 0.875rem; }
.pill--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.pill--ghost:hover { background: var(--stone); }
.pill--light { background: var(--paper); color: var(--ink); }
.pill--light:hover { background: #fff; }
.pill--ghost-light { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px rgba(244, 243, 248, 0.35); }
.pill--ghost-light:hover { background: rgba(244, 243, 248, 0.08); }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  background: rgba(244, 243, 248, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(22, 21, 28, 0.06);
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; min-height: 44px; }
.nav__links { display: flex; align-items: center; gap: clamp(8px, 2vw, 28px); }
.nav__links > a:not(.pill) { text-decoration: none; color: var(--ink-2); font-size: 0.95rem; padding: 10px 4px; }
.nav__links > a:not(.pill):hover { color: var(--ink); }
.nav__lang {
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--stone); color: var(--ink); font: 500 0.875rem var(--font-sans);
}
html[lang='en'] .nav__lang { font-family: 'IBM Plex Sans Arabic', var(--font-sans); }

/* Hero */
.hero {
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center; gap: clamp(32px, 6vw, 96px);
  padding: 120px var(--pad) 72px;
  max-width: 1440px; margin: 0 auto;
}
.js .hero__copy > * { animation: rise 800ms var(--ease-out) both; }
.js .hero__copy > :nth-child(2) { animation-delay: 70ms; }
.js .hero__copy > :nth-child(3) { animation-delay: 140ms; }
.js .hero__copy > :nth-child(n + 4) { animation-delay: 210ms; }
.js .status { animation: rise 1200ms var(--ease-out) 200ms both; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 24px, 0); } }

/* The app's status card, drawn with type: the page's one piece of "media". */
.status {
  background: var(--card);
  border-radius: 28px;
  padding: 28px;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(22, 21, 28, 0.06), 0 24px 60px -24px rgba(45, 30, 90, 0.22);
  max-width: 420px; justify-self: end; width: 100%;
}
.status__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.status__title { font-weight: 600; font-size: 1.25rem; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--stone); font-size: 0.8125rem; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.14); }
.status__rows { display: grid; gap: 2px; }
.status__rows > div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--stone); }
.status__rows dt { color: var(--ink-2); }
.status__label { margin-top: 20px; font-size: 0.8125rem; color: var(--ink-3); }
.status__addr { font-size: clamp(20px, 2vw, 26px); font-weight: 500; margin-top: 4px; }
.status__dl { margin-top: 22px; padding: 16px; border-radius: 6px; background: var(--paper); }
.status__dlhead { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 10px; }
.bar { height: 6px; border-radius: 999px; background: var(--stone); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* The pinned route */
.stage { position: relative; height: 380svh; }
.stage__pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 96px var(--pad) 40px;
  max-width: 1440px; margin: 0 auto;
}
.route__head h2 { max-width: 12em; }
.readout {
  position: absolute; top: 104px; inset-inline-end: var(--pad);
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
html[lang='ar'] .readout { letter-spacing: 0.04em; }
.readout .gb { color: var(--ink); }
.route { direction: ltr; unicode-bidi: isolate; width: 100%; height: 100%; min-height: 0; align-self: center; color: var(--ink); overflow: visible; }
.route--tall { display: none; }
.legs path { stroke: var(--accent); stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.legs path:first-child { stroke: var(--ink); }
.nodes circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2; transition: fill 300ms var(--ease-out), stroke 300ms var(--ease-out); }
.nodes .is-on circle { fill: var(--accent); stroke: var(--accent); }
.nodes text { font: 600 22px var(--font-sans); fill: var(--ink); letter-spacing: -0.01em; }
.nodes .port { font: 500 16px var(--font-mono); fill: var(--ink-3); }
.rider circle { fill: var(--accent); }
.rider .rider__halo { opacity: 0.18; }
.route__foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 24px 40px; }
.steps { list-style: none; padding: 0; display: flex; gap: 6px; grid-column: 1 / -1; }
.steps li { width: 40px; height: 3px; border-radius: 999px; background: var(--line); transition: background-color 300ms var(--ease-out); }
.steps li.is-on { background: var(--accent); }
.step { display: flex; gap: 20px; grid-column: 1 / 3; max-width: 640px; }
.step__k { font-size: 0.875rem; color: var(--accent); padding-top: 6px; }
.step__title { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -0.02em; line-height: 1.1; }
.step__body { color: var(--ink-2); margin-top: 8px; min-height: 3.1em; }
.file { font-size: 0.8125rem; color: var(--ink-2); background: var(--card); padding: 10px 14px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--stone); white-space: nowrap; }
.file.is-done { color: var(--accent); }
.apron { position: absolute; inset: auto 0 0; height: 1px; background: var(--paper); }

/* Ordinary sections */
.section { padding: clamp(80px, 12vw, 160px) var(--pad); max-width: 1440px; margin: 0 auto; }
.cards { list-style: none; padding: 0; margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: 28px; padding: 28px; box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(22, 21, 28, 0.05); }
.card h3 { font-size: 1.375rem; letter-spacing: -0.02em; margin: 18px 0 8px; }
.card p:last-child { color: var(--ink-2); }
.card__port { display: inline-block; font-size: 0.8125rem; padding: 4px 10px; border-radius: 4px; background: var(--stone); }
.card--quiet { background: transparent; box-shadow: inset 0 0 0 1.5px var(--stone); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(48px, 8vw, 120px); padding-top: 0; }
.setup { margin-top: 36px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 4px; }
.setup li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; padding: 16px 0; border-top: 1px solid var(--stone); }
.setup li::before { content: counter(s, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent); padding-top: 3px; }
.tree { margin-top: 36px; padding: 28px; border-radius: 28px; background: var(--night); color: #E8E6F0; font-size: clamp(12px, 1.2vw, 15px); line-height: 1.9; overflow-x: auto; }
.tree span { color: #9C98AE; }

/* Closing band */
.close { background: var(--night); color: var(--paper); padding: clamp(72px, 10vw, 140px) 0 48px; }
.close__inner { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }
.close__fit { overflow: hidden; }
.wordmark { display: inline-block; white-space: nowrap; line-height: 0.85; letter-spacing: -0.04em; font-weight: 700; font-size: 12vw; }
.close__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 28px; border-top: 1px solid rgba(244, 243, 248, 0.14); }
.close__row > p { color: #B7B4C6; max-width: 32em; }
.close__row .actions { margin-top: 0; }

/* Reveals: hidden only once script has run. */
.js [data-reveal] {
  opacity: 0; transform: translate3d(0, 24px, 0);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 112px; min-height: auto; }
  .status { justify-self: start; }
  .cards, .split { grid-template-columns: 1fr; }
  .nav__links > a:not(.pill) { display: none; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .route--wide { display: none; }
  .route--tall { display: block; }
  .stage__pin { padding: 84px var(--pad) 28px; }
  .readout { position: static; margin-top: 10px; }
  .route__head h2 { font-size: 34px; }
  .route__foot { grid-template-columns: 1fr; gap: 14px; }
  .step { grid-column: 1; }
  .step__body { font-size: 0.95rem; min-height: 4.6em; }
  .file { font-size: 0.6875rem; justify-self: start; }
  .nodes text { font-size: 24px; }
}
@media (max-height: 760px) and (max-width: 700px) {
  .step__body { min-height: 0; }
  .file { display: none; }
}
@media (hover: none) { .pill:hover { background: var(--ink); } .pill--ghost:hover, .pill--light:hover, .pill--ghost-light:hover { background: transparent; } .pill--light:hover { background: var(--paper); } }
@media (prefers-reduced-motion: reduce) {
  .js .hero__copy > *, .js .status { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .nodes circle, .steps li, .pill { transition: none; }
}
html[lang='ar'] .readout [data-k] { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; }
