/* dpx-buttonode user manual — static documentation site */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-sunken: #e9ebee;
  --ink: #14181f;
  --ink-muted: #545c68;
  --ink-faint: #8991a0;
  --line: #d7dbe2;
  --line-soft: #e4e7ec;

  --accent: #2461d9;        /* buttons-mode blue */
  --accent-ink: #ffffff;
  --accent-tint: #dde8fb;
  --accent-strong: #17439e;

  --sat: #1a8f4c;           /* satellite-mode green */
  --sat-tint: #dcf3e5;

  --cmp: #8e3fc9;           /* companion-mode purple */
  --cmp-tint: #f0e2fa;

  --warn: #b4650f;
  --warn-tint: #fbead2;
  --warn-line: #e7c290;

  --danger: #c22b3a;
  --danger-tint: #fbdfe1;

  --code-bg: #12161d;
  --code-ink: #e4e9f1;
  --code-accent: #7fb0ff;
  --code-muted: #7b8598;

  --shadow: 0 1px 2px rgba(20, 24, 31, 0.06), 0 10px 28px -14px rgba(20, 24, 31, 0.22);

  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-sunken: #0b0d11;
    --ink: #eaecf1;
    --ink-muted: #a1a9b8;
    --ink-faint: #666f80;
    --line: #2a2f3a;
    --line-soft: #22262f;

    --accent: #6c9eff;
    --accent-ink: #071230;
    --accent-tint: #182742;
    --accent-strong: #a9c6ff;

    --sat: #4fd486;
    --sat-tint: #14301f;

    --cmp: #c993f0;
    --cmp-tint: #2c1f38;

    --warn: #e3a95f;
    --warn-tint: #332512;
    --warn-line: #5c4526;

    --danger: #f0808d;
    --danger-tint: #3a171b;

    --code-bg: #0a0c10;
    --code-ink: #dbe3f0;
    --code-accent: #7fb0ff;
    --code-muted: #667088;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 32px -16px rgba(0, 0, 0, 0.65);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-sunken: #0b0d11;
  --ink: #eaecf1;
  --ink-muted: #a1a9b8;
  --ink-faint: #666f80;
  --line: #2a2f3a;
  --line-soft: #22262f;

  --accent: #6c9eff;
  --accent-ink: #071230;
  --accent-tint: #182742;
  --accent-strong: #a9c6ff;

  --sat: #4fd486;
  --sat-tint: #14301f;

  --cmp: #c993f0;
  --cmp-tint: #2c1f38;

  --warn: #e3a95f;
  --warn-tint: #332512;
  --warn-line: #5c4526;

  --danger: #f0808d;
  --danger-tint: #3a171b;

  --code-bg: #0a0c10;
  --code-ink: #dbe3f0;
  --code-accent: #7fb0ff;
  --code-muted: #667088;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 32px -16px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* ── top bar ─────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 1.5rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar .mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.topbar .mark img { height: 26px; width: auto; display: block; }
.topbar .mark .ver {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.topbar nav {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.topbar nav a:hover, .topbar nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.topbar .gh {
  color: var(--ink-muted);
  font-size: 0.86rem;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
}
.topbar .gh:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ── hero ────────────────────────────────────────────────────────────── */

.hero {
  padding: 3.4rem 1.5rem 2.6rem;
  max-width: 920px;
  margin: 0 auto;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero > * {
  opacity: 0;
  animation: hero-in 0.6s ease-out forwards;
}
.hero .eyebrow { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.15s; }
.hero p.lede { animation-delay: 0.28s; }
.hero .cta-row { animation-delay: 0.4s; }
.hero .release-banner { animation-delay: 0.5s; }
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-strong);
  background: var(--accent-tint);
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  margin: 0 0 0.9rem;
  letter-spacing: -0.01em;
}
.hero p.lede {
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 62ch;
  margin: 0 0 1.6rem;
}
.hero .cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6rem 1.1rem;
  border-radius: 9px;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ── release banner ─────────────────────────────────────────────────── */

.release-banner {
  margin-top: 1.6rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.release-banner-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.release-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--sat);
  flex-shrink: 0;
}
.release-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.release-version {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
}
.release-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.release-all-link {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.release-assets {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.release-loading {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.release-asset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.9rem;
  border-radius: 9px;
}
.release-asset-btn:hover { background: var(--accent-strong); }
.release-asset-variant {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.22);
  padding: 0.05rem 0.4rem;
  border-radius: 5px;
}
.release-asset-size {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.85;
}

/* ── layout / sections ──────────────────────────────────────────────── */

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

details.section {
  padding-top: 2.6rem;
  padding-bottom: 0.4rem;
  scroll-margin-top: 4.5rem;
}
details.section + details.section {
  border-top: 1px solid var(--line-soft);
}
details.section[open] {
  padding-bottom: 2.6rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 1.3rem;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
}
.section-head::-webkit-details-marker { display: none; }
.section-head::marker { content: ''; }
.section-head::after {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  margin-left: auto;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
details.section[open] > .section-head::after {
  transform: rotate(45deg);
}
.section-head:hover .num,
.section-head:hover h2 {
  color: var(--accent-strong);
}
.section-head .num {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 0.95rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.section-head .tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

p { margin: 0 0 1rem; }
.section p:last-child { margin-bottom: 0; }

h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin: 1.6rem 0 0.7rem;
}

ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }

/* ── cards ───────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card > *:last-child { margin-bottom: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}
.card-grid .card { margin-bottom: 0; }

.card h4 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
}
.card .meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

/* mode-colored accents, matching the deck's own key colors */
.card.mode-buttons { border-left: 3px solid var(--accent); }
.card.mode-satellite { border-left: 3px solid var(--sat); }
.card.mode-companion { border-left: 3px solid var(--cmp); }

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
}
.chip-buttons { background: var(--accent-tint); color: var(--accent-strong); }
.chip-satellite { background: var(--sat-tint); color: var(--sat); }
.chip-companion { background: var(--cmp-tint); color: var(--cmp); }

