/*
 * dudko.dev — one page: the map on the dark band, then the page on the light.
 *
 * The same system as auth.dudko.dev and the products' sites: the dark band
 * #04070e, Orbitron for headings and Source Sans for the rest, one blue for
 * what acts and cyan as the accent. The map's clusters keep their own colours
 * (products blue, open source violet, work teal, people amber); nothing
 * outside the map uses them except the legend that names them.
 */
/* WOFF2, subset to Latin (the OTF files stay for the older pages): 12 KB and
   44 KB instead of 45 KB and 211 KB. */
@font-face {
  font-family: Orbitron;
  src: url(/assets/fonts/Orbitron.woff2) format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Source Sans";
  src: url(/assets/fonts/SourceSans.woff2) format("woff2");
  font-display: swap;
}

:root {
  --brand: #0a6ac1;
  --brand-2: #2f9fe0;
  --brand-soft: #e6f1fa;
  --cyan: #5bbad5;
  --teal: #20c997;
  --violet: #a78bfa;
  --amber: #e9b563;
  --ink: #212529;
  --muted: #5c656d; /* 5.7:1 on --bg-2; auth's #6c757d is 4.4:1 there */
  --line: #dee2e6;
  --bg: #ffffff;
  --bg-2: #f8f9fa;
  --dark: #04070e;
  --dark-2: #0a1426;
  --on-dark: #eff8ff;
  --on-dark-2: rgba(239, 248, 255, 0.74);
  --dark-line: rgba(91, 186, 213, 0.22);
  --panel: rgba(8, 16, 30, 0.86);
  --radius: 10px;
  --wrap: 72rem;
  --gutter: 1.5rem;
  --font-body: "Source Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: Orbitron, var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.33, 1, 0.68, 1);
  --duration-slow: 0.9s;
}

* {
  box-sizing: border-box;
}
/* `hidden` hides, whatever display a class gives the element */
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--bg-2);
  color: var(--ink);
  font: 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
a {
  color: var(--brand);
  text-underline-offset: 3px;
}
h1,
h2,
h3 {
  font-family: var(--font-head);
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0 0 0.75rem;
}
p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--bg);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
}
:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

/* --- buttons --------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 600 1rem/1.2 var(--font-body);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: #085aa3;
  border-color: #085aa3;
}
/* The quiet button lives on the dark: an outline in the accent. */
.button.ghost {
  background: transparent;
  color: var(--on-dark);
  border-color: rgba(91, 186, 213, 0.5);
}
.button.ghost:hover {
  background: rgba(91, 186, 213, 0.12);
  border-color: var(--cyan);
}
.button:active {
  transform: translateY(1px);
}
@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background 0.15s, border-color 0.15s;
  }
}

/* --- header band ------------------------------------------------------------ */
.top {
  background: var(--dark);
  color: var(--on-dark);
  position: relative;
  z-index: 5;
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}
/* The company's mark, the same as the favicon and the channels (brand/logo/logo.svg) */
.brand .mark {
  width: auto;
  height: 2.1rem;
  filter: drop-shadow(0 0 8px rgba(10, 106, 193, 0.6));
}
.wordmark {
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  align-items: center;
  gap: 0.4rem 1.2rem;
  font-size: 0.95rem;
}
.nav a {
  color: var(--on-dark);
  opacity: 0.85;
  text-decoration: none;
}
.nav a:hover {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: var(--cyan);
}
.nav .nav-cta {
  opacity: 1;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(91, 186, 213, 0.5);
  border-radius: 6px;
}

/* --- the hero: copy on the left, the map behind and to the right -------------- */
.hero {
  position: relative;
  background: radial-gradient(ellipse 70% 90% at 68% 45%, var(--dark-2) 0%, var(--dark) 72%);
  color: var(--on-dark);
  min-height: clamp(36rem, calc(100svh - 4rem), 54rem);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--dark-line);
}
.hero-row {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.hero-copy {
  max-width: 30rem;
  pointer-events: auto;
  padding: 3rem 0 5rem;
}
.eyebrow {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.3rem);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}
.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 40rem;
}
.hero .lede {
  color: var(--on-dark-2);
}
.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 1.4rem;
}
.facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.92rem;
  color: var(--on-dark-2);
}
.facts b {
  font-family: var(--font-head);
  color: var(--on-dark);
  font-weight: 600;
  margin-right: 0.2rem;
}

