/* Relo site. Extends the console design system (docs/design/DESIGN.md):
   neutral layered surfaces, full hairline borders on rounded containers,
   translucent chrome, one accent, system-ui for UI and JetBrains Mono for
   data. Tokens only; sentence case; no one-sided borders. */

:root {
  color-scheme: light;
  /* Surfaces and text. */
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --raised: #ffffff;
  --sunken: #f5f5f7;
  --ink: #17171c;
  --muted: #6b6b78;
  --faint: #858592;
  --line: rgb(0 0 0 / 0.09);
  --line-strong: rgb(0 0 0 / 0.16);
  --hover: color-mix(in srgb, var(--ink) 4%, var(--surface));
  --shadow-color: rgb(20 20 40 / 0.1);
  --chrome: rgb(245 245 247 / 0.82);
  --scrim: rgb(10 10 14 / 0.55);
  /* Accent: the console default (red). The scale derives from it. */
  --accent-base: #c8102e;
  --on-accent: #fff;
  --shade: #000;
  --mixbase: var(--surface);
  --t50: 7%;
  --t100: 14%;
  --t200: 26%;
  --accent: var(--accent-base);
  --accent-50: color-mix(in oklab, var(--accent) var(--t50), var(--mixbase));
  --accent-100: color-mix(in oklab, var(--accent) var(--t100), var(--mixbase));
  --accent-200: color-mix(in oklab, var(--accent) var(--t200), var(--mixbase));
  --accent-600: color-mix(in oklab, var(--accent) 86%, var(--shade));
  --accent-700: color-mix(in oklab, var(--accent) 72%, var(--shade));
  --accent-800: color-mix(in oklab, var(--accent) 56%, var(--shade));
  --accent-soft: var(--accent-50);
  --accent-ink: var(--accent-800);
  --accent-border: color-mix(in oklab, var(--accent) 32%, var(--mixbase));
  --accent-glow: color-mix(in srgb, var(--accent) 30%, transparent);
  /* Fixed semantics, never the accent. */
  --ok: #19774e;
  --ok-bg: color-mix(in srgb, var(--ok) 12%, var(--surface));
  --warn: #9b5800;
  --warn-bg: color-mix(in srgb, var(--warn) 12%, var(--surface));
  --danger: #bd342a;
  /* Radius steps: controls 10, panels 12, cards 16, popovers 18. */
  --radius-sm: 0.5rem;
  --radius: 0.625rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.125rem;
  --pill: 9999px;
  /* Rhythm and control height. */
  --gutter: 1.75rem;
  --grid-gap: 1.125rem;
  --card-pad: 1.125rem;
  --control-h: 2.375rem;
  --control-h-sm: 2rem;
  /* Elevation from the surfaces table. */
  --shadow-1: 0 1px 2px rgb(20 20 30 / 0.04);
  --shadow-hover: 0 10px 28px var(--shadow-color);
  --shadow-pop: 0 18px 48px var(--shadow-color);
  --shadow-modal: 0 24px 60px var(--shadow-color);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0a0a0a;
  --surface: #111113;
  --raised: #1a1a1d;
  --sunken: #0a0a0a;
  --ink: #f2f2f5;
  --muted: #a3a3b0;
  --faint: #6f6f7c;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.16);
  --shadow-color: rgb(0 0 0 / 0.55);
  --chrome: rgb(10 10 10 / 0.72);
  --scrim: rgb(0 0 0 / 0.6);
  --shade: #fff;
  --t50: 12%;
  --t100: 22%;
  --t200: 34%;
  --accent: color-mix(in oklab, var(--accent-base) 72%, #fff);
  --on-accent: #0a0a0a;
  --ok: #4cc38a;
  --warn: #f0a93b;
  --danger: #ff7468;
}

@media (max-width: 640px) {
  :root { --gutter: 1rem; }
}

@media (pointer: coarse), (max-width: 640px) {
  :root {
    --control-h: 2.75rem;
    --control-h-sm: 2.75rem;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../media/fonts/jetbrains-mono-regular.ttf") format("truetype");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../media/fonts/jetbrains-mono-semibold.ttf") format("truetype");
}

.mono-data {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.625;
  font-variant-numeric: tabular-nums;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent-700); }
