/* Snapmap+ site — shared by the landing page, the changelog, the 404, and the rendered
   markdown pages (_layouts/guide.html).

   Design language: the SnapMap editor's own world. Deep blue-black editor slate, the
   logic-wire cyan SnapMap uses for signal paths, and DOOM's argent orange reserved for
   energy — downloads, calls to action, the "+" itself. Chamfered chips and corner
   brackets echo the in-game HUD; section headings carry a node port, wired in like a
   logic chip. */

:root {
  /* surfaces */
  --void: #090d12;        /* page background — blue-black */
  --deck: #0d131b;        /* alternating section background */
  --panel: #121a24;       /* raised chip / frame */
  --panel-2: #0b1016;     /* inset surface (code, console) */
  --line: #243140;        /* steel border */
  --line-soft: #1a2431;

  /* the two accents: cyan = logic (SnapMap), orange = energy (DOOM) */
  --wire: #4ac9f0;
  --wire-soft: rgba(74, 201, 240, 0.35);
  --wire-faint: rgba(74, 201, 240, 0.10);
  --argent: #ff8a1e;
  --argent-hi: #ffa64d;
  --argent-faint: rgba(255, 138, 30, 0.10);
  --blood: #e5482b;

  /* ink */
  --ink: #e9eef4;
  --muted: #9fb2c4;

  /* type */
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Cascadia Mono", monospace;

  /* z-index scale */
  --z-sticky: 10;
  --z-lightbox: 100;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* faint ambient energy — cyan from the editor side, orange from the hell side */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1000px 520px at 82% -8%, rgba(74, 201, 240, 0.06), transparent 62%),
    radial-gradient(900px 520px at 8% 108%, rgba(255, 138, 30, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, .btn, .navlinks a, .wordmark {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
h1, h2, h3 { text-wrap: balance; }

a { color: var(--wire); text-decoration: none; }
a:hover { color: var(--argent-hi); }

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

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

/* ---------- scrollbars (page + every inner scroll surface) ---------- */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--panel-2); }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: rgba(74, 201, 240, 0.45); }
::-webkit-scrollbar-corner { background: var(--panel-2); }

/* Firefox (no ::-webkit-scrollbar; the standard properties would disable the
   fine-grained styling above in Chromium, so scope them to Firefox only) */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--line) var(--panel-2); }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(9, 13, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
}
/* the doom-snapmap org avatar — served straight from GitHub so it tracks avatar changes */
.wordmark-logo {
  width: 22px;
  height: 22px;
  display: block;
  margin-right: 10px;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.wordmark .plus { color: var(--argent); }
.wordmark:hover { color: var(--ink); }
.wordmark:hover .plus { color: var(--argent-hi); }

.site-header nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.navlinks { display: flex; gap: 20px; flex-wrap: wrap; }
.navlinks a { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; }
.navlinks a:hover, .navlinks a[aria-current="page"] { color: var(--wire); }

.btn-nav {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #140f08;
  background: var(--argent);
  padding: 8px 18px;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.btn-nav:hover { background: var(--argent-hi); color: #140f08; }

/* the collapsible nav payload — a flat row on desktop, a slide-down panel on mobile */
.nav-menu { display: flex; align-items: center; gap: 20px; }

/* mobile menu toggle (hamburger) — a chamfered HUD chip, hidden until the nav collapses */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--wire);
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-toggle:hover { border-color: var(--wire-soft); background: var(--wire-faint); }

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.28s cubic-bezier(0.4, 0.01, 0.2, 1), opacity 0.2s ease;
}
.nav-toggle-lines { position: relative; }
.nav-toggle-lines::before,
.nav-toggle-lines::after { position: absolute; left: 0; }
.nav-toggle-lines::before { top: -7px; }
.nav-toggle-lines::after  { top: 7px; }

/* open state: three bars fold into an X */
.site-header.nav-open .nav-toggle-lines { background: transparent; }
.site-header.nav-open .nav-toggle-lines::before { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle-lines::after  { transform: translateY(-7px) rotate(-45deg); }

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

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  padding: 14px 26px;
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--argent); color: #140f08; }
.btn-primary:hover {
  background: var(--argent-hi);
  color: #140f08;
  box-shadow: 0 0 28px rgba(255, 138, 30, 0.35);
}

.btn-ghost { background: var(--wire-faint); color: var(--wire); }
.btn-ghost:hover { background: rgba(74, 201, 240, 0.18); color: var(--wire); }

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

.hero { padding: 76px 0 26px; overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}

.kicker {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--wire);
  background: var(--wire-faint);
  padding: 6px 16px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  font-weight: 700;
  line-height: 1.04;
  margin: 20px 0 16px;
}
.hero h1 em { font-style: normal; color: var(--argent); }

