/* ============================================================
   AutoSE site: the page shell (header, sections, footer).

   Colours and type come from theme.css, the dashboard's own tokens:
   light = drafting paper (pale blue table, white framed panels, pen blue),
   dark  = Catppuccin Mocha with no borders (surfaces separate things).
   This file adds no colour of its own; it only picks tokens.
   ============================================================ */

/* A few site-level choices that differ between the two themes. */
:root {
  --link: var(--pen-deep);
  --badge-edge: var(--pen);
  /* The "$" on the command block (--code-bg is navy in light, Mantle in dark). */
  --code-prompt: #979fb1;
  --wrap: 1120px;
  --gutter: 24px;
  --radius: 14px;

  /* Older names, mapped onto the theme, so anything still using them
     (the demo's stylesheet, while it is rebuilt) follows the theme too. */
  --ink: var(--text);
  --ink-soft: var(--text);
  --slate: var(--text-2);
  --bone: var(--paper);
  --bone-2: var(--sheet-2);
  --card: var(--sheet);
  --signal: var(--pen);
  --signal-deep: var(--pen-deep);
  --line: var(--edge);
  --line-soft: var(--edge);
}

:root[data-theme="dark"] {
  --link: var(--pen);
  --badge-edge: transparent;
  --code-prompt: var(--text-2);
}

/* ---------- base ---------- */

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  /* The drafting grid, as in the dashboard: fine squares and every fifth line darker. */
  background:
    linear-gradient(var(--grid-2) 1px, transparent 1px) 0 0 / 100px 100px,
    linear-gradient(90deg, var(--grid-2) 1px, transparent 1px) 0 0 / 100px 100px,
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--pen);
}

::selection {
  background: var(--pen-soft);
  color: var(--text);
}

a {
  color: var(--link);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

code,
pre {
  font-family: var(--font-mono);
}

p code,
li code,
.run-list code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface0);
  font-size: 0.86em;
  color: var(--text);
  overflow-wrap: anywhere;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

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

[hidden] {
  display: none !important;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--pen);
  color: var(--on-pen);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- shared pieces ---------- */

/* Small mono capitals, for labels and measures (the dashboard's .lbl). */
.lbl {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* A hand-lettered margin note, used sparingly. */
.hand {
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 1.3;
  color: var(--pen-deep);
}

/* A panel: in light, a white drawing sheet with an inked frame, a fine rule
   inside it and a hard offset shadow; in dark, a plain Base surface. */
.sheet {
  background: var(--sheet);
  border: 1.5px solid var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--sheet-frame);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--pen);
  color: var(--on-pen);
}

.btn-primary:hover {
  background: var(--pen-deep);
}

.btn-ghost {
  background: var(--surface0);
  border-color: var(--edge-2);
  color: var(--pen-deep);
}

.btn-ghost:hover {
  background: var(--pen-soft);
  border-color: var(--pen);
}

.btn-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 9px;
}

.pro-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--pen-soft);
  color: var(--pen-deep);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}

/* ---------- navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-nib {
  width: 22px;
  height: 27px;
  flex: none;
  color: var(--pen);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 15px;
}

.nav-links a {
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--text-2);
  text-decoration: none;
}

.nav-links a:hover {
  background: var(--pen-soft);
  color: var(--pen-deep);
}

.nav-links a[aria-current="page"] {
  color: var(--pen-deep);
  font-weight: 700;
}

.nav-install {
  margin-left: 6px;
}

.theme-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--edge-2);
  border-radius: 10px;
  background: var(--surface0);
  color: var(--text-2);
}

.theme-btn:hover {
  background: var(--pen-soft);
  color: var(--pen-deep);
}

.theme-btn svg {
  grid-area: 1 / 1;
}

/* Show the moon in light (switch to dark) and the sun in dark. */
.theme-btn .i-sun {
  display: none;
}

:root[data-theme="dark"] .theme-btn .i-sun {
  display: block;
}

:root[data-theme="dark"] .theme-btn .i-moon {
  display: none;
}

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

.hero {
  padding: 72px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 56px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 18px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 4.6vw, 3.45rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--text);
  text-wrap: balance;
}

/* A pen stroke under the promise. */
.pen-underline {
  position: relative;
  white-space: nowrap;
  color: var(--pen-deep);
}