/* ── deck key grid ───────────────────────────────────────────────────── */

.deck-diagram {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 1.2rem 0 1.6rem;
  max-width: 560px;
}
.deck-key {
  aspect-ratio: 1;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  padding: 0.3rem;
  line-height: 1.2;
}
.deck-key.blank { background: var(--surface-sunken); color: var(--ink-faint); border: 1px dashed var(--line); }
.deck-key.k-mode { background: var(--accent); }
.deck-key.k-net { background: #d2711e; }
.deck-key.k-subnet { background: #6b6b6b; }
.deck-key.k-ssh { background: #8a7318; }
.deck-key.k-go { background: #17a34a; }
.deck-key.k-octet { background: #1c9fb0; color: #062226; }
.deck-key.k-dash { background: #a3232f; }
.deck-key.k-host { background: var(--surface-sunken); color: var(--ink-muted); border: 1px solid var(--line); font-weight: 500; }

.key-legend {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
}
.key-legend .row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.key-legend .row:last-child { border-bottom: none; }
.key-legend .key-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── tables ──────────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2rem;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  font-weight: 600;
}
tr:last-child td { border-bottom: none; }

/* ── code blocks ─────────────────────────────────────────────────────── */

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0 0 1.1rem;
  position: relative;
}
pre code { color: inherit; background: none; padding: 0; }
:not(pre) > code {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-size: 0.87em;
}

.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: rgba(255,255,255,0.08);
  color: var(--code-muted);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}
.copy-btn:hover { color: var(--code-ink); border-color: rgba(255,255,255,0.3); }
.copy-btn.copied { color: var(--code-accent); }

/* ── callouts ────────────────────────────────────────────────────────── */

.callout {
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin: 0 0 1.1rem;
  border: 1px solid var(--line);
  background: var(--surface-sunken);
}
.callout > *:last-child { margin-bottom: 0; }
.callout .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.4rem;
}
.callout-warn { background: var(--warn-tint); border-color: var(--warn-line); }
.callout-warn .label { color: var(--warn); }
.callout-fixed { background: var(--sat-tint); border-color: color-mix(in srgb, var(--sat) 40%, var(--line)); }
.callout-fixed .label { color: var(--sat); }
.callout-open { background: var(--danger-tint); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.callout-open .label { color: var(--danger); }

/* ── gotcha entries (troubleshooting) ───────────────────────────────── */

.gotcha {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.gotcha-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.gotcha-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
}
.status-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.status-fixed { background: var(--sat-tint); color: var(--sat); }
.status-open { background: var(--danger-tint); color: var(--danger); }
.gotcha p { color: var(--ink-muted); }
.gotcha p:last-child { margin-bottom: 0; }

/* ── footer ──────────────────────────────────────────────────────────── */

footer {
  max-width: 920px;
  margin: 3rem auto 0;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}
footer a { color: var(--ink-muted); }
footer .footer-logo { display: none; }

/* ── misc ────────────────────────────────────────────────────────────── */

.divider-note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

@media (max-width: 640px) {
  .topbar { padding: 0.6rem 1rem; }
  .hero { padding: 2.2rem 1rem 2rem; }
  main { padding: 0 1rem 4rem; }
  .key-legend .row { grid-template-columns: 70px 1fr; }
}