.hero .lede {
  max-width: 34em;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 18.5px;
  text-wrap: pretty;
}

.cta-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 36px; }

.dl-meta { margin-top: 28px; color: var(--muted); font-size: 14.5px; }
.dl-meta code { color: var(--ink); font-size: 13.5px; }
.dl-meta .sep { margin: 0 8px; opacity: 0.5; }

.beta-pill {
  display: none; /* shown by JS when the newest release is a pre-release */
  font-family: var(--display);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--blood);
  padding: 2px 10px;
  margin-left: 8px;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  vertical-align: 2px;
}

/* entrance choreography: headline block rises, wires draw, pulses flow */
.hero-copy > * { animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.24s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* the signature: a SnapMap logic graph, wired live */
.hero-graph { position: relative; min-width: 0; }
.hero-graph::before {
  content: "";
  position: absolute;
  inset: -40px -60px;
  background:
    linear-gradient(var(--wire-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--wire-faint) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 90%);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 90%);
  opacity: 0.5;
  pointer-events: none;
}
.hero-graph svg { position: relative; display: block; width: 100%; height: auto; }

.hero-graph .chip { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.hero-graph .chip-hot { stroke: var(--argent); }
.hero-graph .g-hot { filter: drop-shadow(0 0 10px rgba(255, 138, 30, 0.35)); }
.hero-graph .port { fill: var(--panel-2); stroke: var(--wire); stroke-width: 1.5; }
.hero-graph .port-hot { stroke: var(--argent); }
.hero-graph .wire-path {
  fill: none;
  stroke: var(--wire-soft);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: wiredraw 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}
.hero-graph .wire-b { animation-delay: 0.85s; }
.hero-graph .pulse { fill: var(--wire); filter: drop-shadow(0 0 6px var(--wire)); }
.hero-graph .node-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  fill: var(--ink);
}
.hero-graph .node-sub {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.14em;
  fill: var(--muted);
}
.hero-graph .node-title-hot { fill: var(--argent-hi); }

@keyframes wiredraw { to { stroke-dashoffset: 0; } }

/* the full-width hero screenshot (extra specificity: .shot resets margin) */
.hero figure.hero-shot { margin: 84px auto 0; max-width: 1020px; }

/* ---------- framed screenshots (clickable -> lightbox) ---------- */

.shot {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px;
}
/* HUD corner brackets */
.shot::before, .shot::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transition: border-color 0.15s ease;
}
.shot::before { top: -1px; left: -1px; border-top: 2px solid var(--wire); border-left: 2px solid var(--wire); }
.shot::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--wire); border-right: 2px solid var(--wire); }
.shot:hover::before, .shot:hover::after { border-color: var(--argent); }

.shot img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.shot figcaption { padding: 10px 6px 4px; font-size: 14px; color: var(--muted); }

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

section { padding: 64px 0; }
section.deck { background: var(--deck); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

/* section heading, wired in like a logic chip: port -> wire -> title */
.section-head { display: flex; align-items: center; gap: 0; margin: 0 0 10px; }
.node-port {
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid var(--wire);
  background: var(--wire-faint);
  box-shadow: 0 0 10px rgba(74, 201, 240, 0.4);
}
.node-wire {
  flex: none;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--wire-soft), transparent);
}
.section-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 700; margin: 0; }
.section-sub { color: var(--muted); margin: 0 0 40px; max-width: 42em; text-wrap: pretty; }

/* ---------- feature rows ---------- */

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 44px;
  align-items: center;
  padding: 34px 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--line-soft); }
.feature-row.flip .feature-copy { order: 2; }
.feature-row.flip .shot { order: 1; }

