/* Confidex landing page. Five bands descend from plain promise to construction. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/PublicSans.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/SourceCodePro.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Source Code Pro", ui-monospace, Menlo, Consolas, "Noto Sans Mono", monospace;
  --gold: #d9a94e;
  --gold-ink: #17130a;
  --spruce: #143d33;
  --control-line: #557765;
  --page: 1160px;
  --gutter: clamp(16px, 3vw, 32px);
  --radius: 6px;
  --step--1: 0.9375rem;
  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: 1.375rem;
  --step-3: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.5rem + 2.1vw, 3.25rem);
}

/* Band tokens, light scheme. Each level is one tone deeper. */
.l0 { --bg: #ffffff; --ink: #0f1f1a; --muted: #4b5e57; --line: #d6e0db; --surface: #f3f7f5; --box: #cfe0d7; --btn-bg: #143d33; --btn-fg: #ffffff; --ok: #1f6b4a; --warn: #8a5a0a; --bad: #a3271f; }
.l1 { --bg: #eef4f1; --ink: #0f1f1a; --muted: #46594f; --line: #cbdad2; --surface: #ffffff; --box: #cfe0d7; --btn-bg: #143d33; --btn-fg: #ffffff; --ok: #1f6b4a; --warn: #8a5a0a; --bad: #a3271f; }
.l2 { --bg: #cfe0d7; --ink: #0f1f1a; --muted: #3a5046; --line: #adc6ba; --surface: #eef4f1; --box: #b5cfc2; --btn-bg: #143d33; --btn-fg: #ffffff; --ok: #1a5f41; --warn: #7a4f08; --bad: #962118; }
.l3 { --bg: #245847; --ink: #eef3f0; --muted: #b7dccb; --line: #3f7461; --surface: #1d4b3c; --box: #2f6a57; --btn-bg: #eef3f0; --btn-fg: #143d33; --ok: #9fe0bd; --warn: #f0c777; --bad: #f4a39b; }
.l4 { --bg: #143d33; --ink: #eef3f0; --muted: #a9d6c3; --line: #2b5b4c; --surface: #0f3129; --box: #1f4d40; --btn-bg: #eef3f0; --btn-fg: #143d33; --ok: #9fe0bd; --warn: #f0c777; --bad: #f4a39b; }

@media (prefers-color-scheme: dark) {
  /* Dark scheme: tinted dark greens, never near-black, each level one step deeper in hue. Figure surfaces sit two steps above their ground. */
  .l0 { --bg: #1b2320; --ink: #e9efec; --muted: #b3c3bb; --line: #3b4842; --surface: #28322e; --box: #3a4842; --btn-bg: #cfe0d7; --btn-fg: #0f1f1a; --ok: #9fe0bd; --warn: #f0c777; --bad: #f4a39b; }
  .l1 { --bg: #202b27; --ink: #e9efec; --muted: #b5c5bd; --line: #41504a; --surface: #2d3a35; --box: #405149; --btn-bg: #cfe0d7; --btn-fg: #0f1f1a; --ok: #9fe0bd; --warn: #f0c777; --bad: #f4a39b; }
  .l2 { --bg: #25342f; --ink: #e9efec; --muted: #b7c8bf; --line: #485c53; --surface: #33433d; --box: #475c52; --btn-bg: #cfe0d7; --btn-fg: #0f1f1a; --ok: #9fe0bd; --warn: #f0c777; --bad: #f4a39b; }
  .l3 { --bg: #22463b; --ink: #eef3f0; --muted: #c0dfd0; --line: #3f6a5b; --surface: #2d5447; --box: #3a6657; --btn-bg: #eef3f0; --btn-fg: #143d33; }
  .l4 { --bg: #1a4a3e; --ink: #eef3f0; --muted: #b9dccb; --line: #356b5b; --surface: #15392f; --box: #2a6252; --btn-bg: #eef3f0; --btn-fg: #143d33; }
  :root { --gold: #e2b75e; --control-line: #9bb9aa; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
html:focus-within { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
}

h1, h2, h3, p, ul, ol, dl, figure, table { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }
code { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--gold); color: var(--gold-ink); }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }

.skip { position: absolute; left: var(--gutter); top: -100px; background: var(--gold); color: var(--gold-ink); padding: 8px 12px; border-radius: 4px; font-weight: 600; }
.skip:focus { top: 12px; z-index: 20; }

/* Bands */
.band { background: var(--bg); color: var(--ink); padding: clamp(64px, 9vw, 120px) 0; }
.band + .band { border-top: 1px solid var(--line); }

.error-page { padding-block: clamp(64px, 12vw, 160px); }
.error-page h1 { max-width: 24ch; font-size: var(--step-4); line-height: 1.1; letter-spacing: -0.022em; font-weight: 650; text-wrap: balance; }
.error-page p { max-width: 48ch; margin-top: 20px; color: var(--muted); }
.error-page .btn { margin-top: 28px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: 12px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: var(--step-1); }
.brand .mark { width: 22px; height: 22px; align-self: center; }
.brand small { font-weight: 500; color: var(--muted); font-size: var(--step--1); }
.nav { display: flex; align-items: center; gap: 16px; min-width: 0; }
.nav a { text-decoration: none; color: var(--muted); font-size: var(--step--1); font-weight: 500; }
.nav a:hover { color: var(--ink); }
.site-links { display: flex; align-items: center; gap: 24px; }
.site-links a { display: block; padding-block: 12px; }
.site-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }
.menu-toggle { display: none !important; }
.menu-toggle svg { width: 18px; height: 18px; flex: none; }
.page-toc { border-top: 1px solid var(--line); }
/* The marker is drawn, so it follows the palette instead of the browser. */
.page-toc > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 0; min-height: 44px; color: var(--muted); font-size: var(--step--1); cursor: pointer; }
.page-toc > summary::-webkit-details-marker { display: none; }
.page-toc > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 140ms; flex: none; }
.page-toc[open] > summary { color: var(--ink); }
.page-toc[open] > summary::before { transform: translateY(2px) rotate(-135deg); }
.page-toc .toc { position: absolute; top: 100%; left: var(--gutter); right: var(--gutter); margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.page-toc .toc a { padding: 8px; min-height: 40px; }
/* The section in view is marked the way the current page is. */
.page-toc .toc a[aria-current] { color: var(--ink); text-decoration: underline;
  text-decoration-color: var(--gold); text-decoration-thickness: 2px; }

/* Wide enough to carry the sections themselves: the row replaces the label. */
@media (min-width: 1001px) {
  .js .page-toc > summary { display: none; }
  /* One line keeps the sticky header short. A long list scrolls sideways. */
  .page-toc > .toc {
    display: flex; flex-wrap: nowrap; align-items: baseline; gap: clamp(12px, 1.4vw, 22px);
    position: static; padding: 0; border: 0; background: none; max-height: none;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    margin-inline: auto; width: min(100% - 2 * var(--gutter), var(--page));
  }
  .page-toc > .toc a { padding: 9px 0; min-height: 0; white-space: nowrap; }
}
/* Inside the page menu the sections follow the pages, under their own label. */
.menu-sections { display: grid; gap: 2px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.menu-sections-label { color: var(--muted); font-size: var(--step--1); padding: 4px 12px; }
.menu-sections .toc { position: static; display: grid; gap: 2px; padding: 0; border: 0; background: none; max-height: none; width: auto; margin: 0; }
.menu-sections .toc a { padding: 10px 12px; min-height: 40px; white-space: normal; }
@media (max-width: 1200px) {
  .top-in { flex-wrap: wrap; }
  .nav { flex-wrap: wrap; justify-content: end; }
  .site-links { flex-wrap: wrap; }
  .js .menu-toggle:not([hidden]) { display: inline-flex !important; }
  .js .site-links { position: absolute; top: 100%; left: var(--gutter); right: var(--gutter); padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
  .js .menu-toggle[aria-expanded="false"] + .site-links { display: none; }
  .site-links a { padding: 12px; }
}
@media (max-width: 700px) {
  .top-in { gap: 8px; }
  .nav { gap: 8px; }
  /* One row is too narrow for all controls. The brand, the language and the
     application link keep the first row. The page menu takes the second row,
     where a long page name fits. */
  .js .top-in { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding-block: 8px; }
  .js .brand { grid-column: 1; grid-row: 1; }
  .js .nav { display: contents; }
  .js .lang { grid-column: 2; grid-row: 1; justify-self: end; }
  .js .nav-app { grid-column: 3; grid-row: 1; white-space: nowrap; font-size: var(--step--1); padding: 10px 12px; }
  .js .menu-toggle { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; min-width: 0; justify-content: space-between; text-align: left; font-size: var(--step--1); padding: 10px 12px; }
  .js .menu-toggle .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 520px) {
  .brand { gap: 8px; }
  /* A phone has no room for the application label, so the button shows the
     icon. The label stays for a screen reader. */
  .js .nav-app { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; padding: 0; color: var(--gold); }
  .js .nav-app .seg { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .js .nav-app .nav-app-icon { display: block; width: 20px; height: 20px; }
}

/* Language switcher: a native disclosure, no script needed. */
.lang { position: relative; font-size: var(--step--1); }
.lang summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--ink); cursor: pointer; font-weight: 500; line-height: 1.2; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { border-color: var(--ink); }
.lang summary svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.lang[open] summary { border-color: var(--ink); }
.lang ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 560px; max-width: calc(100vw - 2 * var(--gutter)); max-height: min(70vh, 520px); overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
.lang li a { display: block; padding: 7px 10px; border-radius: 4px; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang li a:hover { background: var(--box); }
.lang li a[aria-current="true"] { font-weight: 650; background: var(--box); }
@media (max-width: 700px) { .lang ul { position: fixed; left: var(--gutter); right: var(--gutter); top: auto; margin-top: 8px; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); } .lang summary .lang-name { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .lang summary { padding: 12px; min-height: 44px; } }
@media (max-width: 520px) { .brand small { display: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius);
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary .key { width: 18px; height: 18px; flex: none; }
/* A wide header shows the label, so the icon stays out of the way. */
.nav-app-icon { display: none; flex: none; }
.btn-lg { padding: 15px 22px; font-size: var(--step-1); }
/* The header action keeps one line while the links are visible. Below that
   width the bar is tight, so the label may wrap again. */
@media (min-width: 901px) { .nav .btn { white-space: nowrap; } }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: var(--step-4); line-height: 1.06; letter-spacing: -0.022em; font-weight: 650; text-wrap: balance; max-width: 24ch; }
.hero .lede { margin-top: 22px; font-size: var(--step-1); color: var(--muted); max-width: 46ch; text-wrap: pretty; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.assure { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); padding-top: 22px; }
.assure b { display: block; font-weight: 650; }
.assure p { color: var(--muted); font-size: var(--step--1); margin-top: 4px; text-wrap: pretty; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } .hero h1 { max-width: 18ch; } }
@media (max-width: 600px) { .assure { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* Figures with inline SVG infographics */
.fig { margin: 0; }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig figcaption { margin-top: 12px; color: var(--muted); font-size: var(--step--1); text-wrap: pretty; max-width: 72ch; }
/* The diagram runs the full width, so its legend does too. */
.flow figcaption { max-width: none; }
.fig text { font-family: var(--sans); fill: var(--ink); }
.fig text.m { fill: var(--muted); }
.fig text.code { font-family: var(--mono); }
.fig .surface { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.fig .box { fill: var(--box); stroke: var(--line); stroke-width: 1.5; }
.fig .slot { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 6 6; }
.fig .ink { fill: var(--ink); }
.fig .gold { fill: var(--gold); }
.fig .line { stroke: var(--line); stroke-width: 1.5; fill: none; }
.fig .bar { fill: var(--box); }
.fig .bgfill { fill: var(--bg); }
.fig .okfill { fill: var(--ok); }
.fig .seal-dot { fill: var(--ink); opacity: 0.55; }
.fig .shackle { stroke: var(--ink); }
.gs { color: var(--gold); }
.fig .gold-ink { fill: var(--gold-ink); }
.fig .gold-ink-stroke { stroke: var(--gold-ink); }
.fig .ink-stroke { stroke: var(--ink); }
.fig .bg-stroke { stroke: var(--bg); }

/* Sealing: a record becomes a numbered sealed box on the server shelf. */
.seal .bars { opacity: 0; }
.seal .lid { transform-origin: 20px 70px; transform: scaleY(0); }
.seal .parcel { opacity: 0; }
.seal.play .values { animation: seal-values 9s infinite; }
.seal.play .bars { animation: seal-bars 9s infinite; }
.seal.play .lid { animation: seal-lid 9s infinite; }
.seal.play .parcel { animation: seal-parcel 9s infinite; }
@keyframes seal-values { 0%, 26% { opacity: 1; } 34%, 78% { opacity: 0; } 86%, 100% { opacity: 1; } }
@keyframes seal-bars { 0%, 26% { opacity: 0; } 34%, 78% { opacity: 1; } 86%, 100% { opacity: 0; } }
@keyframes seal-lid { 0%, 34% { transform: scaleY(0); } 42%, 78% { transform: scaleY(1); } 86%, 100% { transform: scaleY(0); } }
@keyframes seal-parcel {
  0%, 44% { opacity: 0; transform: translate(0, 0); }
  47% { opacity: 1; transform: translate(0, 0); }
  66%, 94% { opacity: 1; transform: translate(290px, -104px); }
  97%, 100% { opacity: 0; transform: translate(290px, -104px); }
}

/* Lock: two keys, three attempts, only both together open it. */
.lock .st-open { opacity: 0; }
.lock .step { opacity: 0.7; fill: var(--muted); }
.lock .step.on { opacity: 1; fill: var(--ink); }
.lock .body { transform-origin: 280px 200px; }
.lock.play .key-a { animation: key-a 12s infinite; }
.lock.play .key-b { animation: key-b 12s infinite; }
.lock.play .body { animation: lock-shake 12s infinite; }
.lock.play .shackle { animation: shackle 12s infinite; }
.lock.play .st-locked { animation: st-locked 12s infinite; }
.lock.play .st-open { animation: st-open 12s infinite; }
.lock.play .s1 { animation: step-1 12s infinite; }
.lock.play .s2 { animation: step-2 12s infinite; }
.lock.play .s3 { animation: step-3 12s infinite; }
@keyframes key-a {
  0%, 8% { transform: translateX(0); } 14%, 26% { transform: translateX(74px); } 32%, 58% { transform: translateX(0); }
  64%, 94% { transform: translateX(74px); } 100% { transform: translateX(0); }
}
@keyframes key-b {
  0%, 36% { transform: translateX(0); } 42%, 54% { transform: translateX(-74px); } 60% { transform: translateX(0); }
  64%, 94% { transform: translateX(-74px); } 100% { transform: translateX(0); }
}
@keyframes lock-shake {
  0%, 15%, 19%, 43%, 47%, 100% { transform: rotate(0); }
  16%, 44% { transform: rotate(-2deg); } 17%, 45% { transform: rotate(2deg); } 18%, 46% { transform: rotate(-1deg); }
}
@keyframes shackle { 0%, 70% { transform: translateY(0); } 76%, 94% { transform: translateY(-30px); } 100% { transform: translateY(0); } }
@keyframes st-locked { 0%, 72% { opacity: 1; } 76%, 94% { opacity: 0; } 98%, 100% { opacity: 1; } }
@keyframes st-open { 0%, 72% { opacity: 0; } 76%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes step-1 { 0%, 6% { opacity: 0.7; } 8%, 30% { opacity: 1; fill: var(--ink); } 34%, 100% { opacity: 0.7; } }
@keyframes step-2 { 0%, 34% { opacity: 0.7; } 36%, 58% { opacity: 1; fill: var(--ink); } 62%, 100% { opacity: 0.7; } }
@keyframes step-3 { 0%, 62% { opacity: 0.7; } 64%, 96% { opacity: 1; fill: var(--ink); } 100% { opacity: 0.7; } }

/* Sync: sealed boxes travel between devices through the server. */
.sync .p1, .sync .p2, .sync .tick { opacity: 0; }
.sync.play .p1 { animation: sync-p1 8s infinite; }
.sync.play .p2 { animation: sync-p2 8s infinite; }
.sync.play .tick { animation: sync-tick 8s infinite; }
@keyframes sync-p1 { 0%, 4% { opacity: 0; transform: translateX(0); } 8% { opacity: 1; } 30%, 36% { opacity: 1; transform: translateX(60px); } 40%, 100% { opacity: 0; transform: translateX(60px); } }
@keyframes sync-p2 { 0%, 42% { opacity: 0; transform: translateX(0); } 46% { opacity: 1; } 68%, 74% { opacity: 1; transform: translateX(82px); } 78%, 100% { opacity: 0; transform: translateX(82px); } }
@keyframes sync-tick { 0%, 74% { opacity: 0; } 78%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }

/* Lock-and-forget: memory empties when the vault locks. */
.mem .fill { transform-origin: 50% 100%; }
.mem .gone { opacity: 0; }
.mem.play .fill { animation: mem-fill 7s infinite; }
.mem.play .gone { animation: mem-gone 7s infinite; }
.mem.play .held { animation: mem-held 7s infinite; }
@keyframes mem-fill { 0%, 50% { transform: scaleY(1); } 58%, 92% { transform: scaleY(0); } 100% { transform: scaleY(1); } }
@keyframes mem-gone { 0%, 56% { opacity: 0; } 60%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes mem-held { 0%, 50% { opacity: 1; } 56%, 92% { opacity: 0; } 98%, 100% { opacity: 1; } }

@media (max-width: 600px) {
  .fig text.m, .fig .step, .fig .st, .fig .held, .fig .gone { font-size: 17px; }
  .seal .values text, .fig text.code { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .fig.play * { animation: none !important; }
  .seal .parcel { opacity: 1; transform: translate(290px, -104px); }
  .lock .key-a { transform: translateX(74px); } .lock .key-b { transform: translateX(-74px); }
  .lock .shackle { transform: translateY(-30px); } .lock .st-locked { opacity: 0; } .lock .st-open { opacity: 1; } .lock .s3 { opacity: 1; }
  /* Static equivalent: one sealed box in each hop, and the phone accepted it. */
  .sync .p1, .sync .p2, .sync .tick { opacity: 1; }
  .mem .fill { transform: scaleY(0); } .mem .gone { opacity: 1; } .mem .held { opacity: 0; }
  .flow .n rect { animation: none; }
}

/* Section heads and two-column bodies */
.head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
/* The section heading sits like the page title: centred against its body. */
.head h2 { font-size: var(--step-3); line-height: 1.12; letter-spacing: -0.018em; font-weight: 650; text-wrap: balance; align-self: center; text-align: center; }
.head .intro { color: var(--muted); font-size: var(--step-1); text-wrap: pretty; }
.head .intro + .intro { margin-top: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 4vw, 64px); row-gap: 18px; margin-top: clamp(36px, 5vw, 64px); align-items: start; }
.cols.rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
/* The note explains the whole pair, so it runs under both columns. */
.cols .fignote { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: var(--step--1); text-wrap: pretty; }

h3 { font-size: var(--step-2); font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
.stack > * + * { margin-top: 14px; }
.stack h3 + p { margin-top: 8px; }
.muted { color: var(--muted); }
@media (max-width: 860px) { .head, .cols, .cols.rev { grid-template-columns: minmax(0, 1fr); } .cols { row-gap: 24px; } }

/* Plain lists with hairlines */
.plain { border-top: 1px solid var(--line); }
.plain li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plain b { font-weight: 650; }
.plain span { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 520px) { .plain li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.keep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 clamp(24px, 4vw, 64px); margin-top: clamp(36px, 5vw, 64px); }
@media (max-width: 860px) { .keep { grid-template-columns: minmax(0, 1fr); } .keep .plain + .plain { border-top: 0; } }

.move { margin-top: clamp(36px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start; padding-top: 28px; border-top: 1px solid var(--line); }
.move p { color: var(--muted); text-wrap: pretty; }
.logos { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 12px; font-weight: 600; }
@media (max-width: 860px) { .move { grid-template-columns: minmax(0, 1fr); } }

/* Apps */
.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); margin-top: clamp(36px, 5vw, 64px); }
.app h3 { padding-top: 14px; border-top: 2px solid var(--ink); }
.app p { color: var(--muted); margin-top: 10px; font-size: var(--step--1); text-wrap: pretty; }
.app .btn { margin-top: 16px; }
.app ul { margin-top: 10px; font-size: var(--step--1); }
.app li { padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .apps { grid-template-columns: minmax(0, 1fr); } }

.shots { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 24px; margin-top: clamp(36px, 5vw, 64px); align-items: end; }
.shots[hidden] { display: none; }
.shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.shots figcaption { color: var(--muted); font-size: var(--step--1); margin-top: 8px; }
@media (max-width: 700px) { .shots { grid-template-columns: 1fr; } }

/* How it works */
.keys { border-top: 1px solid var(--line); }
.keys li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.keys svg { width: 28px; height: 28px; }
.keys b { display: block; font-weight: 650; }
.keys p { color: var(--muted); font-size: var(--step--1); margin-top: 4px; text-wrap: pretty; }

/* Attack check */
.check { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: clamp(36px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.check-side { padding: 22px 24px; }
.check-side h3 { font-size: var(--step-2); }
.check-side .hint { color: var(--muted); font-size: var(--step--1); margin-top: 6px; }
.check-opts { margin-top: 16px; border-top: 1px solid var(--line); }
.check-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-opt .t { font-weight: 600; }
.check-opt .s { display: block; color: var(--muted); font-size: var(--step--1); margin-top: 2px; }
.check-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-opt .sw { display: block; width: 46px; height: 28px; border-radius: 14px; border: 2px solid var(--line); background: var(--box); position: relative; transition: background 160ms, border-color 160ms; flex: none; }
.check-opt .sw::after { content: ""; position: absolute; top: 50%; left: 3px; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--ink); transition: transform 160ms, background 160ms; }
.check-opt input:checked + .sw { background: var(--btn-bg); border-color: var(--btn-bg); }
.check-opt input:checked + .sw::after { transform: translateX(18px); background: var(--btn-fg); }
.check-opt input:focus-visible + .sw { outline: 3px solid var(--gold); outline-offset: 3px; }
.verdict { padding: 22px 24px; border-left: 1px solid var(--line); display: grid; align-content: center; gap: 10px; }
.verdict .v { font-size: var(--step-2); font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance; }
.verdict .v[data-state="no"] { color: var(--ok); }
.verdict .v[data-state="warn"] { color: var(--warn); }
.verdict .v[data-state="yes"] { color: var(--bad); }
.verdict .why { color: var(--muted); font-size: var(--step--1); text-wrap: pretty; }
.verdict.swap .v, .verdict.swap .why { animation: verdict-in 260ms ease-out; }
@keyframes verdict-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .check { grid-template-columns: minmax(0, 1fr); } .verdict { border-left: 0; border-top: 1px solid var(--line); align-content: start; } }

/* Self-host and limits */
.facts { border-top: 1px solid var(--line); }
.facts-split { margin-top: clamp(36px, 5vw, 64px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 64px); border-top: 0; }
.facts-split > div { border-top: 1px solid var(--line); border-bottom: 0; }
.facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: var(--step--1); padding-top: 2px; }
.facts dd { margin: 0; }
@media (max-width: 860px) { .facts-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.command { margin-top: clamp(36px, 5vw, 64px); }
.pre { scrollbar-color: var(--line) transparent; scrollbar-width: thin; margin: 18px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; font-family: var(--mono); font-size: 0.875rem; line-height: 1.65; overflow-x: auto; color: var(--ink); }
.pre .c { color: var(--muted); }
.pre .k { color: var(--ink); font-weight: 500; }

.limits-head { margin-top: clamp(56px, 8vw, 104px); }
.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 64px); margin-top: 20px; }
.limits > div { padding: 18px 0; border-top: 1px solid var(--line); }
.limits h3 { font-size: var(--step-1); }
.limits p { color: var(--muted); margin-top: 6px; font-size: var(--step--1); text-wrap: pretty; }
@media (max-width: 700px) { .limits { grid-template-columns: minmax(0, 1fr); } }

.crypto-index { margin-top: clamp(36px, 5vw, 64px); }
.crypto-actions { margin-top: 28px; }

/* Construction diagrams: nodes light up in derivation order, edges carry a moving dash. */
.flow { margin-top: clamp(36px, 5vw, 64px); }
.flow h3 { margin-bottom: 14px; }
.flow .scroll { scrollbar-color: var(--line) transparent; scrollbar-width: thin; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; }
.flow svg.wide { min-width: 900px; }
.flow svg.tall { display: none; max-width: 420px; margin-inline: auto; }
@media (max-width: 700px) { .flow svg.wide { display: none; } .flow svg.tall { display: block; } .flow .scroll { overflow: visible; } }
.flow text { font-size: 14px; fill: var(--ink); }
.flow text.t { font-weight: 650; font-size: 14.5px; }
.flow .lbl { font-size: 13px; fill: var(--muted); }
.flow .n rect { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.flow .n.gold rect { fill: var(--gold); stroke: var(--gold); }
.flow .n.gold text { fill: var(--gold-ink); }
.flow .n.pub rect { fill: none; stroke-dasharray: 5 4; }
.flow .e { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.flow marker path { fill: var(--muted); }
.flow .order-0 { --d: 0; }
.flow .order-1 { --d: 1; }
.flow .order-2 { --d: 2; }
.flow .order-3 { --d: 3; }
.flow .order-4 { --d: 4; }
.flow .order-5 { --d: 5; }
.flow .order-6 { --d: 6; }
.flow .order-7 { --d: 7; }
.flow .order-8 { --d: 8; }
.flow .order-9 { --d: 9; }
.flow.play .n rect { animation: node-on 900ms ease-out both; animation-delay: calc(var(--d) * 170ms + 120ms); }
.flow.play .e { stroke-dasharray: 6 6; animation: flow-dash 1.6s linear infinite; }
@keyframes node-on { 0% { stroke: var(--line); } 35% { stroke: var(--gold); stroke-width: 2.5; } 100% { stroke: var(--line); } }
@keyframes flow-dash { to { stroke-dashoffset: -24; } }
.notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 40px); margin-top: 18px; }
.notes li { padding: 14px 0; border-top: 1px solid var(--line); }
.notes b { display: block; font-weight: 650; }
.notes span { display: block; color: var(--muted); font-size: var(--step--1); margin-top: 4px; text-wrap: pretty; }
@media (max-width: 860px) { .notes { grid-template-columns: minmax(0, 1fr); } }

/* Construction table and documents */
.spec { width: 100%; border-collapse: collapse; margin-top: clamp(36px, 5vw, 64px); font-size: var(--step--1); }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.spec tr:last-child td { border-bottom: 1px solid var(--line); }
.spec th { color: var(--muted); font-weight: 500; width: 24%; }
.spec td code { color: var(--ink); }
.spec td.n { color: var(--muted); width: 38%; }
@media (max-width: 700px) {
  .spec, .spec tbody, .spec tr, .spec th, .spec td { display: block; width: auto; }
  .spec th { border-top: 1px solid var(--line); padding-bottom: 2px; }
  .spec td { border-top: 0; padding-top: 2px; }
  .spec td.n { width: auto; }
  .spec tr:last-child td { border-bottom: 0; }
  .spec tbody { border-bottom: 1px solid var(--line); }
}
@media (max-width: 700px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs li:nth-child(2) { border-top: 0; } }

.final { margin-top: clamp(56px, 8vw, 104px); padding-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px clamp(24px, 4vw, 64px); align-items: end; }
.final h2 { font-size: var(--step-3); letter-spacing: -0.018em; line-height: 1.12; font-weight: 650; max-width: 22ch; text-wrap: balance; }
.final .actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) { .final { grid-template-columns: minmax(0, 1fr); } }

footer { background: var(--bg); color: var(--muted); padding: 28px 0 40px; font-size: var(--step--1); border-top: 1px solid var(--line); }
.foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.foot ul { display: grid; gap: 8px; justify-items: end; }
@media (max-width: 700px) { .foot ul { justify-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; } }
.foot a { color: var(--muted); overflow-wrap: anywhere; }
.foot a:hover { color: var(--ink); }
.foot p + p { margin-top: 6px; }
@media (max-width: 700px) { .foot { grid-template-columns: minmax(0, 1fr); } }

/* Cryptography page: numbered steps, because the derivation really is a sequence. */
.page-head { padding: clamp(48px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); }
.page-head h1 { font-size: var(--step-4); line-height: 1.06; letter-spacing: -0.022em; font-weight: 650; text-wrap: balance; max-width: 22ch; }
.page-head .lede { margin-top: 22px; font-size: var(--step-1); color: var(--muted); max-width: 60ch; text-wrap: pretty; }
.page-head .lede + .lede { margin-top: 12px; }
/* The page head sets the title in its own column, centred against the lede. */
.page-head .wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); column-gap: clamp(24px, 4vw, 64px); align-items: start; }
.page-head h1 { grid-column: 1; align-self: center; text-align: center; }
.page-head .lede-group { grid-column: 2; }
.page-head .lede { margin-top: 0; }
.page-head .lede + .lede { margin-top: 12px; }
.page-head .toc { grid-column: 1 / -1; }
@media (max-width: 860px) { .page-head .wrap { grid-template-columns: minmax(0, 1fr); } .page-head h1, .page-head .lede-group, .page-head .toc { grid-column: 1; } .page-head .lede-group { margin-top: 22px; } }
.toc { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; font-size: var(--step--1); }
.toc a { color: var(--muted); text-decoration-color: var(--line); }
.toc a:hover { color: var(--ink); }
.steps { counter-reset: step; margin-top: clamp(36px, 5vw, 64px); }
.step { counter-increment: step; display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 0.72fr); gap: 0 clamp(16px, 2vw, 28px); padding: 22px 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before { content: counter(step); grid-column: 1; grid-row: 1 / span 6; font-weight: 650; font-size: var(--step-1); color: var(--muted); padding-top: 1px; font-variant-numeric: tabular-nums; }
.step > * { grid-column: 2; }
.step .step-aside { grid-column: 3; grid-row: 1 / span 8; align-self: start; display: grid; gap: 10px; container-type: inline-size; }
/* A step without a formula keeps the common left edge and uses both columns,
   so its text fills the row instead of leaving the formula column empty. */
.step:not(:has(.step-aside)) > h3, .step:not(:has(.step-aside)) > p { grid-column: 2 / -1; }
.step:not(:has(.step-aside)) > p { max-width: none; }
/* With no formula beside it, the number centres in its own column. */
.step:not(:has(.step-aside))::before { align-self: center; justify-self: center; padding-top: 0; }
.step h3 { font-size: var(--step-1); }
.step p { color: var(--muted); font-size: var(--step--1); margin-top: 6px; text-wrap: pretty; max-width: 72ch; }
.step .step-aside > * { margin-top: 0; }
.step code { color: var(--ink); }
.step .io { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin-top: 10px; font-size: var(--step--1); }
.step .io dt { color: var(--muted); font-size: var(--step--1); padding-top: 1px; }
.step .io dd { margin: 0; color: var(--ink); }
.step .io dd code { font-size: 0.85rem; }
@media (max-width: 1000px) {
  .step { grid-template-columns: 56px minmax(0, 1fr); }
  .step .step-aside { grid-column: 2; grid-row: auto; margin-top: 10px; }
  .step:not(:has(.step-aside)) > h3, .step:not(:has(.step-aside)) > p { grid-column: 2; }
}
@media (max-width: 600px) { .step { grid-template-columns: 36px minmax(0, 1fr); } .step .io { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.bytes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 12px; font-family: var(--mono); font-size: 0.875rem; }
.bytes span { display: flex; flex-direction: column; justify-content: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); overflow-wrap: anywhere; }
.bytes span:nth-child(4) { grid-column: 1 / -1; }
.bytes-transfer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bytes-transfer span:last-child { grid-column: 1 / -1; }
@container (max-width: 380px) {
  .bytes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bytes span:nth-child(4) { grid-column: auto; }
  .bytes span:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@container (max-width: 260px) { .bytes { grid-template-columns: minmax(0, 1fr); } }
.bytes span.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.bytes span.pub { background: transparent; border-style: dashed; }
.bytes small { display: block; color: var(--muted); font-family: var(--sans); font-size: 0.875rem; margin-top: 2px; }
.bytes span.gold small { color: var(--gold-ink); }
.leak { width: 100%; border-collapse: collapse; margin-top: clamp(24px, 3vw, 40px); font-size: var(--step--1); }
.leak th, .leak td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.leak th { color: var(--muted); font-weight: 500; width: 36%; }
.leak tr:last-child td, .leak tr:last-child th { border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { .leak, .leak tbody, .leak tr, .leak th, .leak td { display: block; width: auto; } .leak th { padding-bottom: 0; } .leak td { border-top: 0; padding-top: 2px; } .leak tr:last-child th { border-bottom: 0; } }

/* Self-hosting page: the configuration builder. */
.facts-lead { margin-top: clamp(24px, 3vw, 36px); }
.server-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(28px, 4vw, 44px); }
.builder { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); margin-top: clamp(28px, 4vw, 48px); align-items: start; }
.builder-form { display: grid; gap: 28px; }
.opt { border: 0; padding: 0; margin: 0; min-width: 0; }
.opt legend { padding: 0; font-weight: 650; font-size: var(--step-0); }
.opt .hint { color: var(--muted); font-size: var(--step--1); margin-top: 4px; text-wrap: pretty; }
.opt .choice { margin-top: 10px; }
.choice { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; background: transparent; }
.choice:hover { border-color: var(--ink); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* The box is drawn, so the control keeps one shape in every browser. */
.choice .box { width: 20px; height: 20px; margin-top: 2px; border: 2px solid var(--control-line); background: var(--bg); position: relative; }
.choice input[type="radio"] + .box { border-radius: 50%; }
.choice input[type="checkbox"] + .box { border-radius: 4px; }
.choice input:checked + .box { border-color: var(--control-line); background: var(--gold); }
.choice input:checked + .box::after { content: ""; position: absolute; inset: 4px; background: var(--gold-ink); border-radius: 50%; }
.choice input[type="checkbox"]:checked + .box::after { inset: 3px 4px 5px 4px; border-radius: 0; clip-path: polygon(14% 48%, 0 62%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.choice input:focus-visible + .box { outline: 3px solid var(--gold); outline-offset: 3px; }
.choice .t { display: block; font-weight: 600; }
.choice .s { display: block; color: var(--muted); font-size: var(--step--1); margin-top: 2px; text-wrap: pretty; }
.choice.off { opacity: 0.45; cursor: not-allowed; }
.choice.off:hover { border-color: var(--line); }
.fields { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.field { display: grid; gap: 4px; font-size: var(--step--1); color: var(--muted); }
.field .t { color: var(--muted); }
.field input { font: inherit; font-family: var(--mono); font-size: 1rem; color: var(--ink); background: var(--bg); border: 1.5px solid var(--control-line); border-radius: var(--radius); padding: 9px 12px; width: 15ch; max-width: 100%; }
.field input:hover { border-color: var(--ink); }
.builder-out { min-width: 0; }
.field-error { color: var(--bad); font-size: var(--step--1); margin-top: 8px; }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.builder-filename { color: var(--muted); font-family: var(--mono); font-size: 0.875rem; margin-top: 8px; overflow-wrap: anywhere; }
.builder-out .builder-bar { margin-top: 24px; }
.builder-out > .hint { margin-top: 0; }
.builder-jump, .builder-back { display: none; }
.builder-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.builder-bar h3 { font-size: var(--step-1); }
.builder-bar .btn { padding: 8px 14px; font-size: var(--step--1); }
.builder-bar .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.builder-out .pre { white-space: pre; }
.builder-out .hint { color: var(--muted); font-size: var(--step--1); margin-top: 12px; text-wrap: pretty; }
.aside-note { color: var(--muted); font-size: var(--step--1); margin-top: clamp(24px, 3vw, 36px); text-wrap: pretty; max-width: 72ch; }
@media (max-width: 900px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .builder-out { position: static; }
  .builder-jump { display: grid; gap: 8px; }
  .builder-back { display: inline-block; padding-block: 12px; margin-bottom: 12px; }
}

/* Download page: keep the available action before the explanation. */
.download-head { padding-block: 24px; }
.download-head .wrap { display: block; }
.download-head h1 { max-width: none; text-align: left; }
.download-info { margin-top: 12px; color: var(--muted); font-size: var(--step--1); }
/* The marker is drawn, so every disclosure on the site looks the same. */
.download-info summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding-block: 12px; }
.download-info summary::-webkit-details-marker { display: none; }
.download-info summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(-45deg); transition: transform 140ms; flex: none; }
.download-info[open] summary::before { transform: translateY(-2px) rotate(45deg); }
.download-info .lede { margin-top: 12px; }
.download-apps { padding-block: 24px 56px; }
.download-title { font-size: var(--step-2); font-weight: 650; }
.release-status { margin-top: 12px; }
.release-status .intro { color: var(--muted); }
.release-status .dl-state { margin-top: 0; }
.release-status .release-browser { margin-top: 16px; }
.release-status.dl-ok .release-browser { display: none; }
.release-status.dl-none .release-ready, .release-status.dl-empty .release-ready, .release-status.dl-error .release-ready { display: none; }
.release-status.dl-none [data-state="none"], .release-status.dl-empty [data-state="empty"], .release-status.dl-error [data-state="error"] { display: block; }
.dl-card.now .dl-pick > .dl-item { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.dl-card.now .dl-pick > .dl-item .s { color: inherit; }
/* Download page: one card per platform. */
/* Every card keeps the height of the tallest, so the row reads as one band. */
.dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); margin-top: clamp(28px, 4vw, 48px); align-items: stretch; }
/* Without a release only the browser card remains, so the row narrows to it. */
.dl.dl-solo { grid-template-columns: minmax(0, 420px); }
.dl-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); display: grid; grid-template-rows: subgrid; grid-row: span 2; row-gap: 16px; min-width: 0; }
.dl-card.now { border-color: var(--gold); }
.dl-head { display: flex; align-items: center; gap: 10px; }
.dl-body { grid-row: 1; min-width: 0; }
/* The icon is a mask, so it takes the text colour in both schemes. */
.dl-icon { flex: none; width: 26px; height: 26px; background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat; }
.dl-icon-macos { --icon: url("icons/macos.svg"); }
.dl-icon-linux { --icon: url("icons/linux.svg"); }
.dl-icon-windows { --icon: url("icons/windows.svg"); }
.dl-icon-chrome { --icon: url("icons/chrome.svg"); }
.dl-icon-firefox { --icon: url("icons/firefox.svg"); }
.dl-icon-safari { --icon: url("icons/safari.svg"); }
.dl-icon-edge { --icon: url("icons/edge.svg"); }
.dl-card h3 { font-size: var(--step-2); }
.dl-card .s { display: block; color: var(--muted); font-size: var(--step--1); margin-top: 4px; text-wrap: pretty; }
.dl-card .hint { color: var(--muted); font-size: var(--step--1); margin-top: 12px; text-wrap: pretty; }
/* Notes sit under the text; the buttons drop to the bottom of the card, so
   they line up across the row whatever the text above them is. */
.dl-list { grid-row: 2; display: grid; gap: 8px; margin-top: 0; }
.dl-list > .btn, .dl-list > .dl-pick { height: 100%; }
.dl-list:empty { margin-top: 0; }
/* Every action in a card is the same height, whatever it holds. */
.dl-list > .btn, .dl-item { min-height: 3.8rem; }
.dl-item { display: grid; justify-content: start; justify-items: start; align-content: center; gap: 2px; padding: 10px 14px; text-align: left; }
.dl-item .t { font-weight: 600; font-family: var(--sans); font-size: 0.9375rem; overflow-wrap: anywhere; }
.dl-item .s { color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; margin-top: 0; }
/* Text for screen readers only. */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The chosen build and the opener sit in one row and read as one control. */
.dl-pick { position: relative; display: flex; align-items: stretch; }
.dl-pick > .dl-item { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dl-pick:has(> .dl-more[hidden]) > .dl-item,
.dl-pick > .dl-item:only-child { border-radius: var(--radius); }

/* The other builds stay folded until the visitor asks for them. */
.dl-more { position: static; display: flex; align-items: stretch; }
.dl-more[open] { z-index: 5; }
.dl-more[hidden] { display: none; }
.dl-more > summary { list-style: none; cursor: pointer; color: var(--muted); display: flex;
  align-items: center; justify-content: center; width: 42px; align-self: stretch;
  border: 1.5px solid var(--line); border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0; }
.dl-more > summary::-webkit-details-marker { display: none; }
.dl-more > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 140ms; flex: none; }
.dl-more[open] > summary::before { transform: translateY(2px) rotate(-135deg); }
/* The cell has no left border, so a darker outline would read as a separate
   bracket. The fill marks the pointer instead. */
.dl-more > summary:hover { color: var(--ink); background: var(--box); }
.dl-more[open] > summary { color: var(--ink); background: var(--box); }
/* The list floats above the card, so opening it does not move the page. */
.dl-rest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5;
  display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.28); max-height: min(60vh, 420px); overflow-y: auto; }
/* The server states which note belongs under the cards. */
.dl-state { display: none; color: var(--muted); font-size: var(--step--1); margin-top: clamp(20px, 3vw, 32px); text-wrap: pretty; max-width: 72ch; }
.dl-none ~ .dl-state[data-state="none"] { display: block; }
.dl-error ~ .dl-state[data-state="error"] { display: block; }
.relmeta { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 1000px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dl { grid-template-columns: minmax(0, 1fr); } }
