/* RV6 solitaire demo: same look as /iRobotBoie/ (dark only).
   Part 1 copies the tokens and base styles of /iRobotBoie/index.html unchanged.
   Part 2 adds the stage (3D view, axes, code, controls) and the panels below it
   (board and magazine, game check) in the same tokens.
   Part 3 adds the vision, the chain with its screenshot stages (the light/dark swap of
   /iRobotBoie/), the proof and the NIRO box. */

/* ---------- Part 1: iRobotBoie base styles ---------- */
:root {
  --bg: #05070b;
  --bg-soft: rgba(255,255,255,0.04);
  --bg-card: rgba(255,255,255,0.06);
  --line: rgba(255,255,255,0.10);
  --text: #f5f7fb;
  --muted: #a9b4c7;
  --blue: #5aa3ff;
  --blue-2: #92c5ff;
  --teal: #63e6d3;
  --pink: #ff8ca8;
  --shadow: 0 30px 80px rgba(0,0,0,0.45);
  --radius: 28px;
  --max: 1220px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: radial-gradient(circle at top, #0f2048 0%, #071226 28%, #05070b 62%);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(90,163,255,0.18), transparent 24%),
    radial-gradient(circle at 80% 12%, rgba(99,230,211,0.14), transparent 20%),
    radial-gradient(circle at 50% 70%, rgba(255,140,168,0.08), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(5,7,11,0.58);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand span {
  font-size: 12px;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover { color: var(--text); }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 13px 20px;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.cta:hover {
  transform: translateY(-1px);
  border-color: rgba(146,197,255,0.45);
  background: linear-gradient(180deg, rgba(90,163,255,0.18), rgba(255,255,255,0.04));
}

.cta.primary {
  background: linear-gradient(180deg, rgba(90,163,255,0.45), rgba(90,163,255,0.18));
  border-color: rgba(146,197,255,0.38);
}

.cta.small {
  padding: 11px 16px;
  font-size: 13px;
}

.ghost {
  background: transparent;
}

.eyebrow {
  color: var(--blue-2);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 16px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.055em;
  max-width: 10ch;
}

section {
  padding: 18px 0 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head p,
.story-card p {
  color: var(--muted);
  line-height: 1.6;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.05em;
}

.story-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.story-card::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  right: -120px;
  top: -140px;
  background: radial-gradient(circle, rgba(90,163,255,0.16), transparent 65%);
  pointer-events: none;
}

.story-card strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue-2);
}

.story-card h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.story-card p {
  margin: 0;
}

.card-actions,
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 13px;
  padding: 18px 0 32px;
}

.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.inline-links {
  gap: 16px;
}

@media (max-width: 720px) {
  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-card {
    padding: 20px;
    border-radius: 24px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---------- Part 2: the demo ---------- */
[hidden] { display: none !important; }

html[dir="rtl"] .list { padding-left: 0; padding-right: 18px; }

.rv6-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px 36px;
  padding: 26px 0 16px;
}

.rv6-head .eyebrow { margin-bottom: 10px; }

/* title and lead in one row: the title of round 3 is long, the lead takes a narrow column */
@media (min-width: 901px) {
  .rv6-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 38ch); }
}

.rv6-head h1 {
  font-size: clamp(28px, 2.7vw, 38px);
  line-height: 1;
  letter-spacing: -0.045em;
  max-width: none;
}

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

.rv6-stage-wrap { padding: 0 0 10px; }

.rv6-stage {
  --pad: 12px;
  height: var(--rv6-stage-h, calc(100vh - 200px));
  min-height: 360px;
  display: grid;
  gap: 10px;
  padding: var(--pad);
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "view code"
    "axes code"
    "ctrl ctrl";
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

/* 3D view: the suite-stage look of the iRobotBoie hero */
.rv6-view {
  grid-area: view;
  position: relative;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 20% 16%, rgba(146,197,255,0.20), transparent 32%),
    radial-gradient(circle at 78% 82%, rgba(99,230,211,0.10), transparent 26%),
    linear-gradient(180deg, rgba(8,20,48,0.92), rgba(5,7,11,0.98));
}

.rv6-view canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.rv6-chips {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
  direction: ltr;
}