.feature-copy h3 { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
.feature-copy p { color: var(--muted); margin: 0 0 14px; text-wrap: pretty; }
.feature-copy code { font-size: 14.5px; color: var(--wire); background: var(--panel-2); border: 1px solid var(--line-soft); padding: 1px 6px; }

.feature-points { list-style: none; margin: 0; padding: 0; }
.feature-points li {
  position: relative;
  padding-left: 22px;
  margin: 7px 0;
  color: var(--ink);
  font-size: 15.5px;
}
.feature-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border: 2px solid var(--wire);
  background: var(--wire-faint);
}

/* ---------- console strip ---------- */

.console {
  margin-top: 44px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.console-bar::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--argent);
  box-shadow: 0 0 8px rgba(255, 138, 30, 0.6);
}
.console-body { padding: 16px 18px 18px; overflow-x: auto; }
.console-body .ln { white-space: pre; }
.console-body .prompt { color: var(--argent); }
.console-body .cmd { color: var(--wire); }
.console-body .out { color: var(--muted); }

/* ---------- steps (a real sequence, wired) ---------- */

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
.step {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 26px 24px 22px;
  margin-right: 34px;
}
.step:last-child { margin-right: 0; }
/* the wire linking each step to the next */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: 34px;
  height: 2px;
  background: var(--wire-soft);
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--argent);
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 8px; font-size: 17.5px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.step code { font-size: 13.5px; color: var(--ink); background: var(--panel-2); padding: 2px 6px; border: 1px solid var(--line-soft); }

.compat-note {
  margin-top: 30px;
  border: 1px solid rgba(255, 138, 30, 0.4);
  background: var(--argent-faint);
  padding: 16px 20px;
  font-size: 15.5px;
}
.compat-note strong { color: var(--argent-hi); }

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
/* uniform teaser thumbnails — the lightbox shows the full image */
.gallery .shot img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
}

/* ---------- the editor ghost (holographic demon backdrop) ---------- */

.ghost-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- community ---------- */

.community {
  position: relative;
  text-align: center;
  padding: 110px 0 130px;
  overflow: hidden;
}
.community .section-head { justify-content: center; }
.community .big-line {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 600;
  line-height: 1.3;
  max-width: 24em;
  margin: 0 auto 18px;
}
.community .big-line em { font-style: normal; color: var(--wire); }
.community p { color: var(--muted); max-width: 44em; margin: 0 auto 14px; text-wrap: pretty; }
.community .cta-row { justify-content: center; margin-top: 26px; }

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

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 38px 0 48px;
  color: var(--muted);
  font-size: 14.5px;
}
.site-footer .wrap { display: grid; gap: 14px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--wire); }
.site-footer code { font-size: 13px; color: var(--ink); }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  z-index: var(--z-lightbox);
  border: 0;
  padding: 0;
  margin: auto;
  max-width: min(94vw, 1500px);
  max-height: 92vh;
  background: transparent;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(4, 6, 9, 0.9); backdrop-filter: blur(3px); }