.pen-underline::after {
  content: "";
  position: absolute;
  left: -1%;
  right: -2%;
  bottom: -0.1em;
  height: 0.2em;
  background: var(--pen);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C 50 6, 110 4, 170 8 S 260 15, 297 6' fill='none' stroke='black' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C 50 6, 110 4, 170 8 S 260 15, 297 6' fill='none' stroke='black' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.hero-sub {
  max-width: 36em;
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

/* The installer card. */
.install-card {
  position: relative;
  padding: 18px 20px 20px;
  min-width: 0;
}

.install-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.install-title {
  font-size: 11.5px;
}

/* A segmented switch, like the dashboard's tier switch. */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: 11px;
  background: var(--sheet-2);
}

.tab {
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
}

.tab:hover {
  color: var(--pen-deep);
}

.tab.is-active {
  background: var(--pen-soft);
  border-color: var(--badge-edge);
  color: var(--pen-deep);
}

.install-actions,
.panel-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.install-actions {
  margin-top: 10px;
}

.install-cmd,
.panel-cmd {
  display: block;
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.install-cmd {
  padding: 14px;
  font-size: 13.5px;
}

.install-cmd.is-hidden {
  display: none;
}

.prompt {
  margin-right: 4px;
  color: var(--code-prompt);
  user-select: none;
}

.install-cmd code,
.panel-cmd code {
  user-select: all;
  -webkit-user-select: all;
}

.select-hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

.install-foot {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.install-foot strong {
  color: var(--text);
}

.install-note {
  transform: rotate(-1.5deg);
  font-size: 16px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 56px;
  font-size: 14.5px;
  color: var(--text-2);
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-meta li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pen);
}

/* ---------- provenance ---------- */

.prov {
  margin-top: 8px;
}

.prov-block {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 5px;
}

.prov-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.prov-cell + .prov-cell {
  box-shadow: inset 1px 0 0 var(--edge);
}

.prov-cell:hover {
  background: var(--pen-soft);
  box-shadow: none;
}

.prov-cell:hover + .prov-cell {
  box-shadow: none;
}

.prov-value {
  font-weight: 700;
  font-size: 16px;
}

.prov-arrow {
  display: inline-block;
  color: var(--pen);
  transition: transform 0.2s;
}

.prov-cell:hover .prov-arrow {
  transform: translateX(3px);
}

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

.section {
  padding: 96px 0 0;
}

.section-head {
  max-width: 760px;
  margin-bottom: 36px;
}

.section-head .eyebrow {
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.section-lede {
  max-width: 62ch;
  margin-top: 14px;
  font-size: 17px;
  color: var(--text-2);
}

.footnote {
  margin-top: 20px;
  font-size: 14.5px;
  color: var(--text-2);
}

/* The demo sits in its own window; give it room. */
.try-section .demo-frame {
  margin-top: 0;
}

/* ---------- how it works: the route ---------- */

.route-sheet {
  padding: 22px 28px 28px;
}

.route-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.r-done {
  fill: none;
  stroke: var(--pen);
  stroke-width: 3;
  stroke-linecap: round;
}

.wp {
  fill: var(--sheet);
  stroke: var(--pen);
  stroke-width: 2.5;
}

.wp.done {
  fill: var(--pen);
}

.wp.pro {
  stroke-dasharray: 3.5 3;
}

.wp.you {
  stroke-width: 3;
}

.wp-l {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  fill: var(--text-2);
}

.wp-n {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  fill: var(--text);
}

.wp-s {
  font-family: var(--font-body);
  font-size: 14.5px;
  fill: var(--text-2);
}

.wp-s.ink {
  fill: var(--pen-deep);
  font-weight: 700;
}

.redloop {
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
  stroke-linecap: round;
}

.redhead,
.revdot {
  fill: var(--red);
}

.revtxt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  fill: var(--sheet);
}

.margin-note {
  font-family: var(--font-hand);
  font-size: 17px;
  fill: var(--red);
}

.nib-on-route {
  color: var(--pen);
}

/* The words under the route: one column per station, so each sits under its dot. */
.route-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px dashed var(--edge-2);
}

.rs {
  position: relative;
  padding: 0 10px;
  text-align: center;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.rs h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rs-back,
.rs-loop {
  display: none;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  padding: 22px 24px 24px;
  min-width: 0;
}

.card h3 {
  margin: 6px 0 8px;
  font-size: 19px;
  line-height: 1.3;
  color: var(--text);
}

.card p {
  font-size: 15.5px;
  color: var(--text-2);
}

.card p.lbl {
  font-size: 11.5px;
}

.card strong {
  color: var(--text);
}

/* Tiers. */
.tier-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border: 1.5px solid var(--badge-edge);
  border-radius: 11px;
  background: var(--pen-soft);
  color: var(--pen-deep);
}

.tier-badge.tier-craft {
  background: var(--pen);
  color: var(--on-pen);
}

.tier-badge.tier-forge {
  background: var(--pen-deep);
  border-color: var(--pen-deep);
  color: var(--sheet);
}

.tier h3 {
  margin-top: 0;
  font-size: 21px;
}

.tier .tier-runs {
  margin-bottom: 10px;
  color: var(--pen-deep);
}

/* Editions. */
.editions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.edition {
  display: flex;
  flex-direction: column;
  padding: 26px 28px 28px;
}

.edition h3 {
  font-size: 24px;
}

.edition-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}