.rv6-chips span {
  padding: 5px 10px;
  border-radius: 999px;
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.04em;
  color: rgba(245,247,251,0.9);
  background: rgba(5,7,11,0.58);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.rv6-chips span.ph {
  color: var(--blue-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.rv6-chips span.icr { color: var(--teal); }

.rv6-chips span.evt {
  color: var(--pink);
  border-color: rgba(255,140,168,0.4);
}

.rv6-viewbtn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  appearance: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(5,7,11,0.58);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.rv6-viewbtn:hover,
.rv6-viewbtn:focus-visible {
  color: var(--text);
  border-color: rgba(146,197,255,0.38);
  outline: none;
}

html[dir="rtl"] .rv6-viewbtn { right: auto; left: 12px; }

.rv6-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  appearance: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
  border: 1px solid rgba(146,197,255,0.45);
  background: linear-gradient(180deg, rgba(90,163,255,0.55), rgba(90,163,255,0.22));
  box-shadow: 0 18px 50px rgba(0,0,0,0.45), 0 0 0 10px rgba(90,163,255,0.10);
  transition: transform 0.2s ease;
}

.rv6-bigplay:hover { transform: scale(1.05); }
.rv6-bigplay svg { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }

.rv6-nogl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

/* no WebGL: the program still runs, so the play button stays and the note sits below it */
.rv6-no3d .rv6-nogl { inset: calc(50% + 46px) 0 auto; padding: 0 24px; }
.rv6-no3d .rv6-viewbtn { display: none; }

/* a script failed to load: nothing runs, so no play button and inactive controls */
.rv6-static .rv6-bigplay,
.rv6-static .rv6-viewbtn { display: none; }
.rv6-static .rv6-ctrl { opacity: 0.45; }

/* axes panel: mini tiles as in the iRobotBoie hero panel */
.rv6-axes {
  grid-area: axes;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  direction: ltr;
}

/* heading and path speed (below): only in the axis column of wide screens */
.rv6-axes-head { display: none; }

/* page font like the panel titles: the monospace stack has no Arabic, Hebrew, Indic, Thai or
   polytonic Greek and would set this translated heading in a spaced-out fallback */
.rv6-axes-head {
  padding: 11px 4px 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--blue-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html[dir="rtl"] .rv6-axes-head { direction: rtl; }

.rv6-ax,
.rv6-grip,
.rv6-tcp,
.rv6-path {
  min-width: 0;
  padding: 9px 12px 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 8px;
  transition: border-color 0.2s ease;
}

.rv6-k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.rv6-v {
  font: 600 15px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.rv6-bar {
  grid-column: 1 / -1;
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.rv6-bar s {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(169,180,199,0.45);
}

.rv6-bar i {
  position: absolute;
  top: -2px;
  width: 4px;
  height: 9px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--blue-2);
  box-shadow: 0 0 10px rgba(146,197,255,0.6);
}

.rv6-ax.near { border-color: rgba(255,140,168,0.55); }
.rv6-ax.near .rv6-v { color: var(--pink); }
.rv6-ax.near .rv6-bar i { background: var(--pink); box-shadow: 0 0 10px rgba(255,140,168,0.7); }
.rv6-ax.e1 .rv6-bar i { background: var(--teal); box-shadow: 0 0 10px rgba(99,230,211,0.6); }

.rv6-grip .rv6-v,
.rv6-tcp .rv6-v {
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  white-space: normal;
}

.rv6-grip { grid-template-columns: minmax(0, 1fr); align-content: start; }
.rv6-grip .rv6-v { color: var(--muted); text-align: left; }
.rv6-grip.holding { border-color: rgba(99,230,211,0.45); }
.rv6-grip.holding .rv6-v { color: var(--teal); }
.rv6-grip .rv6-sub {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}
.rv6-grip.holding .rv6-sub { color: var(--teal); }

.rv6-tcp { grid-column: span 2; }
.rv6-tcp .rv6-v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rv6-tcp .rv6-xyz {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 600 14px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
}
.rv6-tcp .rv6-xyz b { color: var(--muted); font-weight: 600; margin-right: 6px; }

.rv6-path { display: none; }
.rv6-path .rv6-v { font-size: 13px; }

/* code panel */
.rv6-code {
  grid-area: code;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(4,8,18,0.94);
  box-shadow: 0 24px 60px rgba(0,0,0,0.40);
  direction: ltr;
  unicode-bidi: isolate;
}

.rv6-code-head {
  display: flex;
  align-items: baseline;
  gap: 4px 12px;
  flex-wrap: wrap;
  padding: 11px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-width: 0;
}

.rv6-file {
  font: 700 11px/1.3 var(--mono);
  color: var(--blue-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rv6-chain {
  font: 600 13px/1.35 var(--mono);
  color: var(--teal);
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 100%;
}

/* program source switch: from the tree (Sutex) | source 2026 */
.rv6-src {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  align-self: center;
}

.rv6-src-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  font: 650 11.5px/1.25 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.rv6-src-btn:hover,
.rv6-src-btn:focus-visible { color: var(--text); outline: none; box-shadow: inset 0 0 0 1px rgba(146,197,255,0.45); }
.rv6-src-btn.is-active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(90,163,255,0.42), rgba(90,163,255,0.18));
  box-shadow: inset 0 0 0 1px rgba(146,197,255,0.38);
}
.rv6-src-btn:disabled { display: none; }
.rv6-static .rv6-src { display: none; }

.rv6-listing {
  position: relative;
  margin: 0;
  overflow: auto;
  padding: 8px 0;
  font: 13px/1.62 var(--mono);
  tab-size: 8;
  -moz-tab-size: 8;
  color: rgba(245,247,251,0.86);
  scroll-behavior: auto;
  overscroll-behavior: contain;
  outline: none;
}

.rv6-listing:focus-visible { box-shadow: inset 0 0 0 2px rgba(146,197,255,0.5); }

.rv6-ln {
  display: grid;
  grid-template-columns: 4.6ch minmax(0, 1fr);
  gap: 1.2ch;
  padding-right: 16px;
  white-space: pre;
  min-width: max-content;
}

.rv6-ln .no {
  text-align: right;
  color: rgba(169,180,199,0.48);
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.rv6-ln.cur {
  background: linear-gradient(90deg, rgba(90,163,255,0.30), rgba(90,163,255,0.12));
  box-shadow: inset 3px 0 0 var(--blue);
  color: var(--text);
}

.rv6-ln.cur .no { color: var(--blue-2); font-weight: 700; }
/* lines changed in 2026: teal bar between line number and code */
.rv6-ln.chg .no {
  color: var(--teal);
  background: linear-gradient(270deg, rgba(99,230,211,0.8) 0 2px, transparent 2px);
  padding-right: 5px;
}
.tk-k { color: var(--text); font-weight: 700; }
.tk-t { color: var(--teal); }
.tk-y { color: var(--pink); }
.tk-n { color: var(--blue-2); }
.tk-s { color: #ffd6a8; }
.tk-c { color: rgba(169,180,199,0.72); font-style: italic; }

.rv6-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 14px 11px;
  border-top: 1px solid rgba(255,255,255,0.08);
  min-height: 42px;
  align-content: center;
}

.rv6-vars span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font: 12px/1.35 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rv6-vars span b { color: var(--muted); font-weight: 500; margin-right: 6px; }

/* controls */
.rv6-ctrl {
  grid-area: ctrl;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rv6-ctrl .cta { flex: 0 0 auto; cursor: pointer; font-family: inherit; padding: 10px 16px; }
.rv6-ctrl .cta svg { width: 13px; height: 13px; fill: currentColor; flex: 0 0 auto; }
.rv6-ctrl .rv6-play { min-width: 118px; }

.rv6-speed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.rv6-speed select {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 9px 30px 9px 13px;
  background:
    linear-gradient(45deg, transparent 50%, currentColor 50%) calc(100% - 16px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, currentColor 50%, transparent 50%) calc(100% - 12px) 50% / 5px 5px no-repeat,
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  color: var(--text);
  font: 650 13px/1.2 var(--mono);
  direction: ltr;
  cursor: pointer;
}

.rv6-speed select option { color: #111827; }

.rv6-timeline {
  position: relative;
  flex: 1 1 auto;
  min-width: 120px;
  height: 30px;
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  direction: ltr;
  touch-action: none;
}

.rv6-timeline:focus-visible { outline: 2px solid rgba(146,197,255,0.62); outline-offset: 2px; }

.rv6-seg {
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  white-space: nowrap;
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.06em;
  color: rgba(169,180,199,0.85);
  border-right: 1px solid rgba(255,255,255,0.07);
  position: relative;
  z-index: 1;
}

.rv6-seg:last-of-type { border-right: 0; }

.rv6-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(90,163,255,0.18), rgba(90,163,255,0.42));
  pointer-events: none;
}

.rv6-head-mark {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 3px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(99,230,211,0.8);
  pointer-events: none;
  z-index: 2;
}

.rv6-clock {
  flex: 0 0 auto;
  font: 600 12px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
  direction: ltr;
}

.rv6-clock b { color: var(--text); font-weight: 650; }

.rv6-hint {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rv6-key-chg i {
  display: inline-block;
  width: 3px;
  height: 1.05em;
  margin: 0 6px 0 4px;
  border-radius: 2px;
  background: var(--teal);
  vertical-align: -0.18em;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* sections below the stage */
.rv6-about {
  display: grid;
  gap: 14px;
}

.rv6-about p { max-width: 78ch; font-size: 16px; }
.rv6-about p + p { margin-top: 14px; }

.rv6-notes .list li + li { margin-top: 8px; }
.rv6-notes .card-actions { margin-top: 20px; }

/* panels below the stage: board and magazine, game check */
.rv6-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.rv6-panel {
  min-width: 0;
  padding: 18px 20px 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.rv6-panel-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-2);
}

/* board (x to the right, y down) and magazine keep their orientation in RTL */
.rv6-boards {
  display: grid;
  grid-template-columns: minmax(0, 90fr) minmax(0, 66fr);
  gap: 18px;
  align-items: start;
  max-width: 540px;
  direction: ltr;
}

.rv6-fig { margin: 0; min-width: 0; display: grid; gap: 8px; }
.rv6-fig svg { display: block; width: 100%; height: auto; direction: ltr; }
.rv6-fig figcaption { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
html[dir="rtl"] .rv6-fig figcaption { direction: rtl; }

.rv6-board .plate { fill: rgba(43,63,104,0.55); stroke: rgba(146,197,255,0.24); stroke-width: 0.5; stroke-linejoin: round; }
.rv6-mag .plate { fill: rgba(58,74,102,0.42); stroke: rgba(146,197,255,0.18); stroke-width: 0.5; }
.rv6-board .ax { font: 600 4.6px var(--mono); fill: var(--muted); text-anchor: middle; }
.rv6-fig .hole { fill: #060a14; stroke: rgba(255,255,255,0.16); stroke-width: 0.45; }
.rv6-fig .peg { display: none; fill: var(--pink); stroke: rgba(5,7,11,0.55); stroke-width: 0.4; }
.rv6-fig .gloss { display: none; fill: rgba(255,255,255,0.5); }
.rv6-fig .on .peg,
.rv6-fig .on .gloss { display: inline; }
.rv6-mag .no { font: 600 3.9px var(--mono); fill: rgba(169,180,199,0.78); text-anchor: middle; }
.rv6-mag .on .no { fill: #2a0b14; }
.rv6-fig .ring { fill: none; stroke: none; stroke-width: 1.15; }
.rv6-fig .m-from .ring { stroke: var(--blue-2); }
.rv6-fig .m-over .ring { stroke: var(--pink); }
.rv6-fig .m-to .ring { stroke: var(--teal); }
.rv6-fig .m-mag .ring { stroke: var(--blue); stroke-dasharray: 1.7 1.15; }

.rv6-count {
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.rv6-legend {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.rv6-legend li { display: inline-flex; align-items: center; gap: 7px; }
.rv6-legend i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid; flex: 0 0 auto; }
.rv6-legend .m-from i { border-color: var(--blue-2); }
.rv6-legend .m-over i { border-color: var(--pink); }
.rv6-legend .m-to i { border-color: var(--teal); }
.rv6-legend .m-mag i { border: 2px dashed var(--blue); }

/* game check: as tall as the board panel, the list scrolls */
.rv6-check-panel {
  display: flex;
  flex-direction: column;
  contain: size;
}

.rv6-check-intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rv6-check {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 6px;
  align-content: start;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px);
  mask-image: linear-gradient(180deg, transparent 0, #000 12px);
  padding-top: 4px;
}

.rv6-check li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(245,247,251,0.88);
}

.rv6-check li.now { border-color: rgba(146,197,255,0.45); background: rgba(90,163,255,0.13); }
.rv6-check li.wait { color: var(--muted); }
.rv6-check .mk { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.rv6-check .mk svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rv6-check li.ok .mk { color: var(--teal); background: rgba(99,230,211,0.15); }
.rv6-check li.bad .mk { color: var(--pink); background: rgba(255,140,168,0.15); }
.rv6-check li.wait .mk { color: var(--muted); background: rgba(255,255,255,0.06); }
.rv6-check li.wait .mk svg { fill: currentColor; stroke: none; }
.rv6-check code { font: 600 12.5px/1.45 var(--mono); color: var(--blue-2); white-space: nowrap; }

/* ---------- layouts ---------- */

/* phones in portrait: robot on top, axes strip, code, controls */
@media (max-width: 620px) {
  .rv6-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(140px, 0.74fr) auto minmax(0, 1fr) auto;
    grid-template-areas: "view" "axes" "code" "ctrl";
  }

  .rv6-axes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .rv6-tcp { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .rv6-ctrl { flex-wrap: wrap; }
  .rv6-timeline { order: 5; flex: 1 1 60%; }
  .rv6-clock { order: 6; }
}

/* tablets in portrait: robot and axis column on top, code below */
@media (min-width: 621px) and (max-width: 900px) and (orientation: portrait) {
  .rv6-stage {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    grid-template-rows: minmax(0, 1.08fr) minmax(0, 1fr) auto;
    grid-template-areas:
      "view axes"
      "code code"
      "ctrl ctrl";
  }
}

/* axis column (tablet portrait, short landscape, wide screens): one line per axis */
@media (min-width: 621px) and (max-width: 900px) and (orientation: portrait), (max-height: 560px) and (orientation: landscape), (min-width: 1024px) {
  .rv6-axes {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 5px;
    overflow: hidden;
  }

  .rv6-ax {
    grid-template-columns: 2.1em minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 8px;
    padding: 5px 10px;
    border-radius: 12px;
  }

  .rv6-ax .rv6-bar { grid-column: 2; grid-row: 1; }
  .rv6-ax .rv6-v { grid-column: 3; grid-row: 1; font-size: 13px; }

  .rv6-grip,
  .rv6-tcp {
    grid-column: auto;
    padding: 5px 10px;
    border-radius: 12px;
  }

  .rv6-tcp .rv6-xyz { flex-direction: column; gap: 2px; font-size: 12px; }
  .rv6-tcp .rv6-xyz > span { display: flex; justify-content: space-between; }
  .rv6-grip { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; }
  .rv6-grip .rv6-v,
  .rv6-grip .rv6-sub { text-align: right; }
}

/* tablets in portrait: the axis column is wide enough for X, Y, Z on one line */
@media (min-width: 621px) and (max-width: 900px) and (orientation: portrait) {
  .rv6-tcp .rv6-xyz { flex-direction: row; justify-content: space-between; }
  .rv6-tcp .rv6-xyz > span { display: inline; }
  .rv6-tcp .rv6-xyz b { margin-right: 4px; }
}

/* wide screens: view | axis column | code side by side, controls below */
@media (min-width: 1024px) {
  .rv6-stage {
    grid-template-columns: minmax(0, 1fr) clamp(190px, 16vw, 226px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "view axes code"
      "ctrl ctrl ctrl";
  }

  .rv6-axes { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
  .rv6-axes-head { display: block; }
  /* the axis rows share the height of tall columns (up to 58 px each) */
  .rv6-ax { flex: 1 1 0; max-height: 58px; padding: 7px 12px; border-radius: 14px; gap: 0 10px; }
  .rv6-ax .rv6-v { font-size: 14px; }
  .rv6-grip { margin-top: auto; }
  .rv6-grip,
  .rv6-tcp,
  .rv6-path { padding: 8px 12px; border-radius: 14px; }
  .rv6-tcp .rv6-xyz { gap: 3px; font-size: 13px; }
  .rv6-path { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; }
}

/* wide but not tall (1280 x 720, 1024 x 768): tighter tiles so the whole column fits */
@media (min-width: 1024px) and (max-height: 820px) {
  .rv6-axes { gap: 5px; }
  .rv6-axes-head { padding-top: 9px; padding-bottom: 1px; }
  .rv6-ax { padding: 4px 11px; border-radius: 12px; }
  .rv6-grip,
  .rv6-tcp,
  .rv6-path { padding: 5px 11px; border-radius: 12px; }
  .rv6-grip { gap: 2px 8px; }
  .rv6-tcp { gap: 2px 8px; }
  .rv6-tcp .rv6-xyz { gap: 1px; }
}

/* fitAxes() in rv6-ui.js: the tiles do not fit the axis column (long labels, short windows) */
@media (min-width: 1024px) {
  .rv6-tight .rv6-axes { gap: 4px; }
  .rv6-tight .rv6-axes-head { padding: 5px 4px 0; }
  .rv6-tight .rv6-ax { padding: 3px 10px; border-radius: 11px; }
  .rv6-tight .rv6-grip,
  .rv6-tight .rv6-tcp,
  .rv6-tight .rv6-path { padding: 4px 10px; border-radius: 11px; gap: 1px 8px; }
  .rv6-tight .rv6-tcp .rv6-xyz { gap: 0; font-size: 12px; line-height: 1.15; }
  .rv6-tight .rv6-grip .rv6-sub { font-size: 11.5px; line-height: 1.25; }
  .rv6-tighter .rv6-axes-head { display: none; }
  .rv6-tighter .rv6-ax .rv6-v { font-size: 12.5px; }
  .rv6-tighter .rv6-k { font-size: 10px; letter-spacing: 0.06em; }
  .rv6-tighter .rv6-grip .rv6-v { font-size: 12px; line-height: 1.2; }
  .rv6-tighter .rv6-path .rv6-v { font-size: 12px; }
}

/* wide and tall screens (1920 x 1080 and up): a wider stage, a larger robot and axis tiles
   spread evenly over the column instead of a gap above the gripper */
@media (min-width: 1900px) and (min-height: 1000px) {
  .rv6-stage-wrap { width: min(1660px, calc(100% - 64px)); }
  .rv6-stage { grid-template-columns: minmax(0, 1.24fr) clamp(220px, 13vw, 260px) minmax(0, 1fr); }
  .rv6-axes { justify-content: space-between; gap: 8px; }
  .rv6-ax { max-height: 86px; padding: 8px 14px; }
  .rv6-ax .rv6-v { font-size: 15px; }
  .rv6-grip { margin-top: 0; }
  .rv6-grip,
  .rv6-tcp,
  .rv6-path { padding: 10px 14px; }
  .rv6-tcp .rv6-xyz { font-size: 14px; gap: 4px; }
}

@media (max-width: 720px) {
  /* a 170 px sticky header would cover a quarter of the stage: let it scroll away */
  .nav { position: relative; }

  .rv6-head { padding: 20px 0 14px; }
  .rv6-head h1 { font-size: clamp(26px, 7vw, 34px); }
  .rv6-lead { font-size: 14px; }

  .rv6-stage { --pad: 8px; gap: 8px; border-radius: 24px; }
  .rv6-view { border-radius: 18px; }
  .rv6-code { border-radius: 18px; }

  .rv6-ax,
  .rv6-grip {
    padding: 6px 8px 7px;
    border-radius: 12px;
    gap: 3px 4px;
  }

  .rv6-k { font-size: 10px; letter-spacing: 0.06em; }
  .rv6-v { font-size: 12px; }
  .rv6-bar { height: 4px; }
  .rv6-grip { grid-template-columns: minmax(0, 1fr); }
  .rv6-grip .rv6-v { font-size: 11px; text-align: left; line-height: 1.15; }
  .rv6-grip .rv6-sub { display: none; }

  .rv6-tcp {
    padding: 5px 10px;
    border-radius: 12px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
  .rv6-tcp .rv6-xyz { grid-column: auto; font-size: 11.5px; justify-content: flex-end; gap: 12px; }
  .rv6-tcp .rv6-xyz b { margin-right: 4px; }

  .rv6-code-head { padding: 7px 12px; }
  .rv6-file { display: none; }
  .rv6-chain { font-size: 11.5px; }
  .rv6-listing { font-size: 11.5px; line-height: 1.55; padding: 4px 0; }
  .rv6-ln { gap: 1ch; padding-right: 12px; grid-template-columns: 3.6ch minmax(0, 1fr); }
  /* up to two rows, so that names and values both stay readable */
  .rv6-vars { padding: 6px 10px 7px; min-height: 0; gap: 4px 5px; flex-wrap: wrap; overflow: hidden; max-height: 63px; }
  .rv6-vars span { font-size: 11px; padding: 3px 8px; flex: 0 1 auto; min-width: 0; }

  .rv6-chips { top: 8px; left: 8px; right: 8px; }
  .rv6-chips span { font-size: 10px; padding: 4px 8px; }
  .rv6-viewbtn { right: 8px; bottom: 8px; font-size: 10px; padding: 5px 9px; }
  .rv6-bigplay { width: 60px; height: 60px; margin: -30px 0 0 -30px; }

  .rv6-ctrl { gap: 6px; }
  .rv6-ctrl .cta { padding: 8px 12px; font-size: 12px; gap: 7px; }
  .rv6-ctrl .rv6-play { min-width: 0; }
  .rv6-ctrl .rv6-icon-only span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rv6-speed { font-size: 12px; margin-left: auto; }
  .rv6-speed > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rv6-speed select { padding: 7px 26px 7px 11px; font-size: 12px; }
  .rv6-timeline { height: 26px; min-width: 0; }
  .rv6-seg { padding: 0 5px; font-size: 9px; letter-spacing: 0.02em; }
  .rv6-clock { font-size: 11px; }
  .rv6-hint { font-size: 12px; }

  html[dir="rtl"] .rv6-speed { margin-left: 0; margin-right: auto; }
}

/* phones: the panels stack, the check list gets its own height */
@media (max-width: 720px) {
  .rv6-panels { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
  .rv6-panel { padding: 16px 16px 18px; border-radius: 24px; }
  .rv6-boards { gap: 14px; }
  .rv6-check-panel { contain: none; }
  .rv6-check { flex: none; max-height: 340px; }
  /* board indices and magazine numbers: about 11 px instead of 7-8 px on a 390 px phone */
  .rv6-board .ax { font-size: 6.2px; transform: translateY(0.8px); }
  .rv6-mag .no { font-size: 5.4px; transform: translateY(0.6px); }
}

/* phones in landscape and other short screens: view | axes column | code */
@media (max-height: 560px) and (orientation: landscape) {
  .nav { position: relative; }

  .rv6-stage {
    --pad: 8px;
    gap: 8px;
    border-radius: 22px;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 150px) minmax(0, 1.12fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "view axes code"
      "ctrl ctrl ctrl";
  }

  .rv6-view,
  .rv6-code { border-radius: 16px; }

  .rv6-axes { gap: 4px; }
  .rv6-ax, .rv6-grip, .rv6-tcp { padding: 3px 8px; border-radius: 10px; }
  .rv6-k { font-size: 10px; letter-spacing: 0.06em; }
  .rv6-ax .rv6-v { font-size: 11.5px; }
  .rv6-bar { height: 3px; }
  .rv6-grip .rv6-v { font-size: 11px; }
  .rv6-grip .rv6-sub { display: none; }
  .rv6-tcp .rv6-xyz { gap: 1px; font-size: 11px; }

  .rv6-code-head { padding: 6px 10px; }
  .rv6-chain { font-size: 11px; }
  .rv6-file { display: none; }
  .rv6-listing { font-size: 11px; line-height: 1.5; padding: 3px 0; }
  .rv6-ln { gap: 1ch; padding-right: 10px; grid-template-columns: 3.6ch minmax(0, 1fr); }
  .rv6-vars { padding: 5px 8px; min-height: 0; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
  .rv6-vars span { font-size: 10.5px; padding: 2px 7px; min-width: 0; }

  .rv6-axes-head,
  .rv6-path { display: none; }
  .rv6-grip { margin-top: 0; }

  .rv6-chips { top: 6px; left: 6px; right: 6px; }
  .rv6-chips span { font-size: 10px; padding: 3px 7px; }
  .rv6-chips span:nth-child(n+3) { display: none; }
  .rv6-viewbtn { right: 6px; bottom: 6px; font-size: 10px; padding: 4px 8px; }
  .rv6-bigplay { width: 54px; height: 54px; margin: -27px 0 0 -27px; }

  .rv6-ctrl { gap: 6px; flex-wrap: nowrap; }
  .rv6-timeline, .rv6-clock { order: 0; }
  .rv6-ctrl .cta { padding: 7px 12px; font-size: 12px; gap: 7px; }
  .rv6-ctrl .rv6-play { min-width: 0; }
  .rv6-ctrl .rv6-icon-only span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rv6-speed > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rv6-speed select { padding: 6px 24px 6px 10px; font-size: 12px; }
  .rv6-timeline { height: 24px; }
  .rv6-seg { font-size: 9px; padding: 0 5px; }
  .rv6-clock { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cta, .rv6-bigplay { transition: none; }
}

/* ---------- Part 3: vision, chain, proof, NIRO ---------- */
/* seven navigation links since round 3: a little less space between them on mid-size screens */
@media (min-width: 721px) and (max-width: 1279px) {
  .nav-links { gap: 8px 16px; }
}

.rv6-vision-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); gap: 18px 34px; align-items: start; }
.rv6-prose { display: grid; gap: 14px; }
.rv6-prose p { max-width: 78ch; font-size: 16px; }
.rv6-prose a,
.rv6-niro p a { color: var(--blue-2); text-decoration: underline; text-decoration-color: rgba(146,197,255,0.4); text-underline-offset: 3px; }
.rv6-prose a:hover { text-decoration-color: var(--blue-2); }
.rv6-quote { color: var(--text) !important; font-style: italic; }

/* key years of the vision: mini tiles as in the iRobotBoie hero */
.rv6-timeline-years {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.rv6-timeline-years li {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  gap: 4px;
  min-width: 0;
}
.rv6-timeline-years b { font: 700 20px/1.1 var(--mono); letter-spacing: -0.03em; color: var(--text); direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .rv6-timeline-years b { text-align: right; }
.rv6-timeline-years span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rv6-timeline-years li:last-child { border-color: rgba(99,230,211,0.4); }
.rv6-timeline-years li:last-child b { color: var(--teal); }

/* the chain: file flow, then one card per station */
.rv6-flow {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
  direction: ltr;
}
.rv6-flow li {
  padding: 7px 12px;
  border-radius: 999px;
  font: 600 12.5px/1.2 var(--mono);
  color: var(--blue-2);
  background: rgba(90,163,255,0.10);
  border: 1px solid rgba(146,197,255,0.24);
}
.rv6-flow li + li::before { content: none; }
.rv6-flow li:not(:last-child)::after { content: "→"; margin-left: 12px; margin-right: -4px; color: var(--muted); }
.rv6-flow li:last-child { color: var(--teal); border-color: rgba(99,230,211,0.4); background: rgba(99,230,211,0.08); }

.rv6-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.rv6-step {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 26px;
  align-items: start;
}
.rv6-step-text { display: grid; gap: 12px; min-width: 0; }
.rv6-step-text > p { font-size: 15.5px; }
.rv6-step-head { display: flex; align-items: center; gap: 14px; }
.rv6-step-head h3 { font-size: 28px; }
.rv6-step-no {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font: 700 17px/1 var(--mono);
  color: var(--text);
  border: 1px solid rgba(146,197,255,0.45);
  background: linear-gradient(180deg, rgba(90,163,255,0.45), rgba(90,163,255,0.16));
  box-shadow: 0 0 0 6px rgba(90,163,255,0.08);
}
#station-robot .rv6-step-no { border-color: rgba(99,230,211,0.55); background: linear-gradient(180deg, rgba(99,230,211,0.42), rgba(99,230,211,0.14)); }
.story-card p.rv6-facts {
  font: 600 12.5px/1.5 var(--mono);
  color: var(--teal);
  overflow-wrap: anywhere;
}
/* Arabic and Hebrew have no glyphs in the monospace stack; the fallback is a fixed-pitch
   Arabic/Hebrew face with stretched letters, so RTL facts lines use the page font */
html[dir="rtl"] .story-card p.rv6-facts { font-family: inherit; font-size: 13.5px; }
.rv6-step-media { min-width: 0; }

.rv6-excerpt-fig { margin: 2px 0 0; min-width: 0; display: grid; gap: 6px; }
.rv6-excerpt-fig figcaption {
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  color: var(--blue-2);
  direction: ltr;
  text-align: left;
}
.rv6-excerpt {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(4,8,18,0.94);
  border: 1px solid rgba(255,255,255,0.10);
  font: 12px/1.55 var(--mono);
  color: rgba(245,247,251,0.86);
  white-space: pre;
  overflow-x: auto;
  tab-size: 8;
  -moz-tab-size: 8;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}
.rv6-excerpt:focus-visible { outline: 2px solid rgba(146,197,255,0.5); outline-offset: 2px; }
.rv6-excerpt-pair { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: 10px; }

/* screenshot stages: the light/dark swap of /iRobotBoie/ */
.app-swap { display: grid; gap: 12px; }
.app-swap-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.app-swap-pill {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.app-swap-pill:hover,
.app-swap-pill:focus-visible,
.app-swap-pill.is-active {
  color: var(--text);
  border-color: rgba(146,197,255,0.34);
  background: linear-gradient(180deg, rgba(90,163,255,0.16), rgba(255,255,255,0.05));
  transform: translateY(-1px);
  outline: none;
}
.app-swap-controls > .app-swap-pill[data-swap-theme="dark"] { margin-left: auto; }
html[dir="rtl"] .app-swap-controls > .app-swap-pill[data-swap-theme="dark"] { margin-left: 0; margin-right: auto; }
/* Tredit has two pairs (view, theme): each pair wraps as a unit, so on phones "light" never
   stands alone on the next line */
.app-swap-group { display: flex; gap: 8px; }
.app-swap-group-theme { margin-left: auto; }
html[dir="rtl"] .app-swap-group-theme { margin-left: 0; margin-right: auto; }
.app-swap-stage {
  position: relative;
  padding: 10px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 18%, rgba(146,197,255,0.18), transparent 24%),
    linear-gradient(180deg, rgba(8,20,48,0.78), rgba(5,7,11,0.92));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
/* the sizer gives the stage the height of a frame whose image fits exactly (frame = stage - 34 px) */
.app-swap-sizer { display: block; margin: 7px; }
.app-swap-stage::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(146,197,255,0.08);
  pointer-events: none;
}
.app-swap-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 34px);
  height: calc(100% - 34px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(4,8,18,0.96);
  box-shadow: 0 22px 56px rgba(0,0,0,0.42);
  cursor: zoom-in;
  transition: transform 0.36s cubic-bezier(.2,.8,.2,1), opacity 0.36s ease, filter 0.36s ease, border-color 0.28s ease;
}
.app-swap-frame:hover,
.app-swap-frame:focus-visible { border-color: rgba(146,197,255,0.36); outline: none; }
.app-swap-frame img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; }
.app-swap-frame[data-slot="0"] { transform: translate(-50%, -50%) rotate(0deg) scale(1); z-index: 2; opacity: 1; filter: saturate(1) brightness(1); }
.app-swap-frame[data-slot="1"] { transform: translate(-50%, -50%) rotate(-4deg) scale(0.92); z-index: 1; opacity: 0.62; filter: saturate(0.75) brightness(0.82); cursor: pointer; }
.app-swap-frame[data-slot="2"] { transform: translate(-50%, -50%) scale(0.86); z-index: 0; opacity: 0; pointer-events: none; }

.rv6-stage-shot {
  display: block;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 22px 56px rgba(0,0,0,0.42);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.rv6-stage-shot:hover { transform: translateY(-3px); border-color: rgba(99,230,211,0.45); }
.rv6-stage-shot img { display: block; width: 100%; height: auto; }

/* proof */
.rv6-niro { display: grid; gap: 12px; }
.rv6-niro h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.04em; }
.rv6-niro p { max-width: 82ch; font-size: 15.5px; }
.story-card p.rv6-partners { font-size: 13.5px; color: rgba(169,180,199,0.85); }
.rv6-cordis { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.rv6-cordis .cta { direction: ltr; }

@media (max-width: 900px) {
  .rv6-vision-card { grid-template-columns: minmax(0, 1fr); }
  .rv6-timeline-years { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rv6-step { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 720px) {
  .rv6-prose p { font-size: 15px; }
  .rv6-step-head h3 { font-size: 24px; }
  .rv6-step-no { width: 34px; height: 34px; font-size: 15px; }
  .rv6-excerpt { font-size: 11px; padding: 9px 11px; }
  .rv6-excerpt-pair { grid-template-columns: minmax(0, 1fr); }
  .rv6-timeline-years { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rv6-timeline-years li { padding: 10px 12px; border-radius: 16px; }
  .rv6-timeline-years b { font-size: 17px; }
  .app-swap-stage { padding: 6px; border-radius: 18px; }
  .app-swap-frame { width: calc(100% - 22px); height: calc(100% - 22px); border-radius: 14px; }
  .app-swap-sizer { margin: 5px; }
  .rv6-code-head { row-gap: 6px; }
  .rv6-src-btn { padding: 3px 9px; font-size: 11px; }
}

/* Ancient Greek: accented capitals are wrong typography, so the titles keep their case */
html[lang="grc"] .eyebrow,
html[lang="grc"] .rv6-axes-head,
html[lang="grc"] .rv6-k,
html[lang="grc"] .rv6-panel-title,
html[lang="grc"] .rv6-viewbtn,
html[lang="grc"] .rv6-chips span.ph,
html[lang="grc"] .app-swap-pill,
html[lang="grc"] .rv6-file,
html[lang="grc"] .story-card strong { text-transform: none; letter-spacing: 0.02em; }

/* Japanese headings break between phrases (Chrome: BudouX), not inside a word such as
   "ペグソリテ|ア"; overflow-wrap keeps a phrase longer than the line from overflowing */
html[lang="ja"] :is(h1, h2, h3) { word-break: auto-phrase; overflow-wrap: anywhere; }