.lightbox figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px;
}
.lightbox img {
  display: block;
  max-width: calc(94vw - 18px);
  max-height: calc(92vh - 70px);
  width: auto;
  height: auto;
}
.lightbox figcaption { padding: 10px 6px 2px; font-size: 14px; color: var(--muted); }
.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.lightbox-close:hover { background: var(--blood); color: #fff; }

/* ---------- changelog page ---------- */

.page-doc { padding: 56px 0 80px; }
/* Use the shared 1140px wrap (inherited from .wrap) so the left/right gutters match Home + Guide. */
/* Match the Changelog title to the Guide banner (.guide-doc h1). */
.page-doc .section-title { font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.1; }

.release { margin: 0 0 34px; }
.release:last-child { margin-bottom: 0; }

.release-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 8px; }
.release-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.05em;
}
/* Blue node square next to each release title — same size/style as the guide's section squares. */
.release-head h2::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border: 2px solid var(--wire);
  background: var(--wire-faint);
  box-shadow: 0 0 8px rgba(74, 201, 240, 0.35);
}
.release-head time { color: var(--muted); font-size: 14px; }
.tag-pill {
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 10px;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.tag-beta { color: #fff; background: var(--blood); }
.tag-latest { color: #10150c; background: var(--wire); }

.release-notes { color: var(--muted); font-size: 15.5px; }
.release-notes ul { margin: 8px 0; padding-left: 22px; }
.release-notes li { margin: 5px 0; }
.release-notes p { margin: 8px 0; }
.release-links { font-size: 14px; margin-top: 6px; }
.release-links .sep { margin: 0 8px; opacity: 0.5; }

.changelog-fallback {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 22px;
  color: var(--muted);
}

/* ---------- community pages ---------- */

/* Sticky footer: short pages (an empty forum) still push the footer to the viewport bottom. */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }

/* One button shape for the whole section — the navbar Download recipe: display face,
   uppercase, chamfered fill, NO border, NO glow. */
.community-page .btn, dialog.smp-modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 18px;
  border: none;
  cursor: pointer;
  box-shadow: none;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.community-page .btn-primary:hover, dialog.smp-modal .btn-primary:hover { box-shadow: none; }

/* Inline SVG icon set (stroke-based, inherits currentColor). */
.ic {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-sm { width: 14px; height: 14px; }

/* -- header: title + signed-in identity -- */
.community-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.community-head .section-sub { margin-bottom: 26px; }
.community-auth { flex: none; padding-top: 10px; }
.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.auth-chip .avatar { width: 26px; height: 26px; }
.auth-chip .auth-name { color: var(--ink); font-weight: 500; }
.auth-signout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
}
.auth-signout:hover { color: var(--wire); }
.auth-error { color: var(--blood); font-size: 13.5px; }
.signin-note { color: var(--muted); }
.btn-signin { display: inline-flex; align-items: center; gap: 8px; }

/* avatars: one consistent scale everywhere (16 list / 20 post meta / 22 comments / 26 auth) */
.avatar { border-radius: 50%; border: 1px solid var(--line); vertical-align: middle; }

/* -- toolbar: search / sort / write -- */
.community-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.search-box { position: relative; flex: 1 1 240px; max-width: 460px; }
.search-box .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  background: var(--deck);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 34px 9px 38px;
}
.search-box input::placeholder { color: #8fa3b6; }
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.search-box.has-query .search-clear { display: inline-flex; }
.search-clear:hover { color: var(--ink); }

/* inline-block so the wrap hugs the select — the chevron anchors to the control,
   not to however wide the surrounding field happens to be */
.select-wrap { position: relative; display: inline-block; }
.select-wrap .ic {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--deck);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 34px 9px 12px;
  cursor: pointer;
}
.community-toolbar .btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.select-wrap .ic-sort { display: none; }
/* option lists never inherit the closed control's styling tricks (e.g. the mobile icon
   button's transparent text) — pin readable colors on the popup items everywhere */
.community-page select option { color: var(--ink); background: var(--deck); }

.search-box input:focus,
.select-wrap select:focus {
  outline: none;
  border-color: var(--wire-soft);
  box-shadow: 0 0 0 1px var(--wire-faint);
}

/* -- category tabs: underline nav, panel attaches beneath -- */
.cat-nav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.cat-nav a:hover { color: var(--ink); }
.cat-nav a.active { color: var(--wire); border-bottom-color: var(--wire); }

/* -- the forum list: one panel, hairline-separated rows -- */
.forum-panel {
  border: 1px solid var(--line);
  border-top: none;
  background: var(--panel);
}
.forum-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  color: var(--ink);
}
.forum-row + .forum-row { border-top: 1px solid var(--line-soft); }
.forum-row:hover { background: #141d29; }
.forum-main { flex: 1; min-width: 0; }
.forum-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0 0 5px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.forum-row:hover .forum-title { color: var(--wire); }
.tag-chip {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wire);
  background: var(--wire-faint);
  padding: 2px 8px;
  white-space: nowrap;
}
.tag-chip-label {
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0.02em;
}
/* Q&A open/resolved state (an answer accepted on GitHub) */
.qa-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 8px;
  white-space: nowrap;
}
.qa-chip .ic { width: 12px; height: 12px; }
.qa-resolved { color: var(--wire); background: var(--wire-faint); border-color: transparent; }
.forum-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.forum-meta .avatar { width: 16px; height: 16px; }
.forum-meta a { color: var(--muted); }
.forum-meta a:hover { color: var(--wire); }
.forum-meta .sep { opacity: 0.45; }
.forum-stats {
  display: flex;
  gap: 18px;
  flex: none;
  color: var(--muted);
}
.forum-stats .stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  min-width: 34px;
}

