/* cancommander.com — site styles.
   One dark theme, one accent. Tokens first; components below in page order. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #0a0b0d;
  --bg-raised: #101215;
  --bg-inset: #060709;
  --line: #22262c;
  --line-strong: #363c45;

  --text: #ecebe7;
  --text-2: #b7b6b1;
  --text-3: #86888d;

  --accent: #f5b83d;
  --accent-hover: #ffcb62;
  --accent-ink: #171204;
  --accent-dim: rgba(245, 184, 61, 0.12);
  --accent-line: rgba(245, 184, 61, 0.35);

  /* CAN-H / CAN-L trace colours, used in the mark and diagrams */
  --can-h: #f5b83d;
  --can-l: #6ea8d8;

  --ok: #5fd19a;
  --danger: #f0736a;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
  --radius-lg: 10px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
pre {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--accent-hover);
}

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

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

:not(pre) > code {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus {
  top: 1rem;
}

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

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
}
.section-head p:not(.eyebrow) {
  margin-top: 1rem;
  color: var(--text-2);
  font-size: 1.125rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.muted {
  color: var(--text-3);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem 2rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand:hover {
  color: var(--text);
}
.brand svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 0.4rem 0.7rem;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: var(--radius);
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--bg-raised);
}
.site-nav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 860px) {
  .site-header .wrap {
    padding-top: 0.6rem;
  }
  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    width: calc(100% + 2 * var(--gutter));
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  .site-nav ul {
    padding-block: 0.35rem;
  }
  .site-nav a {
    padding-inline: 0.6rem;
  }
  .site-nav li:first-child a {
    padding-left: 0;
  }
  .header-actions .btn-label-long {
    display: none;
  }
}
@media (max-width: 520px) {
  .site-header .wrap {
    column-gap: 0.75rem;
  }
  /* Web Serial is desktop-only, so the flash shortcut is not useful here. */
  .header-actions a[href="/tools/flash/"] {
    display: none;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--accent-ink);
}
.btn-secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--text-3);
  color: var(--text);
  background: var(--bg-raised);
}
.btn-small {
  padding: 0.42rem 0.75rem;
  font-size: 0.88rem;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.arrow-link {
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.arrow-link::after {
  content: " \2192";
}
.arrow-link:hover {
  text-decoration: underline;
}

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

.hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.9rem, 7.2vw, 4.75rem);
  letter-spacing: -0.035em;
  line-height: 1;
}

.hero .lede {
  margin-top: 1.4rem;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.35;
  color: var(--text);
  max-width: 30ch;
  text-wrap: balance;
}

