/* ═══════════════════════════════════════════════════════════════════════════
   Kweli Corridor Network — shell.

   Every colour resolves to the PLATFORM token scale via theme.css, generated
   from web/src/index.css. Nothing here invents a brand value.

   Rich, but built for the actual reader: Android 280 / iOS 87 / desktop 24 of
   391 measured arrivals, often outdoors on a mid-range phone. So depth comes
   from gradients and layered shadow — which cost nothing — never from heavy
   imagery or webfonts (CSP is font-src 'self', and a 200 KB font is a second
   of someone's data).
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; line-height: 1.6;
  color: hsl(var(--text-primary));
  background: hsl(var(--surface));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* Skip link, hidden by CLIPPING rather than by `left: -9999px`.
   🔴 Measured: the old rule was the only element on the page extending past the viewport — it made
   `documentElement.scrollWidth` 749 against a 624px viewport. `body { overflow-x: hidden }` hides the
   symptom on most browsers and does not remove the overflow, and this is a page whose audience is
   almost entirely on phones. Clipping keeps it reachable by keyboard and screen reader with zero
   layout footprint. */
.skip {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
  background: hsl(var(--brand)); color: #fff; z-index: 100;
}
.skip:focus {
  position: fixed; left: 0; top: 0; width: auto; height: auto;
  clip-path: none; padding: .75rem 1rem; border-radius: 0 0 8px 0;
}
:where(a, button):focus-visible { outline: 3px solid hsl(var(--brand-gold)); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* ── header: glass, and it earns the blur by sitting over the aurora ─────── */
.hdr {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .65rem clamp(1rem, 4vw, 2rem);
  background: hsl(var(--background) / .72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid hsl(var(--border) / .8);
}
.hdr__brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.hdr__mark { border-radius: 9px; box-shadow: 0 2px 8px hsl(var(--brand) / .28); }
.hdr__name { font-weight: 750; letter-spacing: -.025em; line-height: 1.05; display: flex; flex-direction: column; }
.hdr__sub { font-size: .64rem; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: hsl(var(--text-muted)); }
.hdr__nav { display: flex; gap: .2rem; }
.hdr__nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem;
  border-radius: 10px; text-decoration: none; font-size: .94rem; font-weight: 600;
  color: hsl(var(--text-secondary)); transition: background .18s, color .18s;
}
.hdr__nav a:hover { background: hsl(var(--brand) / .09); color: hsl(var(--brand)); }
@media (max-width: 430px) { .hdr__sub { display: none; } .hdr__nav a { padding: 0 .6rem; font-size: .88rem; } }

/* ── the aurora: brand-coloured light behind the hero ────────────────────── */
/* 🔴 `overflow: clip` is load-bearing, not tidiness. The ::before below bleeds -20% past both edges to
   throw light outside the hero, and that bleed made the whole PAGE scroll sideways by 125px on a
   phone-width viewport. It was invisible to an element scan — a pseudo-element is not in the DOM — and
   `body { overflow-x: hidden }` did not contain it because `html` is the scroll container here. Found
   by asking the page to scroll right and watching it comply.
   `clip` rather than `hidden`: it does not create a scroll container, so nothing sticky breaks. */
.hero {
  position: relative; overflow: clip;
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(2.5rem, 7vw, 4.5rem); isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: -30% -20% auto -20%; height: 150%; z-index: -2;
  background:
    radial-gradient(42% 55% at 18% 12%, hsl(var(--brand) / .30), transparent 62%),
    radial-gradient(38% 50% at 82% 4%,  hsl(var(--brand-gold) / .22), transparent 60%),
    radial-gradient(46% 60% at 60% 78%, hsl(var(--brand-strong) / .20), transparent 66%);
  filter: blur(18px);
}
/* corridor motif — the lines the whole product is about */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(hsl(var(--brand) / .07) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--brand) / .07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(75% 65% at 50% 35%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(75% 65% at 50% 35%, #000 30%, transparent 78%);
}

/* Hero layout: copy left, the real corridor map right. Single column below 900px — the map is a
   portrait 1200x1677 and beside a headline on a phone it would be a stripe. */
.hero__grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.08fr .92fr; } }

.hero__map { margin: 0; position: relative; }
/* currentColor drives every stroke in the SVG, so the map inherits the brand here and nowhere else.
   This only works because the SVG is INLINED — an <img>-loaded SVG cannot see this rule. */
.hero__map svg {
  color: hsl(var(--brand));
  display: block; width: 100%; height: auto; max-width: 384px; margin-inline: auto;
  filter: drop-shadow(0 16px 34px hsl(var(--brand) / .26));
}
/* The corridors draw themselves in. Every path carries pathLength="1", so one rule animates all 197
   at the same rate whatever their real length. Domestic legs fade up as the substrate; the
   cross-border legs — the ones a WhatsApp group handles worst — draw over the top of them.
   Honoured only where motion is welcome; the reduced-motion block at the end of this file stops it. */
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }

.hero__map svg .x {
  stroke-dasharray: 1;
  animation: draw 2.2s cubic-bezier(.4, 0, .2, 1) .25s both;
}
.hero__map svg .d { animation: fade 1.6s ease-out both; }
.hero__map svg circle { animation: fade 1.2s ease-out 1.5s both; }

.hero__map figcaption {
  margin-top: 1rem; text-align: center; font-size: .88rem; color: hsl(var(--text-secondary));
}
.hero__map figcaption strong { color: hsl(var(--brand)); font-weight: 750; }
@media (max-width: 899px) { .hero__map svg { max-width: 300px; } }

/* Product roots lead with their own lockup above the headline; the network root leads with the
   eyebrow. Height-capped so a wide lockup cannot dominate the h1 beneath it. */
.hero__lockup { height: 58px; width: auto; margin-bottom: 1.4rem; }
@media (max-width: 560px) { .hero__lockup { height: 46px; } }

.hero h1 {
  margin: 0 0 1.1rem; max-width: 15ch;
  font-size: clamp(2.4rem, 8vw, 4.2rem); line-height: 1.02;
  letter-spacing: -.04em; font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(103deg, hsl(var(--brand)) 0%, hsl(var(--brand-gold)) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lede { margin: 0 0 2.2rem; font-size: clamp(1.06rem, 2.6vw, 1.32rem); color: hsl(var(--text-secondary)); max-width: 54ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: hsl(var(--brand)); margin: 0 0 1rem;
  padding: .35rem .75rem; border-radius: 999px;
  background: hsl(var(--brand) / .10); border: 1px solid hsl(var(--brand) / .22);
}

/* ── buttons with weight ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 54px; padding: 0 1.7rem; border-radius: 12px;
  font-weight: 650; font-size: 1.02rem; text-decoration: none; border: 1px solid transparent;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--brand)) 0%, hsl(var(--brand-strong)) 100%);
  box-shadow: 0 6px 20px hsl(var(--brand) / .34), inset 0 1px 0 hsl(0 0% 100% / .18);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px hsl(var(--brand) / .42), inset 0 1px 0 hsl(0 0% 100% / .18); }
.btn--ghost { border-color: hsl(var(--border)); color: hsl(var(--text-primary)); background: hsl(var(--card) / .8); backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: hsl(var(--brand) / .5); background: hsl(var(--card)); transform: translateY(-2px); }

/* ── bands ───────────────────────────────────────────────────────────────── */
.band { position: relative; padding: clamp(3rem, 8vw, 5.5rem) 0; }
.band--tint { background: hsl(var(--surface-secondary)); border-block: 1px solid hsl(var(--border) / .6); }
.band h2 { margin: 0 0 .85rem; font-size: clamp(1.65rem, 4.4vw, 2.4rem); letter-spacing: -.03em; line-height: 1.12; max-width: 010ch; max-width: 24ch; font-weight: 780; }
.band__lede { margin: 0 0 2.4rem; color: hsl(var(--text-secondary)); max-width: 62ch; font-size: 1.04rem; }

.grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--2 { grid-template-columns: repeat(2, 1fr); } }

/* ── cards: elevation + a gradient hairline on hover ─────────────────────── */
.card {
  position: relative; background: hsl(var(--card));
  border: 1px solid hsl(var(--border)); border-radius: 16px; padding: 1.6rem;
  box-shadow: 0 1px 2px hsl(var(--foreground) / .04), 0 8px 24px -12px hsl(var(--foreground) / .10);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card h3 { margin: 0 0 .55rem; font-size: 1.12rem; letter-spacing: -.015em; font-weight: 700; }
.card p { margin: 0; color: hsl(var(--text-secondary)); font-size: .98rem; }

.prod { display: block; text-decoration: none; }
.prod:hover { transform: translateY(-4px); border-color: hsl(var(--brand) / .55);
  box-shadow: 0 2px 4px hsl(var(--foreground) / .05), 0 22px 44px -20px hsl(var(--brand) / .42); }
/* ── the two-sided card: transporter | cargo owner ────────────────────────
   The root sells a MARKETPLACE, so both sides have to be visible above the
   fold of the first band. Same card chrome as .prod, with an audience label
   above the heading so a visitor self-selects in one glance. */
.side { display: block; text-decoration: none; }
.side:hover { transform: translateY(-4px); border-color: hsl(var(--brand) / .55);
  box-shadow: 0 2px 4px hsl(var(--foreground) / .05), 0 22px 44px -20px hsl(var(--brand) / .42); }
.side__who {
  margin: 0 0 .55rem; font-size: .72rem; font-weight: 750; letter-spacing: .11em;
  text-transform: uppercase; color: hsl(var(--brand));
}
.side h3 { font-size: 1.3rem; }
.side__go {
  display: inline-block; margin-top: 1.1rem; font-weight: 650; font-size: .95rem;
  color: hsl(var(--brand));
}
.card:hover .side__go { text-decoration: underline; }

/* The product lockup sits above the card's own words. Height-constrained rather than width-constrained
   so the four cards line up optically even though the lockups are different widths. */
.prod__logo { height: 50px; width: auto; margin-bottom: 1.05rem; }
.prod--soon .prod__logo { filter: grayscale(.45); }

.prod__tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; padding: .26rem .6rem; border-radius: 999px; margin-bottom: .85rem;
}
.prod__tag--live { background: hsl(var(--brand) / .13); color: hsl(var(--brand)); border: 1px solid hsl(var(--brand) / .26); }
.prod__tag--soon { background: hsl(var(--text-muted) / .12); color: hsl(var(--text-muted)); border: 1px solid hsl(var(--text-muted) / .22); }
.prod--soon { opacity: .74; }

/* ── getting started: the honest "here is what we will ask" card ──────────
   Numbered because the order is the actual product order, and because a
   transporter reading on a phone in a yard needs to see how short it is. */
.start { display: flex; flex-direction: column; }
.start__steps { margin: 0 0 1.4rem; padding-left: 1.3rem; color: hsl(var(--text-secondary)); }
.start__steps li { margin-bottom: .7rem; }
.start__steps li:last-child { margin-bottom: 0; }
.start__steps strong { color: hsl(var(--text-primary)); }
.start__btn { margin-top: auto; align-self: flex-start; }
.start__note {
  margin: 1.6rem 0 0; text-align: center; font-size: .92rem; color: hsl(var(--text-muted));
}

/* ── proof numbers: gradient display type ────────────────────────────────── */
.stat { position: relative; padding-left: 1.15rem; }
.stat::before { content: ""; position: absolute; left: 0; top: .35rem; bottom: .35rem; width: 3px; border-radius: 3px;
  background: linear-gradient(hsl(var(--brand)), hsl(var(--brand-gold))); }
.stat__n {
  display: block; font-size: clamp(2rem, 5.5vw, 2.9rem); font-weight: 820; letter-spacing: -.035em; line-height: 1.05;
  background: linear-gradient(120deg, hsl(var(--brand)) 0%, hsl(var(--brand-strong)) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__l { color: hsl(var(--text-secondary)); font-size: .95rem; display: block; margin-top: .3rem; }

/* ── the contrast block ──────────────────────────────────────────────────── */
.vs { display: grid; gap: 1.1rem; }
@media (min-width: 760px) { .vs { grid-template-columns: 1fr 1fr; } }
.vs__col { border-radius: 16px; padding: 1.6rem; border: 1px solid hsl(var(--border)); }
.vs__col--them { background: hsl(var(--surface-tertiary)); }
.vs__col--us {
  background: linear-gradient(165deg, hsl(var(--card)) 0%, hsl(var(--brand) / .06) 100%);
  border-color: hsl(var(--brand) / .42);
  box-shadow: 0 18px 40px -24px hsl(var(--brand) / .5);
}
.vs__h { margin: 0 0 .9rem; font-size: .76rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; color: hsl(var(--text-muted)); }
.vs__col--us .vs__h { color: hsl(var(--brand)); }
.vs ul { margin: 0; padding-left: 1.15rem; }
.vs li { margin-bottom: .6rem; color: hsl(var(--text-secondary)); }
.vs li:last-child { margin-bottom: 0; }

/* ── footer ──────────────────────────────────────────────────────────────── */
.ftr { position: relative; background: hsl(var(--surface-secondary)); border-top: 1px solid hsl(var(--border)); padding: 3.5rem 0 2rem; margin-top: 4rem; }
.ftr::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, hsl(var(--brand) / .55), hsl(var(--brand-gold) / .45), transparent); }
.ftr__grid { width: min(1120px, 100% - 2.5rem); margin-inline: auto; display: grid; gap: 2.2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .ftr__grid { grid-template-columns: 2fr 1fr 1fr; } }
.ftr__logo { height: 46px; width: auto; margin-bottom: .9rem; }
.ftr__note { margin: 0; color: hsl(var(--text-secondary)); font-size: .94rem; max-width: 46ch; }
.ftr__h { font-size: .73rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; color: hsl(var(--text-muted)); margin: 0 0 .7rem; }
.ftr nav a { display: block; min-height: 42px; line-height: 42px; text-decoration: none; color: hsl(var(--text-secondary)); font-size: .95rem; transition: color .15s; }
.ftr nav a:hover { color: hsl(var(--brand)); }
.ftr__legal { width: min(1120px, 100% - 2.5rem); margin: 2.4rem auto 0; padding-top: 1.6rem; border-top: 1px solid hsl(var(--border)); font-size: .85rem; color: hsl(var(--text-muted)); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .prod { transition: none; }
  .btn:hover, .prod:hover { transform: none; }
  /* The map must still be fully DRAWN, not just un-animated — `animation: none` on a path with
     stroke-dasharray:1 would leave it stuck at dashoffset 1, i.e. invisible. Reset the dash too. */
  .hero__map svg .x { animation: none; stroke-dasharray: none; }
  .hero__map svg .d, .hero__map svg circle { animation: none; }
}