/* skeleton rows while the list loads */
.sk-row { padding: 16px 18px; }
.sk-row + .sk-row { border-top: 1px solid var(--line-soft); }
.sk-line {
  height: 12px;
  background: linear-gradient(90deg, var(--line-soft) 25%, #263344 50%, var(--line-soft) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s linear infinite;
}
.sk-line + .sk-line { margin-top: 10px; }
.sk-w60 { width: 60%; }
.sk-w35 { width: 35%; height: 10px; }
@keyframes sk-shimmer { to { background-position: -200% 0; } }

.empty-state {
  padding: 56px 24px;
  text-align: center;
}
.empty-state h3 {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.empty-state p { color: var(--muted); margin: 0 0 20px; }
.load-note {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 22px;
  color: var(--muted);
}
.community-more { margin: 18px 0 0; text-align: center; }

/* -- post view -- */
.post-head .section-title { font-size: clamp(1.5rem, 3.4vw, 2.05rem); line-height: 1.2; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13.5px;
}
.post-meta .avatar { width: 20px; height: 20px; }
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--wire); }
.post-meta .sep { opacity: 0.45; }
.post-meta .author-name a { color: var(--ink); font-weight: 500; }
.post-meta-page { margin: 2px 0 28px; }

/* rendered GitHub HTML gets the site's typography */
.post-body { color: var(--ink); font-size: 16px; line-height: 1.65; max-width: 75ch; }
.post-body img, .comment-body img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.post-body pre, .comment-body pre, .rte-area pre {
  background: var(--void);
  border: 1px solid var(--line);
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
}
.post-body code, .comment-body code, .rte-area code { font-family: var(--mono); font-size: 0.92em; }
.post-body :not(pre) > code, .comment-body :not(pre) > code, .rte-area :not(pre) > code {
  background: var(--deck);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
}
.post-body blockquote, .comment-body blockquote, .rte-area blockquote {
  border-left: 3px solid var(--wire-soft);
  margin: 10px 0;
  padding: 2px 0 2px 14px;
  color: var(--muted);
}
.post-body h1, .post-body h2, .post-body h3 { margin: 24px 0 10px; line-height: 1.3; }
.post-body table, .comment-body table { border-collapse: collapse; display: block; overflow-x: auto; }
.post-body th, .post-body td, .comment-body th, .comment-body td {
  border: 1px solid var(--line);
  padding: 6px 12px;
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 14px 0;
  max-width: 720px;
  border: 1px solid var(--line);
  background: var(--deck);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* post action bar: one consistent button vocabulary */
.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--panel);
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.action-btn:hover:not(:disabled) { color: var(--wire); background: #1b2836; }
.action-btn:disabled { opacity: 0.5; cursor: default; }
.action-btn .count { font-family: var(--mono); font-size: 12.5px; }
.action-quiet { background: none; }
.action-quiet:hover:not(:disabled) { background: var(--panel); }
.action-danger:hover:not(:disabled) { color: var(--blood); background: rgba(229, 72, 43, 0.08); }
.post-actions .gh-link {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.post-actions .gh-link:hover { color: var(--wire); }

/* -- discussion thread -- */
.community-thread { margin: 44px 0 0; max-width: 75ch; }
.thread-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
}
.thread-head h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0;
}
.thread-head .thread-count { color: var(--muted); font-family: var(--mono); font-size: 13px; }

/* comment composer (docked ABOVE the thread) */
.composer-collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--deck);
  border: 1px solid var(--line);
  color: #8fa3b6;
  font-size: 14px;
  cursor: text;
}
.composer-collapsed:hover { border-color: var(--wire-soft); }
.composer-collapsed .avatar { width: 22px; height: 22px; }
.composer-box { margin: 0 0 6px; }
.thread-signin {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 18px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* comments: flat hairline list; replies nest under a thread rail */
.comment-list { margin-top: 18px; }
.comment { padding: 14px 0 6px; }
.comment + .comment, .comment-list > .replies { border-top: 1px solid var(--line-soft); }
.comment-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
}
.comment-head .avatar { width: 22px; height: 22px; }
.comment-head .c-author { color: var(--ink); font-weight: 600; }
.comment-head .c-author a { color: inherit; }
.comment-head .c-author a:hover { color: var(--wire); }
.comment-head time { color: var(--muted); font-size: 12.5px; }
.comment-body { margin: 8px 0 2px 31px; color: var(--ink); font-size: 15px; line-height: 1.6; }
.comment-actions { display: flex; align-items: center; gap: 2px; margin-left: 27px; }
.c-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 8px;
  cursor: pointer;
}
.c-act:hover:not(:disabled) { color: var(--wire); }
.c-act.danger:hover:not(:disabled) { color: var(--blood); }
.c-act:disabled { opacity: 0.5; cursor: default; }
.c-act .count { font-family: var(--mono); font-size: 12px; }

