/* ─────────────────────────────────────────────────────────────────────────
   Refresh: floating glass header, night-map background, slim web-app pill.
   Loaded after styles.css so it overrides without rewriting it.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --glass: rgba(255, 255, 255, .045);
  --glassb: rgba(255, 255, 255, .11);
  --map-line: rgba(232, 236, 245, .045);
  --map-road: rgba(232, 236, 245, .075);
}

/* ── Background ───────────────────────────────────────────────────────────
   Three quiet layers on the dark ground, nothing saturated and nothing large
   moving. Mature is mostly restraint: the city is barely there, and the only
   colour is the lime of a few courier routes. */

html { background: var(--bg); }
body { background: transparent; }

.bgfx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* One cool light from above-right, like a lit district at night, and a
     colder pool bottom-left for depth. Far below the old blobs' 34%. */
  background:
    radial-gradient(1100px 700px at 72% -8%, rgba(201, 238, 10, .045), transparent 62%),
    radial-gradient(900px 640px at 6% 108%, rgba(70, 92, 170, .06), transparent 60%),
    var(--bg);
}

/* --map-fade is driven by bgfx.js: the city is at full strength in the
   first screen and steps back to under half once you scroll into the
   content, so it never competes with a section's cards. Opacity on its own
   layer, so the fade costs a composite, not a repaint. */
.bgfx svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: var(--map-fade, 1);
  will-change: opacity;
}

.bgfx svg path, .bgfx svg circle { vector-effect: non-scaling-stroke; }
.bgfx-minor { fill: none; stroke: var(--map-line); stroke-width: 1; }
.bgfx-major { fill: none; stroke: var(--map-road); stroke-width: 1.5; }

/* The ground colour, nudged toward blue, so the water reads as a gap in the
   city rather than as a shape painted on it. */
.bgfx-river { fill: #070b16; stroke: rgba(120, 150, 210, .07); stroke-width: 1.2; }

.bgfx-route {
  fill: none;
  stroke: rgba(201, 238, 10, .36);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1.5 10;
  animation: bgfx-travel 9s linear infinite;
}
.bgfx-stop { fill: rgba(201, 238, 10, .6); }
.bgfx-ping {
  fill: none;
  stroke: rgba(201, 238, 10, .4);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: bgfx-ping 6s ease-out infinite;
}

@keyframes bgfx-travel { to { stroke-dashoffset: -115; } }
@keyframes bgfx-ping {
  0%   { transform: scale(1);  opacity: .9; }
  70%  { transform: scale(6);  opacity: 0; }
  100% { transform: scale(6);  opacity: 0; }
}

/* Grain. Removes the banding dark gradients get on cheap screens, and gives
   the ground a printed, physical feel rather than flat digital black. */
.bgfx::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Motion is a desktop luxury. Every glass card re-blurs whatever moves behind
   it, and on the low-end Android phones most visitors here use, that is a
   frame-rate cost for a flourish. Phones get the same map, standing still. */
@media (max-width: 860px), (prefers-reduced-motion: reduce) {
  .bgfx-route, .bgfx-ping { animation: none; }
  .bgfx-ping { display: none; }
}

/* ── Header ───────────────────────────────────────────────────────────────
   A floating glass pill that stays with you, from the proposal.

   Scoped by class, never the bare `nav` element: the legal pages carry a
   second <nav> for their table of contents, and a bare selector turned it
   into a sticky floating pill. The homepage's header is <nav class=
   "site-nav">; the other pages keep their own <header class="nav"> markup
   (it carries the language switcher and its i18n hooks), and the pill is
   drawn on its inner row instead. */

.site-nav,
header.nav > .nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 9px 10px 9px 18px;
  border-radius: 999px;
  background: rgba(14, 16, 28, .55);
  border: 1px solid var(--glassb);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 40px rgba(0, 0, 0, .35);
}

.site-nav,
header.nav {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 50;
  margin: 12px 0 0;
}

/* The inner row is also a .wrap, whose page gutter would otherwise become the
   pill's padding. The gutter moves out to the header instead, so the pill
   sits exactly where the homepage's does. */
header.nav { padding: 0 clamp(20px, 5vw, 96px); }
header.nav > .nav__inner { max-width: none; margin: 0; }

.site-nav .btn, header.nav .nav__cta { min-height: 42px; padding: 10px 22px; white-space: nowrap; flex: none; }
.brand { white-space: nowrap; min-width: 0; }
html { scroll-padding-top: calc(88px + env(safe-area-inset-top, 0px)); }

@media (max-width: 520px) {
  header.nav { padding: 0 16px; }
  .site-nav, header.nav > .nav__inner { gap: 8px; padding: 6px 6px 6px 12px; }
  .brand { font-size: clamp(13px, 4.1vw, 16px); gap: 7px; }
  .mk { height: clamp(26px, 8vw, 34px); }
  .site-nav .btn, header.nav .nav__cta {
    font-size: clamp(12px, 3.5vw, 14px);
    padding: 0 clamp(12px, 4vw, 18px);
    min-height: 38px;
  }
}

/* ── Web-app pill ─────────────────────────────────────────────────────────
   Was a 480px card with a heading, a sentence, a URL, a lime border and a
   glow. Now: why, the action, and a way out — on one line. */

.ios-float {
  /* Centred with auto margins, not translateX(-50%): the page's shared `in`
     entrance animates `transform`, which would override a transform-based
     centre for the length of the animation — the pill slid in half its
     width off to the right and then snapped back. */
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  background: rgba(14, 16, 28, .72);
  border: 1px solid var(--glassb);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 40px rgba(0, 0, 0, .5);
  z-index: 60;
  animation: in .4s ease;
}
.ios-float__text { font-size: 14px; color: var(--mute); white-space: nowrap; margin-right: 6px; }
.ios-float__btn {
  background: var(--lime);
  color: #0a0b10;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.ios-float__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mute);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.ios-float__close:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }

/* On an iPhone the "Get it on Google Play" bar is useless, and it sat in the
   same spot as this pill — the two stacked on top of each other. Off for
   everyone who is not on Android. */
.not-android a.sticky { display: none !important; }

@media (max-width: 420px) {
  .ios-float__text { display: none; } /* the button says enough on a phone */
  .ios-float { padding-left: 6px; }
}