.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--pen-soft);
  color: var(--pen-deep);
  font-size: 14px;
  font-weight: 700;
}

.edition-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 24px;
  font-size: 15.5px;
  color: var(--text-2);
}

.edition-list li {
  position: relative;
  padding-left: 24px;
}

.edition-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--pen);
  border-bottom: 2px solid var(--pen);
  transform: rotate(-45deg);
}

.edition-cta {
  margin-top: auto;
}

/* ---------- install ---------- */

.install-detail {
  padding-bottom: 96px;
}

.install-detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: start;
}

.run-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
}

.run-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 16px;
  font-size: 15.5px;
  color: var(--text-2);
}

.run-list strong {
  color: var(--text);
}

.run-n {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.8px solid var(--pen);
  border-radius: 50%;
  background: var(--sheet);
  color: var(--pen-deep);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
}

.install-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  margin-top: 8px;
}

.panel-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-note {
  font-size: 14.5px;
  color: var(--text-2);
}

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

.footer {
  background: var(--panel);
  border-top: 1px solid var(--edge);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 28px;
}

.footer-brand p {
  max-width: 40ch;
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--text-2);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: flex-start;
}

.footer-links a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 15px;
  text-decoration: none;
}

.footer-links a:hover {
  background: var(--pen-soft);
  color: var(--pen-deep);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  position: relative;
  padding-top: 18px;
  padding-bottom: 32px;
  font-size: 13.5px;
  color: var(--text-2);
}

.footer-base::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--edge);
}

/* ---------- research page ---------- */

.page-hero {
  padding-bottom: 8px;
}

.page-hero .hero-sub {
  max-width: 44em;
}

.pub-section {
  padding: 64px 0 96px;
}

.pub-count {
  margin: -16px 0 24px;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pub {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 26px 24px 22px;
}

.pub-index {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.8px solid var(--pen);
  border-radius: 50%;
  color: var(--pen-deep);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
}

.pub-venue {
  display: inline-block;
  margin-bottom: 6px;
}

.pub-title {
  font-size: 19px;
  line-height: 1.35;
}

.pub-title a {
  color: var(--text);
  text-decoration: none;
}

.pub-title a:hover {
  color: var(--pen-deep);
  text-decoration: underline;
}

.pub-authors {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--text-2);
}

.pub-desc {
  max-width: 72ch;
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--text-2);
}

.pub-link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 700;
  font-size: 15px;
}

/* ---------- the nib for older markup (a span with class brand-mark) ---------- */

.brand-mark {
  display: inline-block;
  width: 16px;
  height: 19px;
  flex: none;
  background: var(--pen);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 48'%3E%3Cg fill='none' stroke='black' stroke-width='2.6' stroke-linejoin='round'%3E%3Cpath d='M12 4h16v14l-4 4H16l-4-4z'/%3E%3Cpath d='M16 22l4 16 4-16'/%3E%3C/g%3E%3Ccircle cx='17' cy='11' r='2' fill='black'/%3E%3Ccircle cx='23' cy='11' r='2' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 48'%3E%3Cg fill='none' stroke='black' stroke-width='2.6' stroke-linejoin='round'%3E%3Cpath d='M12 4h16v14l-4 4H16l-4-4z'/%3E%3Cpath d='M16 22l4 16 4-16'/%3E%3C/g%3E%3Ccircle cx='17' cy='11' r='2' fill='black'/%3E%3Ccircle cx='23' cy='11' r='2' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}

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

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- narrower screens ---------- */