.replies { margin-left: 15px; padding-left: 20px; border-left: 1px solid var(--line-soft); border-top: none !important; }
.replies .comment { padding-top: 12px; }
.replies .comment + .comment { border-top: 1px solid var(--line-soft); }

.thread-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--wire);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 8px;
  cursor: pointer;
}
.thread-more:hover { text-decoration: underline; }
.replies .thread-more { font-size: 12.5px; padding: 6px 8px; }

.comment-editing > .comment-body { display: none; }
.comment .rte { margin: 8px 0 4px 31px; }

/* the accepted answer stands out from the thread */
.comment.comment-answer {
  border: 1px solid var(--wire-soft);
  background: rgba(74, 201, 240, 0.05);
  padding: 14px 16px 8px;
  margin: 14px 0 12px;
}
.answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--wire);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* -- rich text editor -- */
.rte { border: 1px solid var(--line); background: var(--deck); }
.rte:focus-within { border-color: var(--wire-soft); box-shadow: 0 0 0 1px var(--wire-faint); }
.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 5px 6px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}
.rte-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
}
.rte-btn:hover { color: var(--ink); background: var(--wire-faint); }
.rte-btn.on { color: var(--wire); background: var(--wire-faint); }
.rte-sep { width: 1px; align-self: stretch; margin: 5px 5px; background: var(--line-soft); }
.rte-area {
  min-height: 230px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px 16px;
  outline: none;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}
.rte-area:empty::before { content: attr(data-placeholder); color: #8fa3b6; pointer-events: none; }
/* actions docked inside the editor (comment boxes): note left, buttons right */
.rte-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
}
.rte-footer .rte-note { flex: 1; margin: 0; min-height: 0; }
.rte-area img { max-width: min(100%, 520px); display: block; margin: 10px 0; }
.rte-area h2 { font-size: 20px; margin: 18px 0 8px; }
.rte-area h3 { font-size: 17px; margin: 16px 0 6px; }
.rte-area ul, .rte-area ol { margin: 8px 0; padding-left: 26px; }
.rte-compact .rte-area { min-height: 130px; }
.rte-note { color: var(--muted); font-size: 13px; margin-top: 6px; min-height: 18px; }