.map {
  position: absolute;
  inset: 0;
  z-index: 1;
}
/* the map's first frame, so the first screen is not an empty sky while three.js loads */
.poster {
  position: absolute;
  inset: 0;
  transition: opacity 0.8s var(--ease-standard);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.map.ready .poster {
  opacity: 0;
}
#scene {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#scene:active {
  cursor: grabbing;
}
.hud {
  position: absolute;
  z-index: 3;
}
.legend {
  right: var(--gutter);
  bottom: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}
.legend button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: 600 0.78rem var(--font-body);
  letter-spacing: 0.03em;
  color: var(--c);
  background: rgba(4, 7, 14, 0.55);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.legend button:hover {
  background: color-mix(in srgb, var(--c) 16%, rgba(4, 7, 14, 0.7));
}
.legend .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
}
.zoom {
  right: var(--gutter);
  top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.zoom button {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--dark-line);
  background: rgba(4, 7, 14, 0.55);
  color: var(--on-dark);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.zoom button:hover {
  border-color: var(--cyan);
}
.hint {
  left: 50%;
  bottom: 3.6rem;
  transform: translateX(10%);
  margin: 0;
  font-size: 0.8rem;
  color: rgba(239, 248, 255, 0.55);
  pointer-events: none;
}
.hint b {
  color: var(--cyan);
  font-weight: 600;
}

/* labels, drawn by three's CSS2D renderer */
.node-label {
  font-family: var(--font-head);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--on-dark);
  text-shadow: 0 0 6px rgba(4, 7, 14, 0.98), 0 0 3px rgba(4, 7, 14, 0.98), 0 1px 2px rgba(4, 7, 14, 0.98);
  padding: 1px 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.25s, color 0.18s, font-size 0.18s;
}
.node-label.hub {
  font-size: 12.5px;
  opacity: 0.95;
  color: var(--cyan);
  letter-spacing: 0.1em;
}
.node-label.near {
  opacity: 1;
}
/* a product a use has just reached */
.node-label.ping {
  opacity: 1;
  color: #20c997;
  text-shadow: 0 0 10px rgba(32, 201, 151, 0.8), 0 0 6px rgba(4, 7, 14, 0.98);
}
/* a label that would overlap a more important one gives way */
.node-label.quiet {
  opacity: 0;
}
.node-label.hot {
  opacity: 1;
  color: var(--cyan);
  font-size: 15px;
  text-shadow: 0 0 10px rgba(91, 186, 213, 0.7), 0 0 6px rgba(4, 7, 14, 0.98);
  z-index: 5;
}

/* the map's detail panel */
#panel {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 92vw);
  background: var(--panel);
  color: var(--on-dark);
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--dark-line);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(105%);
  transition: transform 0.45s var(--ease-entrance);
  display: flex;
  flex-direction: column;
  padding: 30px 30px 26px;
}
#panel.open {
  transform: translateX(0);
}
#panel .kicker {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--cyan);
  text-transform: uppercase;
}
#panel h2 {
  font-size: 23px;
  margin: 12px 0 6px;
}
#panel .sub {
  font-size: 13px;
  color: rgba(239, 248, 255, 0.6);
  margin: 0 0 12px;
}
#panel .tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}
#panel .tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--dark-line);
  color: var(--cyan);
}
#panel .body {
  overflow-y: auto;
  flex: 1;
  font-size: 14.5px;
  line-height: 1.65;
  color: rgba(239, 248, 255, 0.82);
  padding-right: 6px;
}
#panel .body a {
  color: var(--cyan);
}
#panel .stack {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--cyan);
  opacity: 0.85;
  border-top: 1px solid var(--dark-line);
  padding-top: 14px;
}
#panel .memberlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#panel .member {
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(91, 186, 213, 0.12);
  color: rgba(239, 248, 255, 0.85);
  font: 15px var(--font-body);
  padding: 12px 30px 12px 4px;
  cursor: pointer;
}
#panel .member:hover {
  color: var(--cyan);
  background: rgba(91, 186, 213, 0.06);
}
#panel a.cta {
  margin-top: 20px;
  align-self: flex-start;
  font: 12px var(--font-head);
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--dark);
  background: linear-gradient(120deg, var(--cyan), var(--brand-2));
  padding: 12px 20px;
  border-radius: 8px;
}
#panel .close,
#panel .pnav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--dark-line);
  background: transparent;
  color: var(--on-dark);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