.hero-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill, 999px);
  background: var(--accent-dim);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.3;
  transition: border-color 0.15s, background-color 0.15s;
}
.hero-notice:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(245, 184, 61, 0.18);
}
.hero-notice-tag {
  flex: none;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-notice-arrow {
  color: var(--accent);
  font-weight: 600;
}
.hero-notice:hover .hero-notice-arrow {
  transform: translateX(2px);
}
@media (max-width: 420px) {
  .hero-notice {
    font-size: 0.85rem;
  }
}

.hero .sub {
  margin-top: 1.1rem;
  color: var(--text-2);
  max-width: 34rem;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  list-style: none;
  padding: 0;
  margin-top: 1.6rem;
  font-size: 0.95rem;
}

.hero-visual {
  position: relative;
  padding-bottom: 6.75rem;
}
.hero-visual .flipper {
  position: absolute;
  right: -0.5rem;
  bottom: 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.hero-visual > figcaption {
  position: absolute;
  left: 0;
  bottom: 0.4rem;
  max-width: calc(100% - 300px);
  font-size: 0.85rem;
  color: var(--text-3);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .hero-visual {
    padding-bottom: 0;
  }
  .hero-visual .flipper {
    position: static;
    margin-top: 1rem;
    box-shadow: none;
  }
  .hero-visual > figcaption {
    position: static;
    max-width: none;
    margin-top: 0.75rem;
  }
}

/* ---------- Terminal ---------- */

.term {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.term-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.term pre {
  padding: 1rem 1.1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text);
}
.term .o {
  color: var(--ok);
}
.term .n {
  color: var(--text-3);
}

/* ---------- Flipper screen ---------- */

.flipper {
  display: inline-block;
  background: #050505;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 9px;
  line-height: 0;
}
.flipper img {
  display: block;
  width: 256px;
  aspect-ratio: 2 / 1;
  image-rendering: pixelated;
  border-radius: 3px;
}

.shot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}
.shot figcaption {
  font-size: 0.82rem;
  color: var(--text-3);
}

/* ---------- Spec strip ---------- */

.specs {
  border-top: 1px solid var(--line);
}
.specs dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.specs dl > div {
  padding: 1.4rem 1.25rem 1.5rem 0;
}
.specs dl > div + div {
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}
.specs dt {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.specs dd {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
}
@media (max-width: 760px) {
  .specs dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .specs dl > div {
    padding-block: 1rem;
  }
  .specs dl > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
  .specs dl > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

/* ---------- Tool groups ---------- */

.toolgroup {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}
.toolgroup:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.toolgroup:last-of-type {
  padding-bottom: 0;
}
.toolgroup-head h3 {
  font-size: 1.35rem;
}
.toolgroup-head > p {
  margin-top: 0.6rem;
  color: var(--text-2);
  font-size: 0.98rem;
}
.toolgroup-head .shot {
  margin-top: 1.4rem;
}
.toolgroup-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.toollist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.5rem;
  align-content: start;
}
.toollist > div {
  padding-block: 0.95rem;
  border-top: 1px solid var(--line);
}
.toollist dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  font-weight: 600;
}
.toollist dt a {
  color: inherit;
  text-decoration: none;
}
.toollist dt a:hover {
  color: var(--accent);
}
.toollist dt code {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
}
.toollist dd {
  margin-top: 0.25rem;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .toolgroup {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .toollist {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Detailed tool entries (features page) */

.tooldetail {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0.75rem clamp(2rem, 5vw, 4rem);
  padding-block: 1.75rem;
  border-top: 1px solid var(--line);
}
.tooldetail h3 {
  font-size: 1.15rem;
}
.tooldetail .cli {
  display: inline-block;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}
.tooldetail p {
  color: var(--text-2);
}
.tooldetail p + p {
  margin-top: 0.7rem;
}
.tooldetail .facts {
  margin-top: 0.9rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tooldetail .facts li {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}
.tooldetail pre {
  margin-top: 0.9rem;
}
@media (max-width: 900px) {
  .tooldetail {
    grid-template-columns: minmax(0, 1fr);
  }
}

.group-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.group-title h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
}
.group-title p {
  margin-top: 0.6rem;
  color: var(--text-2);
  max-width: 38rem;
}

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

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  counter-reset: step;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.steps li {
  counter-increment: step;
  padding: 1.4rem 1.3rem 1.5rem;
  background: var(--bg-raised);
}
.steps li + li {
  border-left: 1px solid var(--line);
}
.steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
}
.steps h3 {
  font-size: 1.05rem;
}
.steps p {
  margin-top: 0.5rem;
  color: var(--text-2);
  font-size: 0.94rem;
  line-height: 1.5;
}
.steps .via {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-3);
}
@media (max-width: 900px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps li:nth-child(odd) {
    border-left: 0;
  }
  .steps li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 520px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps li + li {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.split h3 {
  font-size: 1.35rem;
}
.split p {
  margin-top: 0.8rem;
  color: var(--text-2);
}
@media (max-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.bytes {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-inset);
  padding: 1.25rem;
}
.bytes-row {
  display: grid;
  grid-template-columns: 8.5rem repeat(8, minmax(0, 1fr));
  gap: 0.3rem;
  align-items: center;
}
.bytes-row + .bytes-row {
  margin-top: 0.55rem;
}
.bytes-label {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.25;
}
.bytes-row span:not(.bytes-label) {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  text-align: center;
  padding: 0.45rem 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-2);
}
.bytes-head span:not(.bytes-label) {
  border: 0;
  padding: 0;
  font-size: 0.7rem;
  color: var(--text-3);
}
.bytes-row span.off:not(.bytes-label) {
  color: var(--line-strong);
  border-style: dashed;
}
.bytes-row span.hit:not(.bytes-label) {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}
.bytes figcaption {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--text-3);
  line-height: 1.55;
}
.bytes figcaption code {
  font-size: 0.8rem;
}
@media (max-width: 560px) {
  .bytes {
    padding: 0.9rem;
  }
  .bytes-row {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .bytes-label {
    grid-column: 1 / -1;
    margin-top: 0.3rem;
  }
  .bytes-head .bytes-label {
    display: none;
  }
  .bytes-row span:not(.bytes-label) {
    font-size: 0.74rem;
  }
}

/* ---------- Architecture ---------- */

.arch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1.25fr) 2.5rem minmax(0, 1fr);
  align-items: stretch;
}
.arch-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}
.arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 1.25rem;
}
.arch-arrow::before {
  content: "\2192";
}
.arch-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  background: var(--bg-raised);
}
.arch-box h3 {
  font-size: 1rem;
}
.arch-box p {
  margin-top: 0.3rem;
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.45;
}
.arch-box .wire {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-3);
}
.arch-core {
  border-color: var(--accent-line);
  background: linear-gradient(var(--accent-dim), var(--accent-dim)), var(--bg-raised);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.4rem;
}
.arch-core h3 {
  font-size: 1.2rem;
}
.arch-core ul {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.arch-core li {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  color: var(--text);
}
.arch-box.can-h {
  border-left: 3px solid var(--can-h);
}
.arch-box.can-l {
  border-left: 3px solid var(--can-l);
}
@media (max-width: 900px) {
  .arch {
    grid-template-columns: minmax(0, 1fr);
  }
  .arch-arrow {
    padding-block: 0.6rem;
  }
  .arch-arrow::before {
    content: "\2193";
  }
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.cards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: var(--bg-raised);
}
.card .kicker {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.7rem;
}
.card h3 {
  font-size: 1.2rem;
}
.card p {
  margin-top: 0.6rem;
  color: var(--text-2);
  font-size: 0.97rem;
}
.card ul,
.card ol {
  margin-top: 0.8rem;
  padding-left: 1.15rem;
  color: var(--text-2);
  font-size: 0.95rem;
}
.card li + li {
  margin-top: 0.3rem;
}
.card .card-foot {
  margin-top: auto;
  padding-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}
a.card {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s;
}
a.card:hover {
  border-color: var(--accent-line);
}
a.card h3::after {
  content: " \2192";
  color: var(--accent);
}
@media (max-width: 900px) {
  .cards,
  .cards.two {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Banner (Switch 2 demo) ---------- */

.banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 3rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--bg-raised);
}
.banner h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
}
.banner p:not(.eyebrow) {
  margin-top: 0.7rem;
  color: var(--text-2);
  max-width: 44rem;
}
@media (max-width: 760px) {
  .banner {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Embedded media (video + photo figures) ---------- */

.video-embed,
.app-shot {
  margin: 0;
}
.video-embed {
  max-width: 880px;
}
.app-shot {
  max-width: 560px;
}
.video-embed video,
.app-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #000;
}
.video-embed video {
  aspect-ratio: 16 / 9;
}
.video-embed figcaption,
.app-shot figcaption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ---------- Callouts ---------- */

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  background: var(--bg-raised);
  color: var(--text-2);
  font-size: 0.97rem;
}
.note strong {
  color: var(--text);
}
.note + .note,
.prose + .note,
.note + .prose {
  margin-top: 1.5rem;
}