/* -- composer page -- */
.compose-form { max-width: 75ch; }
.compose-form .field { margin: 0 0 18px; }
.compose-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 7px;
}
.compose-form input[type="text"] {
  width: 100%;
  background: var(--deck);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 16.5px;
  font-weight: 500;
  padding: 11px 14px;
}
.compose-form input[type="text"]::placeholder { color: #8fa3b6; }
.compose-form input[type="text"]:focus {
  outline: none;
  border-color: var(--wire-soft);
  box-shadow: 0 0 0 1px var(--wire-faint);
}
.compose-form .select-wrap select { min-width: 220px; }
.compose-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.compose-status { color: var(--muted); font-size: 13px; }
.compose-footer .btn { display: inline-flex; align-items: center; gap: 8px; }
.compose-footer .spacer { flex: 1; }

/* -- modal + toast -- */
dialog.smp-modal {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0;
  max-width: 440px;
  width: calc(100% - 40px);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
dialog.smp-modal::backdrop { background: rgba(5, 9, 14, 0.72); }
dialog.smp-modal[open] { animation: modal-in 0.18s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}
.modal-body { padding: 22px 24px 18px; }
.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}
.modal-title .ic { color: var(--wire); }
.modal-title.is-danger .ic { color: var(--blood); }
.modal-msg { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0; }
.modal-body input[type="text"] {
  width: 100%;
  margin-top: 14px;
  background: var(--deck);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
}
.modal-body input[type="text"]:focus {
  outline: none;
  border-color: var(--wire-soft);
  box-shadow: 0 0 0 1px var(--wire-faint);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 18px;
}
.btn-danger { background: var(--blood); color: #fff; }
.btn-danger:hover { background: #f05a3d; color: #fff; }

.toast-host {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: var(--z-toast, 130);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 44px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  padding: 11px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast .ic { color: var(--wire); }
.toast.is-error .ic { color: var(--blood); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

/* -- shared focus + crumb -- */
.crumb { font-size: 14px; margin: 0 0 18px; }
.crumb a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.crumb a:hover { color: var(--wire); }
.community-page :focus-visible { outline: 2px solid var(--wire-soft); outline-offset: 2px; }
/* fields with their own focus ring (border + glow) must not ALSO get the generic outline —
   that reads as a double border */
.community-page input:focus-visible,
.community-page select:focus-visible,
.community-page .rte-area:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .sk-line { animation: none; }
  dialog.smp-modal[open], .toast { animation: none; }
}

@media (max-width: 640px) {
  .community-head { flex-direction: column; gap: 0; }
  .community-head .section-sub { margin-bottom: 12px; }
  /* the signed-in row becomes its own hairline-separated strip, right-aligned */
  .community-auth {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 10px 0 12px;
    border-top: 1px solid var(--line-soft);
  }
  .community-toolbar { gap: 8px; }
  .community-toolbar .btn { margin-left: 0; width: 100%; justify-content: center; }
  /* search + sort share one row; the sort select collapses to an icon button
     (the native picker still opens on tap) */
  .search-box { max-width: none; flex: 1 1 auto; }
  .community-toolbar .select-wrap select { width: 44px; padding: 9px 0; color: transparent; }
  .community-toolbar .select-wrap .ic-chevron { display: none; }
  .community-toolbar .select-wrap .ic-sort {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--muted);
    pointer-events: none;
  }
  .forum-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .forum-stats { gap: 14px; }
  .comment-body, .comment .rte { margin-left: 0; }
  .comment-actions { margin-left: -4px; }
  .replies { margin-left: 6px; padding-left: 12px; }
}

/* ---------- rendered markdown pages (the guide, the privacy policy) ---------- */


.guide-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
  padding: 48px 0 80px;
}

.guide-toc {
  position: sticky;
  /* Pin at the TOC's natural rest offset (header 61px + shell padding 48px) so it
     sticks immediately with no scroll travel before pinning. */
  top: 109px;
  max-height: calc(100vh - 133px);
  overflow-y: auto;
  font-size: 14px;
  padding-right: 6px;
}
.guide-toc details > summary { list-style: none; cursor: default; }
.guide-toc details > summary::-webkit-details-marker { display: none; }
.guide-toc-title {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.guide-toc-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid var(--wire);
  background: var(--wire-faint);
}
.guide-toc ol { list-style: none; margin: 0; padding: 0; }
.guide-toc li { margin: 0; }
.guide-toc a {
  display: block;
  color: var(--muted);
  padding: 5px 10px;
  border-left: 2px solid var(--line-soft);
  line-height: 1.45;
}
.guide-toc a:hover { color: var(--wire); border-left-color: var(--wire-soft); }
.guide-toc a.active { color: var(--wire); border-left-color: var(--wire); background: var(--wire-faint); }
.guide-toc .toc-h3 a { padding-left: 24px; font-size: 13px; }

.guide-doc { min-width: 0; }

.guide-doc h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  line-height: 1.1;
  margin: 6px 0 22px;
}
.guide-doc h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin: 54px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}
.guide-doc h2::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border: 2px solid var(--wire);
  background: var(--wire-faint);
  box-shadow: 0 0 8px rgba(74, 201, 240, 0.35);
}
.guide-doc h3 { font-size: 19px; margin: 32px 0 10px; color: var(--ink); }
.guide-doc h4 { font-size: 16.5px; margin: 26px 0 8px; }

.guide-doc p, .guide-doc li { max-width: 74ch; }
.guide-doc p { text-wrap: pretty; }

.guide-doc img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 6px;
  margin: 20px 0;
  cursor: zoom-in;
}

.guide-doc pre {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
}
.guide-doc code { font-size: 0.9em; }
.guide-doc p code, .guide-doc li code, .guide-doc td code {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
  color: var(--wire);
  overflow-wrap: anywhere; /* let long unbroken paths wrap instead of scrolling the page */
}