@media (max-width: 1060px) {
  .nav-links a.nav-ext {
    display: none;
  }
}

@media (max-width: 980px) {
  .hero {
    padding-top: 56px;
  }

  .hero-grid,
  .install-detail-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .install-card {
    max-width: 640px;
  }

  .hero-meta {
    margin-top: 48px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tier-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .install-detail-panel {
    margin-top: 0;
  }
}

/* Below this the route reads top to bottom, one row per station, as the
   dashboard draws it on a phone. */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .route-sheet {
    padding: 26px 22px 24px 14px;
  }

  .route-svg {
    display: none;
  }

  .route-steps {
    --x: 34px;
    --gap: 22px;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    margin: 0;
    padding: 0;
    border: 0;
  }

  .rs {
    padding: 0 0 0 58px;
    text-align: left;
    font-size: 15.5px;
  }

  .rs h3 {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    margin-bottom: 4px;
    font-size: 18px;
    line-height: 1.35;
    color: var(--text);
  }

  .rs h3 .pro-chip {
    vertical-align: baseline;
  }

  /* The station's dot, then the ink line down to the next one. */
  .rs::before {
    content: "";
    position: absolute;
    z-index: 1;
    left: calc(var(--x) - 8px);
    top: 4px;
    width: 16px;
    height: 16px;
    border: 2.5px solid var(--pen);
    border-radius: 50%;
    background: var(--pen);
  }

  .rs:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(var(--x) - 1.5px);
    top: 12px;
    width: 3px;
    height: calc(100% + var(--gap));
    background: var(--pen);
  }

  .rs-pro::before {
    background: var(--sheet);
    border-style: dashed;
  }

  .rs-you::before {
    left: calc(var(--x) - 10px);
    top: 2px;
    width: 20px;
    height: 20px;
    border-width: 3px;
    background: var(--sheet);
  }

  /* The send-back: a red bracket from Validate's dot up to Execute's. */
  .rs-loop {
    display: block;
    position: absolute;
    left: 6px;
    top: 11px;
    width: calc(var(--x) - 6px - 12px);
    height: calc(100% + var(--gap) + 1px);
    border: 2px solid var(--red);
    border-right: 0;
    border-radius: 12px 0 0 12px;
  }

  .rs-loop::after {
    content: "";
    position: absolute;
    right: -6px;
    top: -6px;
    border-left: 8px solid var(--red);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
  }

  .rs-back {
    display: block;
    margin-top: 6px;
    color: var(--red);
  }
}

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

  body {
    font-size: 16px;
  }

  .hero {
    padding: 40px 0 28px;
  }

  .hero-title {
    font-size: clamp(1.9rem, 8.6vw, 2.3rem);
  }

  .hero-sub {
    font-size: 17px;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .install-card {
    padding: 16px 14px 16px;
  }

  .install-cmd,
  .panel-cmd {
    padding: 12px 14px;
    font-size: 13.5px;
  }

  .hero-meta {
    margin-top: 36px;
    gap: 8px 16px;
    font-size: 14px;
  }

  .prov-block {
    grid-template-columns: minmax(0, 1fr);
  }

  .prov-cell + .prov-cell {
    box-shadow: inset 0 1px 0 var(--edge);
  }

  .section {
    padding-top: 72px;
  }

  .section-head {
    margin-bottom: 28px;
  }

  .section-lede {
    font-size: 16px;
  }

  .card-grid,
  .editions-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .card {
    padding: 20px;
  }

  .edition {
    padding: 22px 20px 24px;
  }

  .install-detail {
    padding-bottom: 72px;
  }

  .install-detail-panel {
    padding: 18px 14px;
  }

  .pub {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 20px;
  }

}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --- benchmark ------------------------------------------------- */
.bench-sheet {
  margin-top: 28px;
  padding: 6px 4px;
  overflow-x: auto;
}