/* ---------- Page header ---------- */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 4vw, 3rem);
}
.page-head h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  letter-spacing: -0.03em;
}
.page-head .lede {
  margin-top: 1rem;
  max-width: 44rem;
  font-size: 1.2rem;
  color: var(--text-2);
}
.page-head .meta {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-3);
}

.page-body {
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}
.page-body > .wrap > * + * {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.narrow {
  max-width: 46rem;
}

/* ---------- Prose ---------- */

.prose {
  max-width: 46rem;
  overflow-wrap: break-word;
}
.prose > * + * {
  margin-top: 1.1rem;
}
.prose h2 {
  font-size: 1.55rem;
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.prose h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
}
.prose h4 {
  font-size: 1.02rem;
  margin-top: 1.6rem;
}
.prose p,
.prose li {
  color: var(--text-2);
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose ul,
.prose ol {
  padding-left: 1.35rem;
}
.prose li + li {
  margin-top: 0.35rem;
}
.prose li > ul,
.prose li > ol {
  margin-top: 0.35rem;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin-block: 2.5rem;
}
.prose blockquote {
  margin-inline: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--line-strong);
  color: var(--text-2);
}

pre {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text);
  tab-size: 2;
}
pre code {
  font-size: inherit;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--text-2);
}
thead th {
  border-top: 0;
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
tbody th {
  color: var(--text);
  font-weight: 500;
}
td code,
th code {
  white-space: nowrap;
}
.table-wrap td code {
  white-space: normal;
}

/* ---------- Docs layout ---------- */

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 3rem;
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3.5rem, 8vw, 6rem);
}
.docs.has-toc {
  grid-template-columns: 220px minmax(0, 1fr) 200px;
}
.docs-nav,
.docs-toc {
  font-size: 0.92rem;
  align-self: start;
  position: sticky;
  top: 5.25rem;
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
}
.docs-nav h2,
.docs-toc h2 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.7rem;
}
.docs-nav ul,
.docs-toc ul {
  list-style: none;
  padding: 0;
}
.docs-nav ul + h2 {
  margin-top: 1.6rem;
}
.docs-nav a,
.docs-toc a {
  display: block;
  padding: 0.28rem 0 0.28rem 0.8rem;
  border-left: 1px solid var(--line);
  color: var(--text-2);
  text-decoration: none;
  line-height: 1.35;
}
.docs-nav a:hover,
.docs-toc a:hover {
  color: var(--text);
  border-left-color: var(--text-3);
}
.docs-nav a[aria-current="page"] {
  color: var(--text);
  border-left-color: var(--accent);
}
.docs-main h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
}
.docs-main .lede {
  margin-top: 0.8rem;
  color: var(--text-2);
  font-size: 1.1rem;
  max-width: 46rem;
}
.docs-main .source {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--text-3);
}
.docs-main .prose {
  margin-top: 2.25rem;
  max-width: 50rem;
}
@media (max-width: 1180px) {
  .docs.has-toc {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}
@media (max-width: 860px) {
  .docs,
  .docs.has-toc {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }
  .docs-nav {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
  }
  .docs-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 1.1rem;
  }
  .docs-nav a {
    border-left: 0;
    padding-left: 0;
  }
  .docs-nav a[aria-current="page"] {
    color: var(--accent);
  }
  .docs-nav ul + h2 {
    margin-top: 1rem;
  }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem 2.5rem;
  font-size: 0.93rem;
  color: var(--text-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.site-footer h2 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.8rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
}
.site-footer li + li {
  margin-top: 0.4rem;
}
.site-footer a {
  color: var(--text-2);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}
.footer-about p {
  margin-top: 0.9rem;
  max-width: 26rem;
}
.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-size: 0.85rem;
  color: var(--text-3);
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-about {
    grid-column: 1 / -1;
  }
}

/* ---------- Misc ---------- */

.kv {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.kv dt,
.kv dd {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.kv dt {
  color: var(--text-3);
  font-size: 0.92rem;
}
.kv dd {
  color: var(--text);
}
@media (max-width: 560px) {
  .kv {
    grid-template-columns: minmax(0, 1fr);
  }
  .kv dt {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .kv dd {
    padding-top: 0.2rem;
  }
}

.not-found {
  padding-block: clamp(4rem, 12vw, 8rem);
}
.not-found h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  letter-spacing: -0.03em;
}
.not-found p {
  margin-top: 1rem;
  color: var(--text-2);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