.guide-doc table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 20px 0;
}
.guide-doc th, .guide-doc td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  font-size: 15px;
}
.guide-doc th {
  background: var(--panel);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
}

.guide-doc blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border: 1px solid rgba(229, 72, 43, 0.4);
  background: rgba(229, 72, 43, 0.06);
  color: var(--ink);
}
.guide-doc blockquote p { margin: 0; }

.guide-doc hr { border: 0; border-top: 1px solid var(--line-soft); margin: 44px 0; }
/* Section boundaries are `---` immediately before an `## h2`, and the h2 draws its own
   border-top divider — so the hr would be a redundant second line. Drop it; the heading's
   border is the single divider. */
.guide-doc hr:has(+ h2) { display: none; }

.guide-doc ul, .guide-doc ol { padding-left: 24px; }
.guide-doc li { margin: 5px 0; }

/* ---------- 404 ---------- */

.notfound { position: relative; text-align: center; padding: 110px 0 90px; overflow: hidden; }
.notfound .code {
  font-family: var(--display);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--argent);
  text-shadow: 0 0 40px rgba(255, 138, 30, 0.35);
}
.notfound h1 { font-size: clamp(1.4rem, 3.4vw, 2rem); margin: 10px 0 12px; }
.notfound p { color: var(--muted); max-width: 34em; margin: 0 auto 26px; }

/* ---------- motion prefs ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > * { animation: none; }
  .hero-graph .wire-path { animation: none; stroke-dashoffset: 0; }
  .hero-graph .pulse { display: none; }
  .btn, .btn:active { transition: none; transform: none; }
  .nav-menu, .nav-toggle-lines,
  .nav-toggle-lines::before, .nav-toggle-lines::after { transition: none; }
}

/* ---------- responsive ---------- */

/* collapse the nav into the hamburger before the links + download start to wrap */
@media (max-width: 760px) {
  .site-header .wrap { flex-wrap: nowrap; }
  .nav-toggle { display: inline-flex; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 24px 18px;
    background: rgba(9, 13, 18, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    /* hidden until the header carries .nav-open */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.24s ease,
                transform 0.28s cubic-bezier(0.4, 0.01, 0.2, 1),
                visibility 0s linear 0.28s;
  }
  .site-header.nav-open .nav-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.24s ease,
                transform 0.28s cubic-bezier(0.4, 0.01, 0.2, 1),
                visibility 0s;
  }

  .nav-menu .navlinks { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu .navlinks a {
    padding: 13px 2px;
    font-size: 15px;
    border-bottom: 1px solid var(--line-soft);
  }
  .nav-menu .btn-nav {
    margin-top: 16px;
    text-align: center;
    padding: 12px 18px;
  }
}

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-graph { max-width: 560px; margin: 0 auto; }
  .feature-row { grid-template-columns: 1fr; gap: 22px; }
  .feature-row.flip .feature-copy { order: 0; }
  .feature-row.flip .shot { order: 0; }
  .steps { grid-template-columns: 1fr; }
  .step { margin-right: 0; margin-bottom: 30px; }
  .step:last-child { margin-bottom: 0; }
  .step:not(:last-child)::after {
    top: 100%;
    left: 32px;
    width: 2px;
    height: 30px;
  }
  .guide-shell { grid-template-columns: 1fr; gap: 0; }
  .guide-toc {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 14px 16px;
    margin-bottom: 28px;
  }
  .guide-toc details > summary { cursor: pointer; }
  .guide-toc details[open] > summary { margin-bottom: 10px; }
  .guide-toc-title { margin: 0; }
  .guide-toc-title::after {
    content: "+";
    margin-left: auto;
    font-size: 15px;
    color: var(--wire);
  }
  .guide-toc details[open] .guide-toc-title::after { content: "\2212"; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding-top: 52px; }
  .hero .lede { font-size: 17px; }
  .btn { width: 100%; text-align: center; }
  .cta-row { flex-direction: column; align-items: stretch; }
  section { padding: 48px 0; }
  .gallery { grid-template-columns: 1fr; }
  .navlinks { gap: 14px; }
  .navlinks a { font-size: 13px; }
  .lightbox-close { top: 6px; right: 6px; }
}