#panel .close {
  position: absolute;
  top: 22px;
  right: 22px;
}
#panel .pnav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 14px;
}
#panel .pnav-btn {
  color: var(--cyan);
  font-size: 20px;
}
#panel .pnav-count {
  font: 11px var(--font-head);
  letter-spacing: 0.12em;
  color: rgba(239, 248, 255, 0.55);
}

/* --- the page --------------------------------------------------------------- */
.block {
  padding-top: 4.5rem;
}
.block-head {
  margin-bottom: 1.75rem;
}
.block-head h2 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem);
}
.card,
.door,
.product,
.service,
.case,
.quote,
.libs,
.mini {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* two doors */
.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.door {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.5rem;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(4, 7, 14, 0.12);
}
.door:hover {
  border-color: var(--brand-2);
}
.kicker {
  font: 600 0.72rem var(--font-head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}
.door b {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
}
.door span {
  color: var(--muted);
}
.door .go {
  color: var(--brand);
  font-weight: 600;
  margin-top: 0.35rem;
}

/* products */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.25rem;
}
.product {
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1.25rem;
}
/* Seven do not divide by three: a last card alone in its row takes the whole
   row, its scene beside its words. */
.products > .product:last-child:nth-child(3n + 1) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  column-gap: 1.5rem;
  align-content: start;
}
.products > .product:last-child:nth-child(3n + 1) > .scene {
  grid-row: 1 / span 3;
  height: auto;
  min-height: 11.5rem;
}
.products > .product:last-child:nth-child(3n + 1) > .product-head {
  margin-top: 0.5rem;
}
.product p {
  color: var(--muted);
  margin-bottom: 0.9rem;
  flex: 1;
}
.product-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0.25rem 0.5rem;
}
.product > p,
.product > .more {
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}
.product-head img {
  border-radius: 9px;
  flex: none;
}
.product-head h3 {
  font-size: 1.05rem;
  margin: 0;
}
.live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ok, #198754);
  white-space: nowrap;
}
.live::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #20c997;
  box-shadow: 0 0 0 0 rgba(32, 201, 151, 0.6);
}
@media (prefers-reduced-motion: no-preference) {
  .live::before {
    animation: live 2s infinite;
  }
}
@keyframes live {
  70% {
    box-shadow: 0 0 0 7px rgba(32, 201, 151, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(32, 201, 151, 0);
  }
}
.more {
  font-weight: 600;
  text-decoration: none;
}
.more:hover {
  text-decoration: underline;
}
.also {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.8rem;
}
.minis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 0.75rem;
}
.mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.4;
}
.mini b {
  color: var(--ink);
}
.mini img {
  border-radius: 7px;
  flex: none;
}
.mini:hover {
  border-color: var(--brand-2);
}

