/* RobotStop — marketing site
   Palette is deliberately narrow: ink, paper, sand, one safety red. */

:root {
  --ink:        #0a0c0d;
  --ink-2:      #14181a;
  --ink-3:      #21262a;
  --paper:      #ffffff;
  --sand:       #f6f5f2;
  --line:       #e4e1db;
  --line-dark:  #2c3237;
  --text:       #16191b;
  --muted:      #62676d;
  --muted-dark: #9aa2a8;
  --accent:     #d4231b;
  --accent-hi:  #f04338;
  --green:      #1f7a4d;

  --shell: 1140px;
  --pad: clamp(20px, 5vw, 40px);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.021em; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

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

.sr-only, .skip {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip:focus {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  width: auto; height: auto; margin: 0; clip: auto;
  padding: 10px 16px; background: var(--ink); color: #fff;
  border-radius: 6px; font-size: 14px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 22px;
}
.eyebrow-num { display: flex; align-items: center; gap: 12px; }
.eyebrow-num span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.eyebrow-invert { color: var(--muted-dark); }
.eyebrow-invert span { border-color: var(--line-dark); color: var(--accent-hi); }

.h2 {
  font-size: clamp(30px, 4.6vw, 48px);
  max-width: 21ch;
  letter-spacing: -0.028em;
}
.lede {
  margin-top: 22px;
  max-width: 62ch;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--muted);
  line-height: 1.65;
}
.lede-invert { color: var(--muted-dark); }
.unit {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 7px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.006em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { height: 40px; padding: 0 17px; font-size: 14px; }
.btn-lg { height: 56px; padding: 0 30px; font-size: 16px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hi); }

.btn-outline { border-color: var(--line); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--text); }

.btn-ghost {
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
  background: rgba(255, 255, 255, .04);
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .09); }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--line-dark);
  box-shadow: 0 10px 30px -20px rgba(0, 0, 0, .8);
}
.nav-inner { display: flex; align-items: center; gap: 22px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark { width: 24px; height: 24px; color: var(--accent-hi); flex: none; }
.brand-word {
  font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: #fff;
}
.brand-word-accent { color: var(--accent-hi); }

.nav-links { display: flex; gap: 18px; margin-left: auto; }
.nav-links a {
  font-size: 14.5px; color: rgba(255, 255, 255, .66);
  transition: color .15s var(--ease);
}
.nav-links a:hover { color: #fff; }
.nav .btn-primary { margin-left: 4px; }

@media (max-width: 900px) { .nav-links { display: none; } .nav .btn-primary { margin-left: auto; } }

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

.hero {
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero-grid {
  position: absolute; inset: 0; z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 100% at 15% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 100% at 15% 0%, #000 20%, transparent 78%);
}
.hero-glow {
  position: absolute; z-index: -1;
  top: -32%; right: -14%;
  width: 62vw; height: 62vw; max-width: 780px; max-height: 780px;
  background: radial-gradient(circle, rgba(212,35,27,.30) 0%, rgba(212,35,27,.05) 46%, transparent 68%);
  filter: blur(14px);
}
.hero-inner { padding: clamp(78px, 12vw, 140px) var(--pad) clamp(44px, 6vw, 64px); }
.hero .eyebrow { color: rgba(255,255,255,.55); }

.hero-title {
  font-size: clamp(46px, 9.2vw, 104px);
  line-height: .98;
  letter-spacing: -0.042em;
  font-weight: 600;
}
.hero-title-accent { color: var(--accent-hi); }
.hero-sub {
  margin-top: 28px;
  max-width: 56ch;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.6;
  color: rgba(255,255,255,.72);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

.ticker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: clamp(56px, 8vw, 84px) 0 0;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--r);
  overflow: hidden;
}
.ticker-item { background: var(--ink-2); padding: 24px 22px 22px; }
.ticker dt {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-dark);
}
.ticker dd {
  margin: 10px 0 0;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
}
.ticker .unit { color: rgba(255,255,255,.44); }
@media (max-width: 760px) { .ticker { grid-template-columns: repeat(2, 1fr); } }

/* ---------- sections ---------- */

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-problem { border-bottom: 1px solid var(--line); }
.section-demo { background: var(--sand); border-bottom: 1px solid var(--line); }
.section-how { border-bottom: 1px solid var(--line); }
.section-offerings { background: var(--sand); border-top: 1px solid var(--line); }
.section-standards { border-top: 1px solid var(--line); }

/* ---------- cards ---------- */

.cards { display: grid; gap: 24px; margin-top: clamp(44px, 6vw, 60px); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .cards-3 { grid-template-columns: 1fr; } }

.card-plain {
  padding-top: 26px;
  border-top: 2px solid var(--ink);
}
.card-index {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent);
}
.card-plain h3 { margin: 12px 0 10px; font-size: 20px; }
.card-plain p { color: var(--muted); font-size: 16px; }

/* ---------- demo ---------- */

.demo-wrap {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 980px) { .demo-wrap { grid-template-columns: 1fr; } }

.demo-media { margin: 0; }
.demo-media video {
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 24px 50px -28px rgba(10,12,13,.4);
}
.demo-media figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}