.bench-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15.5px;
  color: var(--text);
}

.bench-table caption {
  caption-side: top;
  text-align: left;
  padding: 12px 18px 8px;
}

.bench-table th,
.bench-table td {
  padding: 12px 18px;
  text-align: left;
  border-top: 1px solid var(--edge);
  font-variant-numeric: tabular-nums;
}

.bench-table thead th {
  border-top: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.bench-table tbody th {
  font-weight: 600;
}

.bench-us th,
.bench-us td {
  background: var(--pen-soft);
}

.bench-pct {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
}

.bench-tag {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.bench-notes {
  max-width: 78ch;
  margin: 22px 0 0;
  padding-left: 1.1rem;
  font-size: 15px;
  color: var(--text-2);
}

.bench-notes li {
  margin-bottom: 8px;
}

.bench-notes strong {
  color: var(--text);
}

/* --- benchmark bar chart --------------------------------------- */
.bench-chart {
  --bench-us: #2552fc;
  --bench-other: #7d879c;
  --bench-max: 30; /* percent at the top of the axis */
  --bench-h: 240px; /* plot height */
  margin: 28px 0 0;
  padding: 16px 22px 18px;
}

:root[data-theme="dark"] .bench-chart {
  --bench-us: #5f92ee;
  --bench-other: #7f849c;
}

.bench-chart figcaption {
  padding: 0 0 18px;
}

.bench-plot {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 10px;
  padding-top: 18px; /* room for the tallest bar's value */
}

.bench-yaxis {
  position: relative;
  height: var(--bench-h);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}

.bench-yaxis span {
  position: absolute;
  right: 0;
  bottom: calc(var(--t) / var(--bench-max) * 100%);
  transform: translateY(50%);
}

.bench-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 9rem));
  justify-content: space-around;
  gap: 16px;
  /* gridlines at 0, 10, 20 and 30 percent, behind the bars */
  background:
    linear-gradient(to top, var(--text-2) 1px, transparent 1px) 0 calc(var(--bench-h) - 1px) / 100% 1px no-repeat,
    repeating-linear-gradient(to top, transparent 0 calc(var(--bench-h) / 3 - 1px), var(--pencil) calc(var(--bench-h) / 3 - 1px) calc(var(--bench-h) / 3)) 0 0 / 100% var(--bench-h) no-repeat;
}

.bench-col {
  position: relative;
  display: grid;
  grid-template-rows: var(--bench-h) auto;
  border-radius: 6px;
  outline: none;
}

.bench-col-bar {
  position: relative;
  align-self: end;
  justify-self: center;
  width: min(100%, 4.5rem);
  height: calc(var(--v) / var(--bench-max) * var(--bench-h));
  background: var(--bench-other);
  border-radius: 4px 4px 0 0;
  transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i) * 0.15s), filter 0.15s;
}

.bench-col-us .bench-col-bar {
  background: var(--bench-us);
}

.bench-col-val {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.3s calc(0.6s + var(--i) * 0.15s);
}

.bench-col-name {
  padding-top: 10px;
  text-align: center;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

/* Bars wait at zero until the chart scrolls into view (main.js); without the
 * script, or with reduced motion, they are drawn at full height. */
.bench-chart.bench-wait .bench-col-bar {
  height: 0;
}

.bench-chart.bench-wait .bench-col-val {
  opacity: 0;
}

.bench-col:hover .bench-col-bar,
.bench-col:focus-visible .bench-col-bar {
  filter: brightness(1.12);
}

.bench-col::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% - var(--bench-h) + var(--v) / var(--bench-max) * var(--bench-h) + 32px);
  transform: translateX(-50%);
  z-index: 2;
  width: max-content;
  max-width: 15rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--text);
  color: var(--sheet);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.bench-col:hover::after,
.bench-col:focus-visible::after {
  opacity: 1;
}

@media (max-width: 560px) {
  .bench-chart {
    --bench-h: 200px;
    padding: 14px 14px 16px;
  }
  .bench-plot {
    grid-template-columns: 2.4rem 1fr;
    gap: 6px;
  }
  .bench-cols {
    gap: 8px;
  }
  .bench-col-name {
    font-size: 12.5px;
  }
  .bench-col::after {
    max-width: 9rem;
  }
}