/* a product's scene: a small dark screen acting out what the product does */
.scene {
  position: relative;
  height: 11.5rem;
  border-radius: 7px;
  background: radial-gradient(ellipse at 50% 0%, #10203a 0%, var(--dark-2) 70%);
  color: var(--on-dark);
  overflow: hidden;
  font: 0.8rem/1.55 var(--font-mono);
}

/* open source */
.libs {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}
.libs li {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) 1fr auto;
  gap: 0.25rem 1.25rem;
  align-items: baseline;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--line);
}
.libs li:first-child {
  border-top: 0;
}
.libs code {
  font: 0.88rem var(--font-mono);
}
.libs a {
  text-decoration: none;
}
.libs .what {
  color: var(--muted);
  font-size: 0.95rem;
}
.libs .dl {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.libs .dl b {
  color: var(--ink);
}

/* services */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.25rem;
}
.service {
  padding: 1.4rem 1.5rem;
}
.service h3 {
  font-size: 1rem;
}
.service p {
  color: var(--muted);
}
.service .seen {
  margin: 0;
  font-size: 0.85rem;
  color: var(--brand);
}

/* work */
.cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.25rem;
}
.case {
  padding: 1.4rem 1.5rem;
}
.case h3 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.case h3 a {
  color: var(--ink);
  text-decoration: none;
}
.case h3 a:hover {
  color: var(--brand);
}
.case .meta {
  font-size: 0.85rem;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 0.9rem;
  font-size: 0.93rem;
}
.ticks li {
  position: relative;
  padding-left: 1.25rem;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--teal);
}
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
}
.stack span {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* testimonials */
.quotes {
  columns: 2 22rem;
  column-gap: 1.25rem;
}
.quote {
  break-inside: avoid;
  margin: 0 0 1.25rem;
  padding: 1.4rem 1.5rem 1.2rem;
}
.quote blockquote {
  margin: 0;
}
.quote blockquote p {
  margin: 0;
}
.quote.long blockquote p {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quote.long.open blockquote p {
  display: block;
}
.quote .toggle {
  font: 600 0.9rem var(--font-body);
  color: var(--brand);
  background: none;
  border: 0;
  padding: 0;
  margin-top: 0.5rem;
  cursor: pointer;
}
.quote figcaption {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.quote figcaption a {
  font-weight: 600;
  text-decoration: none;
}

/* about */
.about > div {
  max-width: 46rem;
}
.about .links {
  color: var(--muted);
}

/* contact band */
.band {
  margin-top: 5rem;
  background: radial-gradient(ellipse 70% 120% at 80% 0%, var(--dark-2) 0%, var(--dark) 70%);
  color: var(--on-dark);
  padding: 3.5rem 0;
}
.band-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.band h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
}
.band p {
  color: var(--on-dark-2);
  max-width: 34rem;
  margin: 0;
}
.band .ctas {
  margin: 0;
}

.foot {
  padding: 1.5rem 0 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.foot p {
  margin: 0;
}

/* --- inner pages (privacy, donate): a short dark band with the title, then the
   content on the light ground; the 404 uses the full hero instead ----------- */
.page-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 70% 120% at 80% 0%, var(--dark-2) 0%, var(--dark) 70%);
  color: var(--on-dark);
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--dark-line);
}
.page-hero .sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.page-hero .wrap {
  position: relative;
}
.page-hero h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  margin-bottom: 0.7rem;
}
.page-hero .lede,
.page-hero .meta {
  color: var(--on-dark-2);
  margin: 0;
  max-width: 36rem;
}
.page-hero .meta {
  font-size: 0.95rem;
}
.page {
  padding-top: 3rem;
  padding-bottom: 4rem;
}
.page-grid {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.toc {
  position: sticky;
  top: 1.5rem;
  font-size: 0.92rem;
}
.toc p {
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.9rem;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
}
.toc a {
  color: var(--ink);
  text-decoration: none;
}
.toc a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.prose {
  max-width: 44rem;
  font-size: 1.05rem;
  line-height: 1.7;
}
.prose h2 {
  font-size: 1.12rem;
  margin: 2.4rem 0 0.7rem;
  scroll-margin-top: 1rem;
}
.prose > h2:first-child {
  margin-top: 0;
}
.prose ul {
  padding-left: 1.2rem;
}
.prose li {
  margin: 0.35rem 0;
}
.donate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.donate-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: 0 8px 24px rgba(4, 7, 14, 0.06);
}
.donate-card h2,
.donate-why h2 {
  font-size: 1.12rem;
}
.donate-card #paypal-container-V3CNZPLEZQMQA {
  margin: 1.2rem 0;
  min-height: 9rem; /* the PayPal buttons arrive late; keep their room so nothing jumps */
}
.donate-why {
  padding: 1.8rem 0.5rem;
}
.donate-why .ticks {
  font-size: 1rem;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.small {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}
@media (max-width: 56rem) {
  .page-grid,
  .donate-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .toc {
    position: static;
  }
  .donate-why {
    padding: 0;
  }
}

/* The analytics notice scripts.js draws: a bar along the foot of the page.
   The two answers are the same size and weight — a notice that makes "No"
   the harder button is not asking. */
#consent-screen[hidden] {
  display: none;
}
#consent-screen .consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.2rem;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(4, 7, 14, 0.08);
  color: var(--ink);
  font-size: 0.92rem;
}
#consent-screen p {
  margin: 0;
  max-width: 46rem;
}
#consent-screen .consent-actions {
  display: flex;
  gap: 0.6rem;
}
#consent-screen button {
  min-width: 7.5rem;
  font: 600 0.88rem var(--font-body);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--brand);
  background: var(--bg);
  color: var(--brand);
  cursor: pointer;
}
#consent-screen button:hover {
  background: var(--brand-soft);
}