.tick-list { margin-top: 26px; display: grid; gap: 12px; }
.tick-list li {
  position: relative;
  padding-left: 26px;
  font-size: 16px;
  color: var(--muted);
}
.tick-list li::before {
  content: "";
  position: absolute; left: 2px; top: .52em;
  width: 9px; height: 9px;
  border: 2px solid var(--accent);
  border-radius: 2px;
}

/* ---------- diagram ---------- */

.diagram-frame {
  margin: clamp(44px, 6vw, 62px) 0 clamp(52px, 7vw, 72px);
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(to right, rgba(10,12,13,.028) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(to bottom, rgba(10,12,13,.028) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
  overflow-x: auto;
}
.diagram { width: 100%; min-width: 660px; height: auto; }
.dg-box rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.dg-box-accent rect { fill: #fff; stroke: var(--accent); stroke-width: 1.6; }
.dg-text text {
  fill: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-anchor: middle;
}
.dg-text .dg-sub, .dg-sub {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dg-label text {
  fill: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.dg-line path { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.dg-line-dash path { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 5; }
.dg-arrow path { fill: var(--ink); }
.dg-mid { text-anchor: start; }

/* ---------- steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.steps li { background: var(--paper); padding: 28px 24px 30px; }
.step-n {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent);
}
.steps h3 { margin: 14px 0 10px; font-size: 19px; }
.steps p { font-size: 15.5px; color: var(--muted); }
@media (max-width: 1040px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }

/* ---------- DIY comparison (dark) ---------- */

.section-diy { background: var(--ink); color: #fff; }
.section-diy .h2 { color: #fff; max-width: 24ch; }

.table-wrap { margin-top: clamp(44px, 6vw, 60px); overflow-x: auto; }
.compare {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 15.5px;
}
.compare th, .compare td {
  padding: 18px 22px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-dark);
}
.compare thead th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-dark);
  padding-bottom: 14px;
  border-bottom-color: var(--ink-3);
}
.compare thead .col-us { color: #fff; }
.compare tbody th {
  font-weight: 500;
  color: #fff;
  width: 22%;
}
.compare tbody td { color: var(--muted-dark); }
.compare .col-us {
  color: #fff;
  background: rgba(212, 35, 27, .07);
  box-shadow: inset 1px 0 0 rgba(240, 67, 56, .32);
  width: 39%;
}
.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }

/* Below the table's comfortable width, stack each row as its own card so the
   RobotStop column is never the one hidden off-screen. */
@media (max-width: 760px) {
  .table-wrap { overflow-x: visible; }
  .compare { min-width: 0; display: block; }
  .compare thead { display: none; }
  .compare tbody { display: block; }
  .compare tbody tr {
    display: block;
    padding: 20px 20px 4px;
    margin-bottom: 14px;
    border: 1px solid var(--line-dark);
    border-radius: var(--r);
  }
  .compare tbody th,
  .compare tbody td {
    display: block;
    width: auto;
    padding: 0 0 16px;
    border-bottom: 0;
  }
  .compare tbody th { font-size: 17px; padding-bottom: 14px; }
  .compare tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-dark);
  }
  .compare .col-us {
    width: auto;
    background: transparent;
    box-shadow: none;
    padding-top: 14px;
    border-top: 1px solid var(--line-dark);
  }
  .compare .col-us::before { color: var(--accent-hi); }
}

.kicker {
  margin-top: clamp(40px, 5vw, 56px);
  max-width: 34ch;
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.024em;
  color: #fff;
}

/* ---------- pricing ---------- */

.cards-price { align-items: stretch; }
.card-price {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 28px 30px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.card-feature {
  border-color: var(--ink);
  box-shadow: 0 22px 44px -30px rgba(10,12,13,.55);
}
.ribbon {
  position: absolute; top: -11px; left: 28px;
  padding: 4px 11px;
  background: var(--accent);
  color: #fff;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.price-tag {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.card-price h3 { margin: 12px 0 0; font-size: 23px; }
.price { margin: 20px 0 0; display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.price-num {
  font-size: clamp(34px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
}
.price-unit { font-size: 14px; color: var(--muted); }
.price-note { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

.feat {
  margin: 26px 0 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 13px;
}
.feat li {
  position: relative;
  padding-left: 24px;
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.5;
}
.feat li strong { color: var(--text); font-weight: 600; }
.feat li::before {
  content: "";
  position: absolute; left: 3px; top: .55em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .82;
}
.card-price .btn { margin-top: auto; width: 100%; }

/* ---------- standards ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(32px, 5vw, 64px);
  margin-top: clamp(44px, 6vw, 58px);
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split-h {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.split-h-yes { color: var(--green); border-bottom-color: var(--green); }
.split-h-no { color: var(--accent); border-bottom-color: var(--accent); }
.split .tick-list { margin-top: 22px; }
.split .tick-list li { font-size: 15.5px; }
.tick-list-no li::before { border-color: var(--muted); }

.protocol {
  margin-top: clamp(54px, 7vw, 76px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--sand);
}
.protocol-head { padding: 30px clamp(24px, 3vw, 34px) 26px; }
.protocol-head h3 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.protocol-head p { margin-top: 12px; max-width: 64ch; font-size: 16px; color: var(--muted); }
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.protocol-grid > div { background: var(--paper); padding: 22px 24px 24px; }
.protocol-grid dt {
  font-size: 13.5px;
  color: var(--muted);
  min-height: 2.6em;
}
.protocol-grid dd {
  margin: 8px 0 0;
  font-size: clamp(22px, 2.4vw, 27px);
  font-weight: 600;
  letter-spacing: -0.03em;
}
@media (max-width: 900px) { .protocol-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .protocol-grid { grid-template-columns: 1fr; } }
.protocol-foot {
  padding: 20px clamp(24px, 3vw, 34px) 24px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
  max-width: 82ch;
}

/* ---------- CTA ---------- */

.section-cta {
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.section-cta::before {
  content: "";
  position: absolute; z-index: -1;
  left: 50%; bottom: -60%;
  transform: translateX(-50%);
  width: 90vw; height: 70vw; max-width: 900px; max-height: 620px;
  background: radial-gradient(ellipse at center, rgba(212,35,27,.26) 0%, transparent 66%);
}
.cta-inner { text-align: center; padding: clamp(10px, 2vw, 24px) var(--pad); }
.section-cta .eyebrow { color: rgba(255,255,255,.55); }
.cta-h { color: #fff; margin: 0 auto; max-width: 18ch; }
.cta-lede { margin: 22px auto 0; }
.cta-actions { justify-content: center; margin-top: 36px; }

/* ---------- footer ---------- */

.footer { background: var(--ink); color: var(--muted-dark); border-top: 1px solid var(--line-dark); padding: 44px 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand p { margin-top: 8px; font-size: 14.5px; }
.footer-legal {
  max-width: 54ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: #767d83;
}

/* ---------- reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

@media print {
  .nav, .hero-glow, .hero-grid { display: none; }
  body { font-size: 12px; }
  .hero, .section-diy, .section-cta, .footer { background: #fff !important; color: #000 !important; }
}

/* ---------- language globe ---------- */

.section-globe { background: var(--sand); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.globe-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  margin-top: clamp(40px, 5vw, 56px);
}
@media (max-width: 900px) { .globe-wrap { grid-template-columns: 1fr; } }

.globe-stage {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.globe-stage canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: grab;
  touch-action: pan-y;
  box-shadow: 0 40px 70px -40px rgba(10, 12, 13, .65);
}
.globe-stage canvas:active { cursor: grabbing; }
.globe-hint {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity .4s var(--ease);
}
.globe-hint.is-gone { opacity: 0; }

.globe-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(24px, 3vw, 32px);
}
.globe-tier {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.globe-country {
  margin-top: 14px;
  font-size: 15px;
  color: var(--muted);
}
.globe-word {
  margin-top: 6px;
  font-size: clamp(40px, 5.6vw, 58px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.12;
  min-height: 1.12em;
}
.globe-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  font-size: 15px;
  color: var(--text);
}
.globe-roman {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.globe-controls {
  display: flex;
  gap: 8px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.globe-btn {
  height: 38px;
  min-width: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.globe-btn:hover { border-color: var(--text); }
.globe-btn-wide { margin-left: auto; font-variant-numeric: tabular-nums; }

.globe-chips-label {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.globe-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease);
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.globe-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: clamp(48px, 6vw, 68px) 0 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.globe-stats > div { background: var(--paper); padding: 22px 22px 24px; }
.globe-stats dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.globe-stats dd {
  margin: 10px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
}
@media (max-width: 900px) { .globe-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .globe-stats { grid-template-columns: 1fr; } }

.kicker-dark { color: var(--text); max-width: 46ch; }

.nowrap { white-space: nowrap; }

/* ---------- developer guide ---------- */

.docs { background: var(--paper); }

.brand-tag {
  margin-left: 2px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

.docs-hero {
  background: var(--ink);
  color: #fff;
  padding: clamp(52px, 7vw, 82px) 0 clamp(44px, 6vw, 60px);
}
.docs-hero .eyebrow { color: rgba(255, 255, 255, .55); }
.docs-title {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 24ch;
}
.docs-lede {
  margin-top: 20px;
  max-width: 62ch;
  font-size: clamp(16px, 1.5vw, 18px);
  color: rgba(255, 255, 255, .72);
}
.docs-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(30px, 4vw, 42px);
  padding-top: 26px;
  border-top: 1px solid var(--line-dark);
}
.docs-facts li { font-size: 14px; color: rgba(255, 255, 255, .6); line-height: 1.45; }
.docs-facts span {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 4px;
}
@media (max-width: 860px) { .docs-facts { grid-template-columns: repeat(2, 1fr); } }

/* --- layout: sticky contents beside the body --- */

.docs-layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
  padding-top: clamp(40px, 5vw, 60px);
  padding-bottom: clamp(60px, 8vw, 100px);
}
@media (max-width: 960px) { .docs-layout { grid-template-columns: 1fr; } }

.docs-toc { position: sticky; top: 92px; }
@media (max-width: 960px) {
  .docs-toc {
    position: static;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
  }
}
.docs-toc-head {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.docs-toc ol { counter-reset: toc; margin-top: 12px; }
.docs-toc li { counter-increment: toc; }
.docs-toc a {
  display: block;
  padding: 6px 0 6px 26px;
  position: relative;
  font-size: 14px;
  color: var(--muted);
  border-radius: 4px;
  transition: color .15s var(--ease);
}
.docs-toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--line);
}
.docs-toc a:hover { color: var(--text); }
.docs-toc a:hover::before,
.docs-toc a.is-current::before { color: var(--accent); }
.docs-toc a.is-current { color: var(--text); font-weight: 500; }

/* --- body --- */

.docs-body { min-width: 0; }
.docs-section { scroll-margin-top: 88px; }
.docs-section + .docs-section {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: clamp(44px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.docs-body h2 {
  font-size: clamp(24px, 2.8vw, 32px);
  letter-spacing: -0.026em;
}
.docs-body h3 {
  margin-top: clamp(30px, 4vw, 42px);
  font-size: 18px;
  letter-spacing: -0.016em;
}
.docs-body h4 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.014em; }
.docs-body p {
  margin-top: 16px;
  max-width: 68ch;
  font-size: 16px;
  color: var(--muted);
}
.docs-body h2 + p { margin-top: 18px; }
.docs-body p strong, .docs-body li strong { color: var(--text); font-weight: 600; }
.docs-body em { font-style: italic; }
.docs-body a:not(.btn) {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.docs-body a:not(.btn):hover { color: var(--accent); }
.docs-body .muted { color: var(--muted); }
.docs-body .small { font-size: 13.5px; }

/* --- numbered getting-started steps --- */

.docs-steps {
  display: grid;
  gap: 1px;
  margin-top: clamp(28px, 4vw, 36px);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  counter-reset: step;
}
.docs-steps > li {
  background: var(--paper);
  padding: 26px clamp(20px, 3vw, 30px) 28px;
  counter-increment: step;
}
.docs-steps h3 {
  margin: 0 0 4px;
  font-size: 17.5px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.docs-steps h3::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}
.docs-steps p { margin-top: 10px; font-size: 15.5px; }

/* --- code --- */

.code {
  position: relative;
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--ink);
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e6ebee;
  -webkit-overflow-scrolling: touch;
}
.code code {
  font-family: inherit;
  white-space: pre;
  /* No ligatures in a reference: "=>" should look like two characters. */
  font-variant-ligatures: none;
}
.code .cm { color: #7d868d; }
.code[data-lang]::after {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .28);
}
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 5px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .78);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s var(--ease), background-color .15s var(--ease);
}
.code:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { background: rgba(255, 255, 255, .14); }
.copy.is-done { color: #7ee2a8; border-color: rgba(126, 226, 168, .5); opacity: 1; }
.code:has(.copy)[data-lang]::after { right: 68px; }

.docs-body code:not(.code code) {
  padding: 2px 6px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--text);
  white-space: nowrap;
}

/* --- tables --- */

.table-scroll {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.docs-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.docs-table th, .docs-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.docs-table thead th {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--sand);
  white-space: nowrap;
}
.docs-table tbody td { color: var(--muted); }
.docs-table tbody tr:last-child th,
.docs-table tbody tr:last-child td { border-bottom: 0; }
.docs-table td code, .docs-table th code { white-space: nowrap; }
.table-proto tbody td:first-child { width: 1%; white-space: nowrap; }

/* --- callouts --- */

.callout {
  margin-top: 26px;
  padding: 20px 22px;
  background: var(--sand);
  border-left: 2px solid var(--ink);
  border-radius: 0 8px 8px 0;
}
.callout-warn { border-left-color: var(--accent); background: #fdf5f4; }
.callout-head {
  margin: 0 0 6px !important;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.callout-warn .callout-head { color: var(--accent); }
.callout p { margin-top: 8px; font-size: 15px; }

.chip-red, .chip-green {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-red { background: #fdecea; color: #b01a13; }
.chip-green { background: #e8f5ee; color: var(--green); }

.docs-cards { margin-top: 26px; }
.docs-cards .card-plain p { font-size: 15px; }

/* --- specs --- */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin-top: 26px;
}
@media (max-width: 760px) { .spec-grid { grid-template-columns: 1fr; } }
.spec-grid h3 { margin-top: 0; }
.spec-grid dl { margin-top: 16px; }
.spec-grid dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.spec-grid dt { color: var(--muted); }
.spec-grid dd { margin: 0; text-align: right; font-weight: 500; }

.docs-cta {
  margin-top: clamp(40px, 5vw, 56px);
  padding: clamp(26px, 4vw, 36px);
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.docs-cta h3 { margin-top: 0; font-size: 21px; }
.docs-cta .hero-actions { margin-top: 24px; }

/* The one nav link that leaves the page. */
.nav-link-alt { color: #fff !important; }
.nav-link-alt::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-top: 1px solid var(--accent-hi);
  border-right: 1px solid var(--accent-hi);
  transform: rotate(45deg) translateY(-1px);
}

/* The developer guide is one screen: a single column, no contents list. */
.docs-single { max-width: 760px; }
.docs-plain { padding: clamp(40px, 5vw, 60px) var(--pad) clamp(60px, 8vw, 90px); }
.docs-plain .docs-section + .docs-section {
  margin-top: clamp(36px, 4vw, 48px);
  padding-top: clamp(32px, 4vw, 44px);
}
.docs-plain .docs-section:first-child + .docs-section { border-top: 0; }
.docs-hero .docs-single { padding-left: 0; padding-right: 0; }
.docs-table tbody td:first-child { white-space: nowrap; }
.docs-plain .docs-table tbody td:first-child { white-space: normal; }

/* The guide's nav has no section links, so the button claims the space. */
.docs .nav-inner > .btn { margin-left: auto; }

/* The JSON line is the point of the page: wrap it so the whole object is
   visible at once instead of scrolling off the right edge. */
.code-wrap { padding-top: 28px; }   /* clear the corner label when wrapping */
.code-wrap code { white-space: pre-wrap; word-break: break-word; }

.docs-plain .lede-first { margin-top: 0; font-size: 16px; }

/* The languages section closes on one line, so it can be bigger and louder. */
.kicker-big {
  max-width: 30ch;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.03em;
}
.kicker-accent { color: var(--accent); }

/* The languages section closes on one line, so it can be bigger and louder. */
.kicker-big {
  max-width: 30ch;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.03em;
}
.kicker-accent { color: var(--accent); }

/* ---------- safety notice and legal ---------- */

.hero-notice {
  margin-top: 26px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  max-width: 54ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .62);
}
.hero-notice a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--accent-hi);
  text-underline-offset: 3px;
}
.hero-notice a:hover { color: var(--accent-hi); }

/* A band, not a section: it interrupts the page on purpose. */
.notice-band {
  background: var(--sand);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding: clamp(44px, 6vw, 64px) 0;
}
.notice-inner { max-width: 820px; }
.notice-flag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.notice-h {
  margin-top: 14px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.026em;
  line-height: 1.12;
}
.notice-body {
  margin-top: 16px;
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
}
.notice-more { margin-top: 18px; font-size: 15px; }
.notice-more a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.notice-more a:hover { color: var(--accent); }

.footer-links { margin-top: 10px; font-size: 13.5px; color: #767d83; }
.footer-links a { color: var(--muted-dark); }
.footer-links a:hover { color: #fff; }

.legal-quote {
  margin: 18px 0 0;
  padding: 16px 20px;
  background: var(--sand);
  border-left: 2px solid var(--ink);
  font-size: 15.5px;
  color: var(--text);
}
.docs-body .legal-quote { max-width: 68ch; }

.legal-meta {
  margin: clamp(32px, 4vw, 44px) 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.legal-meta > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 9px 0;
  font-size: 14.5px;
}
.legal-meta dt {
  min-width: 120px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.legal-meta dd { margin: 0; color: var(--text); }
.docs-plain .tick-list { margin-top: 18px; }
.docs-plain .tick-list li { font-size: 16px; }

/* The shared model: one block, filled, so the picture shows both channels
   using the same thing rather than two lookalikes. */
.dg-box-shared rect { fill: var(--sand); stroke: var(--ink); stroke-width: 1.4; }

/* Language inclusion lookup and worldwide reference notes. */
.language-counts { margin-top: 32px; }
.language-notes, .language-catalog { margin-top: 36px; }
.language-notes p, .language-catalog > p { margin-top: 14px; max-width: 82ch; color: var(--muted); }
.language-notes a, .language-catalog a { text-decoration: underline; text-underline-offset: 3px; }
.language-catalog { padding-top: 32px; border-top: 1px solid var(--line); }
.language-lookup { margin-top: 24px; max-width: 640px; }
.language-lookup[hidden], .language-lookup-status[hidden] { display: none; }
.language-lookup label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.language-lookup-controls { display: flex; gap: 12px; }
.language-lookup input { flex: 1; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--text); font: inherit; }
.language-lookup button { height: auto; min-height: 48px; }
.language-catalog > .language-lookup-status { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--text); overflow-wrap: anywhere; }
.language-sources { margin-top: 18px; color: var(--muted); font-size: 13px; }
.language-sources summary { cursor: pointer; }
.language-sources p { margin-top: 12px; }
@media (max-width: 520px) { .language-lookup-controls { flex-direction: column; } }
.catalog-source { font-size: 13px; }
.globe-word.is-catalog-name { font-size: clamp(24px, 4vw, 44px); overflow-wrap: anywhere; }
.globe-coverage { margin-top: 10px; font-size: 15px; color: var(--muted); }
.globe-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 20px 0; font-size: 13px; }
.globe-legend li { display: flex; align-items: center; gap: 7px; }
.globe-legend span { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.legend-language { background: #ff6555; }
.legend-dialect { background: #69d0ee; }
.legend-selected { background: #fff; border: 2px solid var(--ink); }
.globe-read { border-top: 1px solid var(--line); padding-top: 20px; }
.globe-position, .globe-note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.globe-source { margin-top: 14px; overflow-wrap: anywhere; }
.globe-source a, .globe-search-link { font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.globe-search-link { display: inline-block; margin-top: 18px; }
.globe-panel > .globe-chips-label { margin-top: 0; }
.globe-hint { width: 100%; text-align: center; }
.globe-meta { overflow-wrap: anywhere; }
.globe-controls .globe-btn-wide { height: auto; min-height: 38px; }
.country-picker-label { display: block; margin: 20px 0 8px; font-size: 13px; color: var(--muted); }
.country-picker { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--text); font: inherit; }
.country-search-results { margin-top: 8px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; }
.country-search-results[hidden] { display: none; }
.country-search-results button { display: block; width: 100%; padding: 10px; border: 0; border-radius: 4px; background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; overflow-wrap: anywhere; }
.country-search-results button:hover, .country-search-results button:focus-visible { background: #f2f2ef; outline: 2px solid var(--accent); outline-offset: -2px; }
.country-search-status { margin-top: 8px; color: var(--muted); font-size: 13px; }
.country-search-status:empty { display: none; }
.country-read { margin-top: 24px; }
.country-name { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.03em; overflow-wrap: anywhere; }
.country-language-groups > div { margin-top: 20px; }
.country-language-groups h4 { font-size: 12px; color: var(--muted); font-weight: 500; }
.country-language-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-height: 280px; overflow-y: auto; }
.country-language-list li { padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; font-size: 17px; overflow-wrap: anywhere; }
.country-regional { margin-top: 20px; color: var(--muted); font-size: 13px; }
.country-regional summary { cursor: pointer; }
.country-regional ul { margin-top: 12px; max-height: 220px; overflow-y: auto; }
.country-regional li { padding: 5px 0; }
.country-attribution { max-width: 90ch; margin-top: 28px; color: var(--muted); }
.country-attribution a { text-decoration: underline; text-underline-offset: 3px; }
/* ---------- language ---------- */

/* Held invisible for the moment between first paint and the translation
   landing, so a Spanish or Chinese reader never sees a flash of English.
   i18n.js lifts it, with a timeout as a backstop. */
html.i18n-wait body { visibility: hidden; }

.nav-lang { margin-left: auto; display: flex; }
.nav-links + .nav-lang { margin-left: 0; }
.nav-lang + .btn-primary,
.docs .nav-inner > .nav-lang + .btn { margin-left: 0; }
@media (max-width: 900px) { .nav-links + .nav-lang { margin-left: auto; } .nav-links + .nav-lang .lang::before { display: none; } }

/* The picker reads as part of the nav: a mono label in the eyebrow's voice,
   set off from the section links by a hairline, opening a panel in the nav's
   own ink. Red marks the current language, as it marks everything live here. */
.nav-lang, .lang, .lang-chev { flex: none; }
.lang { position: relative; display: flex; align-items: center; }
.nav-links + .nav-lang .lang::before {
  content: ''; width: 1px; height: 16px; margin-right: 8px;
  background: var(--line-dark);
}
.lang-seg { display: flex; align-items: center; gap: 2px; }
.lang-opt {
  position: relative; height: 40px; padding: 0 6px; margin: 0;
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
  transition: color .15s var(--ease);
}
.lang-opt[lang="zh-Hans"] { font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', var(--mono); letter-spacing: 0; font-size: 13px; }
.lang-opt[lang="zh-Hant"] { font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', var(--mono); letter-spacing: 0; font-size: 13px; }
.lang-opt:hover { color: rgba(255, 255, 255, .85); }
.lang-opt[aria-current="true"] { color: #fff; cursor: default; }
.lang-opt[aria-current="true"]::after {
  content: ''; position: absolute; left: 6px; right: 6px; bottom: 6px;
  height: 2px; border-radius: 1px; background: var(--accent-hi);
}
.lang-opt:not([lang^="zh"])[aria-current="true"]::after { right: calc(6px + 0.12em); }
.lang-opt:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: -4px; border-radius: 6px; }

/* Short of room (main.js sets .nav-lang-menu): the row folds into one label
   that opens the menu. */
.lang-btn, .nav-lang-menu .lang-seg { display: none; }
.nav-lang-menu .lang-btn { display: inline-flex; }

.lang-btn { align-items: center; gap: 7px;
  height: 40px; padding: 0 4px; margin: 0;
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, .66);
  transition: color .15s var(--ease);
}
.lang-btn:hover, .lang.is-open .lang-btn { color: #fff; }
.lang-btn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 4px; }
.lang-code { min-width: 2ch; text-align: center; }
.lang-chev { width: 9px; height: 6px; opacity: .7; transition: transform .18s var(--ease); }
.lang.is-open .lang-chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute; top: calc(100% + 12px); right: -8px; z-index: 60;
  min-width: 196px; padding: 6px;
  background: var(--ink);
  border: 1px solid var(--line-dark); border-radius: var(--r);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .9);
}
.lang-menu[hidden] { display: none; }
.lang-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 38px; padding: 0 12px;
  background: none; border: 0; border-radius: 6px; cursor: pointer;
  font: 500 14.5px/1 var(--sans); text-align: left;
  color: rgba(255, 255, 255, .66);
  transition: background-color .12s var(--ease), color .12s var(--ease);
}
.lang-item:hover, .lang-item:focus-visible { background: rgba(255, 255, 255, .06); color: #fff; outline: none; }
.lang-item[lang="zh-Hans"] .lang-tag { font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; letter-spacing: 0; }
.lang-item[lang="zh-Hant"] .lang-tag { font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif; letter-spacing: 0; }
.lang-item[lang="zh-Hans"] { font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', sans-serif; }
.lang-item[lang="zh-Hant"] { font-family: 'Inter', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', 'Noto Sans TC', sans-serif; }
.lang-name { flex: 1; }
.lang-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  color: rgba(255, 255, 255, .32);
}
.lang-item[aria-checked="true"] { color: #fff; }
.lang-item[aria-checked="true"] .lang-tag { color: var(--accent-hi); }
.lang-item[aria-checked="true"] .lang-name::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 10px 1px -2px;
  border-radius: 1px; background: var(--accent-hi); vertical-align: middle;
}
.lang-item[aria-checked="false"] .lang-name { padding-left: 14px; }

/* Section links drop out whenever they would not fit on one row, which in
   Spanish happens well before 900px. main.js measures and sets .nav-tight. */
.nav-links a { white-space: nowrap; }
.nav-snug .nav-inner { gap: 16px; }
.nav-snug .nav-links { gap: 14px; }
.nav-snug .nav-links a { font-size: 13.5px; }
.nav-tight .nav-links, .nav-bare .brand-tag { display: none; }
.nav-min .nav-inner { gap: 10px; }
.nav-min .btn-sm { padding: 0 12px; font-size: 13px; }
.nav-tight .nav-links + .nav-lang { margin-left: auto; }
.nav-tight .nav-links + .nav-lang .lang::before { display: none; }
@media (max-width: 560px) {
  .nav-inner { gap: 14px; }
  .nav .btn-sm { padding: 0 14px; white-space: nowrap; }
}

/* Chinese: system CJK faces after Inter (Inter carries the Latin and digits),
   and none of the negative tracking tuned for Latin display type. */
html:lang(zh-Hans) { --sans: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Noto Sans SC', sans-serif; }
html:lang(zh-Hant) { --sans: 'Inter', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', 'Source Han Sans TC', 'Noto Sans TC', sans-serif; }
html:lang(zh-Hans) { --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', monospace; }
html:lang(zh-Hant) { --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', 'Noto Sans TC', monospace; }
html:lang(zh-Hans) h1, html:lang(zh-Hans) h2, html:lang(zh-Hans) h3,
html:lang(zh-Hant) h1, html:lang(zh-Hant) h2, html:lang(zh-Hant) h3,
html:lang(zh-Hans) .hero-title, html:lang(zh-Hant) .hero-title,
html:lang(zh-Hans) .h2, html:lang(zh-Hant) .h2,
html:lang(zh-Hans) .docs-title, html:lang(zh-Hant) .docs-title { letter-spacing: 0; line-height: 1.25; }
html:lang(zh-Hans) body, html:lang(zh-Hant) body { line-height: 1.75; }

/* The governing-language note on the legal page only matters in translation. */
.i18n-note { margin-top: 1rem; font-size: 14px; opacity: .7; }
html:lang(en) .i18n-note { display: none; }

/* ---------- ordering and build vs. buy ---------- */

.price-link, .diy-more a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.price-link { color: var(--text); }
.price-link:hover { color: var(--accent); }
.diy-more { margin-top: 22px; font-size: 15.5px; }
.diy-more a { color: var(--muted-dark); text-decoration-color: var(--accent-hi); }
.diy-more a:hover { color: #fff; }

.order { margin-top: auto; display: grid; gap: 10px; }
.order-label {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.order-row { display: flex; align-items: center; gap: 14px; }
.order-qty, .calc-input {
  width: 120px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  font: 500 17px var(--sans);
  font-variant-numeric: tabular-nums;
}
.order-qty:focus, .calc-input:focus { outline: none; border-color: var(--text); }
.order-total {
  margin-left: auto;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.order-math { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-price .order .btn { margin-top: 6px; }
.order-fine { font-size: 12.5px; line-height: 1.5; color: var(--muted); }

.dollar-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 26px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
}
.dollar-half { display: grid; gap: 6px; align-content: start; padding: 22px 22px 24px; }
.dollar-hw { background: var(--sand); }
.dollar-sw { background: var(--ink); color: #fff; }
.dollar-amt { font-size: clamp(32px, 4vw, 40px); font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.dollar-sw .dollar-amt { color: var(--accent-hi); }
.dollar-what { font-weight: 600; font-size: 16px; }
.dollar-why { font-size: 14px; line-height: 1.5; color: var(--muted); }
.dollar-sw .dollar-why { color: var(--muted-dark); }
@media (max-width: 560px) { .dollar-split { grid-template-columns: 1fr; } }

.bvb-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.docs-plain .bvb-table tbody td:first-child { white-space: normal; }
.bvb-table tbody td:first-child strong { color: var(--text); }
.bvb-total td { background: var(--sand); color: var(--text); }

.calc {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
}
.calc-inputs { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.calc-field { display: grid; gap: 8px; }
.calc-label {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.calc-input { width: 160px; }
.calc-money { display: flex; align-items: center; gap: 6px; font-size: 17px; color: var(--muted); }
.calc-out {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.calc-out dt { font-size: 13.5px; color: var(--muted); }
.calc-out dd {
  margin: 4px 0 0;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) { .calc-out { grid-template-columns: 1fr; } }
.docs-body .calc-verdict { margin-top: 18px; font-weight: 600; color: var(--text); }

/* --- the cost chart on build-vs-buy.html. Buy is the site red, solid; build
   is blue (#2a6fb0), dashed. Pair checked with the dataviz validator: CVD
   ΔE 21.7, normal 31.5, both >= 3:1 on the surface. --- */

.bvb-chart { margin: 28px 0 0; }
.bvb-chart figcaption { display: grid; gap: 10px; }
.bvb-chart-title { font-weight: 600; font-size: 16px; color: var(--text); }
.bvb-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13.5px; color: var(--muted); }
.bvb-key { display: inline-flex; align-items: center; gap: 8px; }
.bvb-swatch { width: 22px; height: 0; border-top: 2.5px solid; }
.bvb-swatch-buy { border-color: var(--accent); }
.bvb-swatch-build { border-color: #2a6fb0; border-top-style: dashed; }

.bvb-plot { position: relative; margin-top: 14px; }
.bvb-plot svg { width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.bvb-plot svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.bvb-plot .cz { fill: none; }
.bvb-plot .cz-buy { fill: #fdf3f2; }
.bvb-plot .cz-label { font-size: 12px; font-weight: 600; fill: var(--muted); }
.bvb-plot .cz-label-buy { fill: #a81c15; }
.bvb-plot .grid { stroke: #ecebe7; stroke-width: 1; }
.bvb-plot .axis { stroke: #c9c6bf; stroke-width: 1; }
.bvb-plot .tick { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.bvb-plot .tick-y { text-anchor: end; }
.bvb-plot .tick-x { text-anchor: middle; }
.bvb-plot .axis-title { font-size: 12.5px; fill: var(--muted); text-anchor: middle; }
.bvb-plot .ln { stroke-width: 2.5; stroke-linecap: round; fill: none; }
.bvb-plot .ln-buy { stroke: var(--accent); }
.bvb-plot .ln-build { stroke: #2a6fb0; stroke-dasharray: 7 5; }
.bvb-plot .end-label { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.bvb-plot .end-value { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.bvb-plot .even-guide { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 4; opacity: .5; }
.bvb-plot .even-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.bvb-plot .even-label { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.bvb-plot .even-value { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.bvb-plot .xhair-line { stroke: var(--ink); stroke-width: 1; opacity: .35; }
.bvb-plot .xhair-dot { stroke: var(--paper); stroke-width: 2; }
.bvb-plot .xhair-buy { fill: var(--accent); }
.bvb-plot .xhair-build { fill: #2a6fb0; }
.bvb-plot .hit { fill: transparent; cursor: crosshair; }

.bvb-tip {
  position: absolute; top: 8px;
  transform: translateX(14px);
  min-width: 160px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px -14px rgba(10,12,13,.45);
  font-size: 13px;
  pointer-events: none;
}
.bvb-tip.is-left { transform: translateX(calc(-100% - 14px)); }
.docs-body .bvb-tip p { margin: 0; max-width: none; font-size: 13px; }
.docs-body .bvb-tip .bvb-tip-head { color: var(--muted); margin-bottom: 6px; }
.bvb-tip-row { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.bvb-tip-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.bvb-tip-key { width: 14px; border-top: 2.5px solid; }
.bvb-tip-buy { border-color: var(--accent); }
.bvb-tip-build { border-color: #2a6fb0; border-top-style: dashed; }
.docs-body .bvb-tip .bvb-tip-verdict { margin-top: 6px; color: var(--text); font-weight: 600; }
.docs-body .bvb-chart-note { font-size: 14px; margin-top: 12px; }
.bvb-plot .cz-label-end { text-anchor: end; }

.volume-note {
  margin-top: 16px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--green);
  border-radius: var(--r);
  background: #f3f8f5;
}
.docs-body .volume-note-head { margin: 0; font-weight: 600; color: var(--text); }
.docs-body .volume-note p + p { margin-top: 6px; font-size: 15px; }

/* Per-unit chart, log x: the step and its labels, the $1 floor. */
.bvb-plot .floor { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 1 4; opacity: .45; }
.bvb-plot .ln-buy { stroke-linejoin: miter; stroke-linecap: butt; }
.bvb-plot .buy-label { font-size: 13px; font-weight: 600; fill: #a81c15; }
.bvb-plot .step-label { font-size: 12.5px; font-weight: 600; fill: var(--text); text-anchor: end; }
.bvb-plot .step-value { font-size: 12px; fill: var(--muted); text-anchor: end; }
.bvb-plot .step-tick { stroke: var(--ink); stroke-width: 1; opacity: 0; }
.bvb-plot .note { font-size: 12px; fill: var(--muted); }
.bvb-plot .note-build { fill: #2a6fb0; }
.bvb-plot .even-label-end { text-anchor: end; }
.bvb-plot .axis-title-y { text-anchor: middle; transform-box: fill-box; transform-origin: center; transform: rotate(-90deg); }