a:hover { color: var(--accent-600); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.dot { color: var(--accent-700); }

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 90;
  transform: translateY(-160%);
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible { transform: none; }

/* ---------- Preloader: the typed "Relo." ---------- */

/* ---------- Top bar: translucent chrome ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--gutter);
  background: var(--chrome);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--ink);
}

.nav-logo {
  color: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.nav-logo:hover { color: inherit; }
.nav-logo .dot { color: var(--accent-700); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-plain {
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  padding: 0 0.75rem;
}

/* Without scripts there is no dictionary either, so the language
   control has nothing to offer. */
html:not(.js) .lang { display: none; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toggle .ln {
  display: block;
  width: 28px;
  height: 1px;
  background: currentColor;
  transform-origin: 100% 50%;
  transition: transform 0.35s var(--ease);
}

.nav-toggle:hover .ln.top { transform: scaleX(0.72); }

.nav-toggle[aria-expanded="true"] .ln.top,
.nav-toggle[aria-expanded="true"]:hover .ln.top {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .ln.bot {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- Menu: left drawer ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--scrim);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0s linear 0.22s;
}

.menu.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.14s ease, visibility 0s;
}

.menu nav {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(320px, 86vw);
  padding: 84px var(--gutter) var(--gutter);
  background: var(--surface);
  transition: transform 0.26s var(--ease);
}

.menu.open nav {
  transform: translateX(0);
  transition-delay: 0s;
}

html[dir="rtl"] .menu nav { transform: translateX(30%); }
html[dir="rtl"] .menu.open nav { transform: translateX(0); }

.menu:not(.open) nav { transform: translateX(-100%); }

html[dir="rtl"] .menu:not(.open) nav { transform: translateX(-30%); }

.menu a {
  display: block;
  min-height: var(--control-h);
  padding: 0 0.75rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 2.3;
  text-decoration: none;
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.5s ease, translate 0.5s var(--ease), background 150ms ease;
}

.menu.open a {
  opacity: 1;
  translate: 0 0;
  transition-delay: calc(var(--i) * 50ms + 80ms), calc(var(--i) * 50ms + 80ms), 0s;
}

.menu a:hover { background: var(--hover); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  padding: 0 1rem;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, filter 150ms ease;
}

.btn:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

.btn:active { transform: scale(0.985); }

.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn.primary:hover {
  background: var(--accent-600);
  color: var(--on-accent);
  filter: none;
}

/* ---------- Layout helpers ---------- */

.section-title {
  margin: 0 0 12px;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.section-lead {
  margin: 0 0 28px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Hero ---------- */

.hero { padding: 120px 0 24px; }

.hero-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hero-title {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.hero-title > span { display: block; }

.hero-title .dot { display: inline; }

.hero-strong { color: var(--accent-700); }

.hero-lead {
  margin: 18px 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
  max-width: 760px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.stats li {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: 14px 16px;
}

.stat-num {
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------- Story: the scroll stage ---------- */

.story { position: relative; }

.story-pin {
  height: 640vh;
  position: relative;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  perspective: 1600px;
}

/* iPad Pro 13: a flat slab. The boot mark wakes into the card grid. */
.ipad {
  position: relative;
  width: min(880px, 92vw);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  padding: clamp(14px, 2.5vw, 26px);
  will-change: transform, opacity;
}

[data-theme="dark"] .ipad { background: var(--raised); }

.screen {
  position: relative;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sunken);
}

[data-theme="dark"] .screen { background: var(--canvas); }

.boot {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  /* Deliberate: a device boot screen stays black in both themes. */
  background: #0a0a0a;
  color: #f5f5f7;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.boot .dot { color: color-mix(in oklab, var(--accent-base) 72%, #fff); }

/* Connection cards fly in from the edges and settle into the screen. */
.cards {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  pointer-events: none;
}

.conn {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  will-change: transform, opacity;
}

.conn-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
}

.conn-logo img { width: 32px; height: 32px; }

.conn-id {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  max-width: calc(54% - 16px);
}

.conn-id strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Brand marks ship as black artwork; lift them in dark mode. */
[data-theme="dark"] .conn-logo img,
[data-theme="dark"] .fly img,
[data-theme="dark"] .logo-wall img,
[data-theme="dark"] .chips img { filter: invert(1); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.pill i {
  width: 6px;
  height: 6px;
  border-radius: var(--pill);
  background: currentColor;
}

.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }

.conn .pill {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  max-width: calc(46% - 12px);
  white-space: normal;
  line-height: 1.3;
}

.conn .pill span { min-width: 0; overflow-wrap: anywhere; }

.conn .pill i { flex-shrink: 0; }

.meter {
  position: absolute;
  inset-inline: 12px;
  bottom: 12px;
  height: 7px;
  border-radius: var(--pill);
  background: var(--accent-100);
  overflow: hidden;
}

.meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.meter b.is-warn { background: var(--warn); }

/* The bag: harness marks gather into it. */
.bag-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.bag {
  position: relative;
  z-index: 2;
  width: min(340px, 64vw);
  aspect-ratio: 340 / 300;
}

.bag-body {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid var(--line-strong);
  border-radius: 12px 12px 28px 28px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  display: grid;
  place-items: center;
}

.bag-word {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

[data-theme="dark"] .bag-body,
[data-theme="dark"] .fly { background: var(--raised); }

.bag-handle {
  position: absolute;
  top: -28%;
  left: 28%;
  width: 44%;
  height: 48%;
  border: 12px solid var(--muted);
  border-radius: 80px;
}

.flyers { position: absolute; inset: 0; z-index: 1; }

.fly {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  color: var(--ink);
  opacity: 0;
  will-change: transform, opacity;
}

.fly img { width: 30px; height: 30px; }

/* Captions: one readable line per scene. */
.captions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  justify-items: center;
  padding: 0 var(--gutter) max(20px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.cap {
  grid-area: 1 / 1;
  margin: 0 0 20px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--chrome);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.25s ease, translate 0.25s ease;
}

.cap.is-active { opacity: 1; translate: 0 0; }

.cue-arrow {
  display: inline-block;
  margin-inline-start: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .cap.is-active .cue-arrow { animation: cue-drop 1.6s ease-in-out infinite; }
}

@keyframes cue-drop {
  0%, 100% { transform: translateY(-2px); opacity: 0.65; }
  50% { transform: translateY(3px); opacity: 1; }
}

button.cap {
  font: inherit;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
}

button.cap:hover { border-color: var(--accent-border); }

button.cap:not(.is-active) { pointer-events: none; }

/* Static fallback: woken iPad and cards in place, without a scroll cue. */
.static-story .story-pin { height: auto; }

.static-story .stage {
  position: static;
  height: auto;
  padding: 40px var(--gutter);
  display: grid;
  gap: 28px;
}

.static-story .ipad { transform: none !important; opacity: 1 !important; }

.static-story .boot { display: none; }

.static-story .screen { aspect-ratio: auto; }

.static-story .cards {
  position: static;
  opacity: 1;
  pointer-events: auto;
}

.static-story .conn { opacity: 1 !important; transform: none !important; }

.static-story .conn { min-height: 160px; }

.static-story .bag-scene { display: none; }

.static-story .captions { display: none; }

/* ---------- Providers: the logo wall ---------- */

.providers,
.harness,
.install {
  max-width: 1360px;
  margin: 0 auto;
  padding: 88px var(--gutter) 0;
}

.logo-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo-wall li {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  transition: border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.logo-wall li:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-hover);
  color: var(--ink);
}

.logo-wall img { width: 26px; height: 26px; }

/* ---------- Harness chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--control-h);
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.chips li:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-hover);
}

.chips img { width: 20px; height: 20px; }

/* ---------- Install ---------- */

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 48px;
  align-items: start;
}

.display {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}

.command pre {
  margin: 0;
  padding: 10px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
}

.command code {
  font-size: 0.8rem;
  white-space: pre;
}

.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.copy:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--hover);
}

.copy:active { transform: scale(0.985); }

.copy .i-check,
.copy .i-fail { display: none; }

.copy[data-copied="true"] {
  border-color: var(--accent-border);
  color: var(--accent-700);
}

.copy[data-copied="true"] .i-copy,
.copy[data-copied="false"] .i-copy { display: none; }

.copy[data-copied="true"] .i-check,
.copy[data-copied="false"] .i-fail { display: block; }

.copy[data-copied="false"] {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Footer ---------- */

.footer {
  max-width: 1360px;
  margin: 80px auto 0;
  padding: 24px var(--gutter) 40px;
  color: var(--muted);
  font-size: 14px;
}

.footer p { margin: 0; }
.footer p + p { margin-top: 6px; }

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .install-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 767px) {
  .nav { height: 56px; }

  .hero { padding-top: 96px; }

  .stats { grid-template-columns: 1fr; }

  .hero-title { font-size: clamp(2rem, 10vw, 2.75rem); }

  .display { font-size: clamp(1.75rem, 8vw, 2.5rem); }

  .story-pin { height: 680vh; }

  .ipad { width: 94vw; }

  .screen { aspect-ratio: 3 / 4; }

  .cards { gap: 8px; padding: 10px; }

  .conn { padding: 8px 10px; }

  .conn-logo { width: 40px; height: 40px; }

  .conn-logo img { width: 24px; height: 24px; }

  .conn-id { inset-block-start: 8px; inset-inline-start: 5px; max-width: calc(54% - 7px); }

  .conn-id strong { font-size: 10px; line-height: 1.3; }

  .conn .pill { inset-block-start: 8px; inset-inline-end: 4px; max-width: calc(46% - 5px); padding: 2px 3px; font-size: 8px; gap: 2px; }

  .conn .pill i { width: 3px; height: 3px; }

  .meter { height: 5px; }
}

@media (max-width: 360px) {
  .ipad { padding: 10px; }

  .cards { gap: 6px; padding: 6px; }

  .conn-id strong { font-size: 9px; }

  .conn-logo { width: 28px; height: 28px; }

  .conn .pill { font-size: 7px; line-height: 1.15; padding: 2px; }

  .conn-logo img { width: 20px; height: 20px; }
}

/* ---------- Reduced behaviour ---------- */

@media (prefers-reduced-transparency: reduce) {
  .nav,
  .cap {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .btn:active,
  .copy:active { transform: none; }

  .menu,
  .menu a,
  .menu nav,
  .conn,
  .copy,
  .nav-toggle .ln { transition: none; }

  .menu a { opacity: 1; translate: 0 0; }
}

/* ---------- Languages ---------- */

code {
  direction: ltr;
  unicode-bidi: isolate;
}

.command,
.nav-logo { direction: ltr; }

html[dir="rtl"] .hero-strong {
  direction: ltr;
  text-align: end;
}

html[dir="rtl"] .nav-toggle .ln { transform-origin: 0 50%; }

/* Negative tracking breaks joined and ideographic scripts. */
html:is([lang="ar"], [lang="ur"], [lang="hi"], [lang="bn"], [lang="th"], [lang="ja"], [lang="ko"], [lang|="zh"]) body * {
  letter-spacing: 0;
}

html:is([lang="ru"], [lang="ja"]) .display {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

/* ==========================================================================
   Page layer
   One accent, layered neutral surfaces, and motion that stays out of the way.
   Everything animates transform, opacity or filter, so the whole page stays
   on the compositor.
   ========================================================================== */

:root {
  /* Glass and light. */
  --scan: color-mix(in srgb, var(--accent) 55%, #fff);
  --glass: color-mix(in srgb, var(--surface) 58%, transparent);
  --glass-strong: color-mix(in srgb, var(--surface) 88%, transparent);
  --glow: color-mix(in srgb, var(--accent) 42%, transparent);

  /* The terminal is dark on purpose, in both themes: it is a terminal. */
  --term-bg: #101014;
  --term-ink: #e9e9f2;
  --term-dim: #8b8b9d;
  --term-ok: #6fd79b;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.46, 0.64, 1);
}

/* ---------- The field ---------- */

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Navigation ---------- */

.nav {
  inset: 14px var(--gutter) auto;
  max-width: 1180px;
  height: 58px;
  margin-inline: auto;
  padding: 0 8px 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(170%);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  transition: height 320ms var(--ease-out-expo), background 320ms ease,
    box-shadow 320ms ease, border-color 320ms ease;
}

.nav.is-condensed {
  height: 50px;
  background: var(--glass-strong);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

/* How far down the page you are, measured along the bottom edge of the
   viewport: it belongs to the page, not to the navigation. The glow rides
   the filled part only, so the light reads as a head moving across the
   bottom of the screen rather than a lit frame. */
.page-progress {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 3;
  height: 3px;
  pointer-events: none;
}

.page-progress::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: calc(var(--p, 0) * 100%);
  background: linear-gradient(to right,
      color-mix(in srgb, var(--accent) 60%, transparent),
      var(--accent) 72%,
      var(--scan));
  box-shadow: 0 0 14px 2px var(--glow), 0 0 3px var(--accent);
}

.page-progress::after {
  content: "";
  position: absolute;
  bottom: -2px;
  inset-inline-start: calc(var(--p, 0) * 100%);
  width: 18px;
  height: 7px;
  border-radius: var(--pill);
  background: var(--scan);
  box-shadow: 0 0 18px 5px var(--glow), 0 0 34px 10px var(--glow);
  transform: translateX(-50%);
  opacity: calc(var(--p, 0) * 5);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h-sm);
  padding: 0 10px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 160ms ease;
}

.nav-icon:hover {
  background: var(--hover);
}

[data-theme-toggle] {
  position: relative;
  width: 34px;
  padding: 0;
}

[data-theme-toggle] svg {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 240ms ease, transform 320ms var(--ease-out-expo);
}

[data-theme-toggle] .i-moon { opacity: 0; transform: rotate(-45deg) scale(0.6); }

[data-theme="dark"] [data-theme-toggle] .i-sun { opacity: 0; transform: rotate(60deg) scale(0.6); }

[data-theme="dark"] [data-theme-toggle] .i-moon { opacity: 1; transform: none; }

.lang { position: relative; }

.lang-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lang-label { font-size: 13px; }

.lang-pop {
  position: absolute;
  inset-block-start: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 60;
  width: 214px;
  max-height: 330px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 200ms var(--ease-out-expo);
}

.lang-pop[hidden] { display: none; }

.lang-pop.is-open {
  opacity: 1;
  transform: none;
}

.lang-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: start;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.lang-item:hover { background: var(--hover); }

.lang-item[aria-selected="true"] {
  background: var(--accent-50);
  color: var(--accent-ink);
}

/* ---------- The hero ---------- */

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.hero-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.kinetic-word {
  display: inline-block;
  white-space: nowrap;
}

[data-kinetic] .c,
[data-words] .w {
  display: inline-block;
  animation: char-in 620ms var(--ease-out-expo) both;
  animation-delay: calc(var(--i) * 18ms + 90ms);
}

[data-words] .w {
  animation-duration: 520ms;
  animation-delay: calc(var(--i) * 22ms + 240ms);
}

@keyframes char-in {
  from { opacity: 0; translate: 0 0.3em; }
  to { opacity: 1; translate: 0 0; }
}

.ticker {
  margin: 20px 0 0;
  min-height: 1.3em;
  color: var(--muted);
  font-size: 12.5px;
  white-space: pre;
  overflow: hidden;
  text-overflow: clip;
}

.ticker-line {
  display: inline-block;
  opacity: 0;
  transition: opacity 320ms ease;
}

.ticker-line.is-in { opacity: 1; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 220ms ease;
}

.btn.primary {
  background: var(--accent);
  box-shadow: 0 3px 12px var(--glow);
}

.btn.primary:hover {
  background: var(--accent-600);
  box-shadow: 0 6px 20px var(--glow);
}

.btn.ghost {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn.ghost:hover { border-color: var(--accent-border); }

.btn:active { transform: scale(0.985); }

[data-arrow]::after {
  content: "↗";
  margin-inline-start: 6px;
  font-size: 0.95em;
}

/* ---------- Commands and copy ---------- */

.command { position: relative; }

.command pre {
  background-color: var(--sunken);
  transition: background-color 200ms ease;
}

.command.is-copied pre { background-color: var(--accent-50); }

.copy { position: relative; }

/* ---------- Section arrivals ---------- */

.section-title,
.section-lead,
.display,
.channels,
.terminal,
.pick-one,
.logo-wall li,
.chips li,
.stats li,
.foot-mark {
  opacity: 0;
  translate: 0 14px;
  transition: opacity 560ms var(--ease-out-expo), translate 560ms var(--ease-out-expo);
  transition-delay: calc(var(--stagger, 0) * 35ms);
}

.section-title.is-in,
.section-lead.is-in,
.display.is-in,
.channels.is-in,
.terminal.is-in,
.pick-one.is-in,
.logo-wall li.is-in,
.chips li.is-in,
.stats li.is-in,
.foot-mark.is-in {
  opacity: 1;
  translate: 0 0;
}

/* ---------- The install section ---------- */

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin-top: 30px;
}

.channels {
  display: grid;
  gap: 12px;
}

.os-tabs {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--sunken);
  justify-self: start;
}

.os-tabs button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: var(--control-h-sm);
  padding: 0 15px;
  border: 0;
  border-radius: var(--pill);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 200ms ease;
}

.os-tabs button[aria-selected="true"] { color: var(--ink); }

.os-lens {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  z-index: 0;
  width: var(--w, 0px);
  translate: var(--x, 0px) 0;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: translate 380ms var(--spring), width 380ms var(--spring);
}

.os-lens.no-anim { transition: none; }

.os-panel { display: grid; gap: 12px; }

.os-panel[hidden] { display: none; }

.os-panel.is-in .channel,
.os-panel.is-in .pick-one {
  animation: panel-in 460ms var(--ease-out-expo) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes panel-in {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

.channel {
  position: relative;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transition: border-color 200ms ease, background 200ms ease;
}

.channel:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.channel.is-chosen { border-color: var(--accent-border); }

.ch-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.ch-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--accent-50);
  color: var(--accent-ink);
}

.ch-name {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ch-badge {
  margin-inline-start: auto;
  padding: 3px 9px;
  border-radius: var(--pill);
  background: var(--accent-50);
  color: var(--accent-ink);
  font-size: 11.5px;
}

.ch-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.ch-body { margin: 0; }

.setup-files {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-files a {
  display: block;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.setup-files a:hover {
  border-color: var(--accent-border);
  background: var(--accent-50);
}

.pick-one {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.pick-line {
  flex: 0 0 34px;
  height: 2px;
  border-radius: var(--pill);
  background: var(--accent);
  opacity: 0.4;
}

/* ---------- The terminal ---------- */

.terminal {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--term-bg);
  box-shadow: var(--shadow-pop);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
  background: rgb(255 255 255 / 0.03);
}

.term-lights {
  display: inline-flex;
  gap: 6px;
}

.term-lights i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
}

.term-lights i:first-child { background: color-mix(in srgb, var(--accent) 70%, #000); }

.term-title {
  color: var(--term-dim);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-inline-start: auto;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 50%;
  background: none;
  color: var(--term-dim);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}

.term-replay:hover {
  color: var(--term-ink);
  border-color: rgb(255 255 255 / 0.3);
}

.term-body {
  margin: 0;
  padding: 16px 18px 22px;
  min-height: 330px;
  max-height: 460px;
  overflow: auto;
  color: var(--term-ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}

.term-line { display: block; }

.term-line.cmd { color: #fff; }

.term-line.dim { color: var(--term-dim); }

.term-line.ok { color: var(--term-ok); }

.term-line.accent { color: var(--scan); }

.term-line.is-blink { animation: term-blink 1.05s steps(2, start) infinite; }

@keyframes term-blink {
  50% { opacity: 0; }
}

/* ---------- Footer ---------- */

.foot-mark {
  margin: 0 0 22px;
  font-size: clamp(3.5rem, 17vw, 11rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: transparent;
  background-image: linear-gradient(to top, var(--accent-700) 0 50%, transparent 50%);
  background-size: 100% 220%;
  background-position: 0 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px var(--line-strong);
  transition: opacity 560ms var(--ease-out-expo), translate 560ms var(--ease-out-expo),
    background-position 1200ms var(--ease-out-expo);
}

.foot-mark.is-in { background-position: 0 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .install-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .term-body { min-height: 280px; }
}

@media (max-width: 767px) {
  .nav {
    inset: 10px 12px auto;
    padding: 0 6px 0 14px;
  }

  .hero { padding-top: 104px; }

  .os-tabs { display: flex; width: 100%; }

  .os-tabs button {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .term-body {
    font-size: 11.5px;
    padding: 14px 14px 18px;
  }

  .ticker { font-size: 11.5px; }
}

/* ---------- Reduced behaviour ---------- */

@media (prefers-reduced-transparency: reduce) {
  .nav,
  .channel,
  .lang-pop,
  .btn.ghost {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-kinetic] .c,
  [data-words] .w,
  .section-title,
  .section-lead,
  .display,
  .channels,
  .terminal,
  .pick-one,
  .logo-wall li,
  .chips li,
  .stats li,
  .foot-mark,
  .ticker-line {
    opacity: 1;
    translate: 0 0;
    filter: none;
    animation: none;
    transition: none;
  }

  .foot-mark { background-position: 0 0; }

  .os-panel.is-in .channel,
  .os-panel.is-in .pick-one,
  .term-line.is-blink {
    animation: none;
  }

  .btn:active { transform: none; }
}