/* --- entrances --------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise var(--duration-slow) var(--ease-entrance) both;
  }
  .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;
  }
  .js .rv {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
    filter: blur(6px);
    transition:
      transform var(--duration-slow) var(--ease-entrance),
      opacity 0.6s var(--ease-standard),
      filter 0.6s var(--ease-standard);
  }
  .js .rv.in {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
}

/* --- narrower screens ---------------------------------------------------------- */
@media (max-width: 56rem) {
  /* the copy on top, the map under it */
  .hero {
    display: block;
    min-height: 0;
  }
  .hero-copy {
    max-width: none;
    padding: 2rem 0 1rem;
  }
  .map {
    position: relative;
    inset: auto;
    height: min(72svh, 34rem);
  }

  .hint {
    left: var(--gutter);
    top: 1rem;
    bottom: auto;
    transform: none;
  }
  .legend {
    left: var(--gutter);
    justify-content: flex-start;
  }

  .libs li {
    grid-template-columns: 1fr auto;
  }
  .libs .what {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
@media (max-width: 40rem) {
  :root {
    --gutter: 1rem;
  }
  body {
    font-size: 16px;
  }
  .nav a:not(.nav-cta) {
    display: none;
  }
  .block {
    padding-top: 3.25rem;
  }
  .band {
    margin-top: 3.5rem;
  }
}

/* --- the scenes' furniture (site.js builds them) ------------------------------------ */
.sc-pad {
  padding: 0.75rem 0.9rem;
}
.sc-title {
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.35rem;
}
.sc-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  opacity: 0;
}
.sc-row > span:last-child {
  font-variant-numeric: tabular-nums;
}
.sc-total {
  border-top: 1px solid var(--dark-line);
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}
.sc-total b {
  color: var(--on-dark);
  font-variant-numeric: tabular-nums;
}
.sc-dim {
  color: rgba(239, 248, 255, 0.55);
}
.sc-chip {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0 0.4rem;
  border: 1px solid var(--dark-line);
  border-radius: 999px;
  color: var(--cyan);
}
.sc-chip.on {
  background: var(--cyan);
  color: var(--dark);
}
.sc-prompt {
  color: var(--on-dark);
  white-space: nowrap;
  overflow: hidden;
  min-height: 1.55em;
}
.sc-caret {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  background: var(--cyan);
  vertical-align: -0.12em;
  margin-left: 1px;
}
.sc-doc.no {
  color: rgba(239, 248, 255, 0.5);
}
.sc-doc.gone {
  text-decoration: line-through;
  opacity: 0.25 !important;
}
.sc-doc.ok .sc-mark {
  color: var(--teal);
}
.sc-foot {
  color: var(--cyan);
  margin-top: 0.3rem;
  opacity: 0;
  font-size: 0.75rem;
}
.sc-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.6rem;
  text-align: center;
}
.sc-verb {
  color: var(--teal);
}
.sc-ok {
  color: var(--teal);
  font-weight: 700;
}
.sc-code {
  color: rgba(239, 248, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-add {
  color: var(--teal);
}
.sc-tpl {
  position: absolute;
  inset: 0;
}
.sc-var {
  color: var(--amber);
}
.sc-var.set {
  color: var(--on-dark);
  background: rgba(91, 186, 213, 0.18);
  border-radius: 3px;
}
.sc-paper {
  position: absolute;
  right: 0.9rem;
  top: 0.8rem;
  bottom: 0.8rem;
  width: 42%;
  background: #fff;
  color: var(--ink);
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font: 0.72rem/1.3 var(--font-body);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
}
.sc-paper i {
  align-self: flex-end;
  font-style: normal;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger, #dc3545);
  border-radius: 3px;
  padding: 0 0.3rem;
}
.sc-line {
  display: block;
  height: 0.35rem;
  border-radius: 2px;
  background: var(--line);
}
.sc-line.short {
  width: 60%;
}
.sc-split {
  position: absolute;
  inset: 0.8rem 0.9rem;
  display: grid;
  grid-template-columns: 38% auto 1fr;
  gap: 0.6rem;
  align-items: stretch;
}
.sc-page {
  position: relative;
  background: #fff;
  border-radius: 4px;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: hidden;
}
.sc-bar {
  display: block;
  height: 0.32rem;
  border-radius: 2px;
  background: var(--line);
}
.sc-bar.h {
  height: 0.55rem;
  width: 70%;
  background: #adb5bd;
}
.sc-bar.short {
  width: 55%;
}
.sc-grid {
  flex: 1;
  margin-top: 0.2rem;
  border: 1px solid #adb5bd;
  background: linear-gradient(90deg, transparent 32%, #adb5bd 32% 34%, transparent 34% 66%, #adb5bd 66% 68%, transparent 68%),
    linear-gradient(transparent 48%, #adb5bd 48% 52%, transparent 52%);
}
.sc-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--brand-2);
  box-shadow: 0 0 10px var(--brand-2);
  opacity: 0;
}
.sc-arrow {
  align-self: center;
  color: var(--cyan);
}
.sc-out {
  overflow: hidden;
  font-size: 0.74rem;
}
.sc-md {
  white-space: pre;
  min-height: 1.45em;
  color: rgba(239, 248, 255, 0.78);
}
.sc-md.hd {
  color: var(--cyan);
  font-weight: 700;
}
.sc-svg {
  position: absolute;
  inset: 0.5rem 0 1.8rem;
  width: 100%;
  height: calc(100% - 2.3rem);
}
.sc-px rect {
  fill: var(--brand-2);
}
.sc-curve {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 10;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 6px rgba(91, 186, 213, 0.7));
}
.sc-cells {
  display: grid;
  grid-template-columns: 2rem 1fr 3rem;
  color: rgba(239, 248, 255, 0.8);
}
.sc-amber {
  color: var(--amber);
}
.sc-gate {
  align-items: center;
  border: 1px solid rgba(233, 181, 99, 0.5);
  background: rgba(233, 181, 99, 0.1);
  border-radius: 5px;
  padding: 0.15rem 0.5rem;
  color: var(--amber);
}
.sc-btn {
  font: 600 0.72rem var(--font-body);
  background: var(--amber);
  color: var(--dark);
  border-radius: 4px;
  padding: 0.05rem 0.5rem;
}
.sc-btn.pressed {
  background: var(--teal);
}
