/* The Memcert site: one stylesheet for every page. docs/site/02-DESIGN.md.
   Violet is the brand; cyan is only the mark of a check that held. A state is a word and a sign, never colour alone.
   Digests, ids and commands are set in the fixed-width face. Light and dark follow the visitor's system setting,
   unless they choose with the switch in the header (theme.js sets data-theme on the root); the two dark blocks
   below hold the same colours, and a test keeps them so. */

:root {
  --bg: #F7F6FC; --surface: #FFFFFF; --sunk: #ECEAF7; --line: #D9D6EA;
  --ink: #000820; --ink2: #3B4160; --ink3: #6A708C;
  --accent: #5828F8; --accent-soft: #E9E3FF; --mark: #00D0E8;
  --good: #17794F; --good-soft: #DCF1E7;
  --bad: #B93A2C; --bad-soft: #F9E1DD;
  --warn: #8A600F; --warn-soft: #F6EBCF;
  --cmd-bg: #0B1026; --cmd-ink: #ECEBFA; --cmd-line: #2A3158;
  --sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light;
  --moon: block; --sun: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070B1C; --surface: #10152B; --sunk: #1A2140; --line: #2A3158;
    --ink: #ECEBFA; --ink2: #B9BDD6; --ink3: #8B90AE;
    --accent: #9B86FF; --accent-soft: #221A52;
    --good: #58C896; --good-soft: #153A2C;
    --bad: #FF8A7A; --bad-soft: #44201C;
    --warn: #E3B65A; --warn-soft: #3B3016;
    --cmd-bg: #02040E; --cmd-ink: #ECEBFA; --cmd-line: #2A3158;
    color-scheme: dark;
    --moon: none; --sun: block;
  }
}
:root[data-theme="dark"] {
    --bg: #070B1C; --surface: #10152B; --sunk: #1A2140; --line: #2A3158;
    --ink: #ECEBFA; --ink2: #B9BDD6; --ink3: #8B90AE;
    --accent: #9B86FF; --accent-soft: #221A52;
    --good: #58C896; --good-soft: #153A2C;
    --bad: #FF8A7A; --bad-soft: #44201C;
    --warn: #E3B65A; --warn-soft: #3B3016;
    --cmd-bg: #02040E; --cmd-ink: #ECEBFA; --cmd-line: #2A3158;
    color-scheme: dark;
  --moon: none; --sun: block;
}

/* ── base ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
img, svg, picture { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
.wrap {
  max-width: 1040px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1 { font-size: clamp(1.875rem, 4.4vw, 3rem); line-height: 1.1; letter-spacing: -0.015em; margin: 0; max-width: 22ch; text-wrap: balance; }
h2 { font-size: 1.4375rem; line-height: 1.25; margin: 0; text-wrap: balance; }
h3 { font-size: 1rem; line-height: 1.35; margin: 0; }
p { margin: 0; color: var(--ink2); max-width: 70ch; }
ul, ol { margin: 0; padding-left: 1.25rem; color: var(--ink2); }
li + li { margin-top: 4px; }
strong { color: var(--ink); }
.lede { font-size: 1.125rem; }
small, .small { font-size: 0.8125rem; color: var(--ink3); }
.mono, code, pre, kbd { font-family: var(--mono); font-size: 0.84rem; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.id { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink3); overflow-wrap: anywhere; }

/* ── top bar ──────────────────────────────────────────────────────────── */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 14px; margin-right: auto; color: var(--ink); font-weight: 700; font-size: 1.0625rem; text-decoration: none; }
.brand img { display: block; width: 28px; height: 28px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.top nav a { color: var(--ink2); font-size: 0.92rem; text-decoration: none; padding-block: 2px; }
.top nav a:hover { color: var(--accent); }
.top nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.theme {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink2); cursor: pointer;
}
.theme:hover { color: var(--accent); border-color: var(--accent); }
.theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme[hidden] { display: none; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .moon { display: var(--moon); }
.theme .sun { display: var(--sun); }
@media (max-width: 760px) {
  .top .wrap { position: relative; }
  .brand { flex-basis: 100%; }
  .theme { position: absolute; top: 9px; right: max(16px, env(safe-area-inset-right, 0px)); }
}

main { padding-block: 40px 64px; display: flex; flex-direction: column; gap: 44px; }
section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ── chips and the certified mark ─────────────────────────────────────── */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 2px 10px; border-radius: 999px; background: var(--sunk); color: var(--ink2);
  font-size: 0.78rem; font-weight: 600; line-height: 1.45; text-decoration: none;
}
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.plain { background: transparent; border: 1px solid var(--line); padding: 1px 9px; }
.chip.cert { background: var(--accent-soft); color: var(--accent); }
a.chip { padding: 6px 14px; font-size: 0.875rem; }
a.chip:hover { color: var(--accent); background: var(--accent-soft); }
a.chip.go { background: var(--accent); color: var(--surface); }
a.chip.go:hover { filter: brightness(1.08); color: var(--surface); }
.sign { width: 14px; height: 14px; flex: none; }
.sign .ring { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.sign .tick { fill: none; stroke: var(--mark); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── cards, rows, grids ───────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px;
}
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); }
a.card h3 { color: var(--ink); }
a.card p { font-size: 0.94rem; }
a.card .id { margin-top: auto; }
a.card .cardhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
a.card .cardhead > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.thumb { display: block; width: 72px; height: 72px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.thumb img { display: block; width: 100%; height: 100%; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
h3 + .row { border-top: 1px solid var(--line); padding-top: 11px; }
.row > div { min-width: 0; }
.row em { display: block; font-style: normal; color: var(--ink3); font-size: 0.8125rem; overflow-wrap: anywhere; }
.row .chip { flex: none; }

/* ── a pack's head ────────────────────────────────────────────────────── */
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; align-items: start; }
.head > div { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cover { display: block; width: 132px; height: 132px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cover img { display: block; width: 100%; height: 100%; }
.digest { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink2); overflow-wrap: anywhere; }

/* ── commands: a dark box, fixed-width text, no colours, a Copy button ── */
.cmd { display: flex; align-items: flex-start; min-width: 0; background: var(--cmd-bg); color: var(--cmd-ink); border: 1px solid var(--cmd-line); border-radius: 8px; }
.cmd pre { flex: 1; min-width: 0; padding: 12px 14px; overflow-x: auto; white-space: pre; overflow-wrap: normal; font-size: 0.8125rem; line-height: 1.65; }
.cmd .copy {
  flex: none; margin: 8px 8px 0 0; padding: 3px 10px; cursor: pointer;
  font: 600 0.75rem var(--sans); color: var(--cmd-ink); background: var(--cmd-bg);
  border: 1px solid var(--cmd-line); border-radius: 6px;
}
.cmd .copy:hover { border-color: var(--cmd-ink); }

/* ── refusals ─────────────────────────────────────────────────────────── */
.box { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px; border-radius: 8px; }
.box.bad { background: var(--bad-soft); }
.box.bad h3 { color: var(--bad); }
.box small { color: var(--ink2); }
.box pre { padding: 10px 12px; background: var(--surface); color: var(--ink); border-radius: 6px; font-size: 0.8125rem; }

/* ── steps: only for real sequences ───────────────────────────────────── */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.step { counter-increment: s; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.step::before { content: counter(s); color: var(--accent); font-weight: 700; font-size: 1.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.step p { font-size: 0.92rem; }

/* ── planned screens, only on "What is coming" ────────────────────────── */
.frame { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px dashed var(--ink3); border-radius: 10px; }
.frame .ftop { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--sunk); border-bottom: 1px dashed var(--ink3); }
.frame .ftop i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.frame .ftop span { margin-left: 6px; font-size: 0.75rem; font-weight: 600; color: var(--ink2); }
.frame .in { display: flex; flex-direction: column; gap: 10px; padding: 16px; }

/* ── tables ───────────────────────────────────────────────────────────── */
.tw { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3); }
td { color: var(--ink2); }
td:first-child { color: var(--ink); font-weight: 600; }

details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; color: var(--ink2); font-size: 0.92rem; }
details[open] summary { margin-bottom: 12px; }

/* ── the browser verifier ─────────────────────────────────────────────── */
.form { display: grid; gap: 16px; max-width: 46rem; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; color: var(--ink); }
input[type="file"], input[type="text"] {
  max-width: 100%; padding: 8px 10px; font: inherit; font-size: 0.92rem; font-weight: 400;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
button.primary { justify-self: start; padding: 8px 20px; cursor: pointer; font: 600 0.92rem var(--sans); color: var(--surface); background: var(--accent); border: 0; border-radius: 999px; }
.result { display: flex; flex-direction: column; gap: 10px; min-height: 3.5rem; max-width: 46rem; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.verdict { font-weight: 700; color: var(--ink2); }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.result pre { font-size: 0.8125rem; color: var(--ink2); }

/* ── footer ───────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); }
.foot .wrap { display: flex; flex-direction: column; gap: 6px; padding-block: 20px 40px; }
.foot p { max-width: none; font-size: 0.8125rem; color: var(--ink3); }

/* ── a phone ──────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  main { padding-block: 28px 48px; gap: 36px; }
  .head { grid-template-columns: minmax(0, 1fr); }
  .cover { order: -1; width: 88px; height: 88px; padding: 8px; }
  .thumb { width: 60px; height: 60px; padding: 6px; }
  .row { flex-wrap: wrap; }
}

/* ── text from the packs repository's Markdown ────────────────────────── */
.prose { display: flex; flex-direction: column; gap: 10px; max-width: 74ch; }
.prose li + li { margin-top: 0; }
.prose li > * + * { margin-top: 8px; }
p code, li code, td code { padding: 0.05em 0.35em; border-radius: 4px; background: var(--sunk); color: var(--ink); overflow-wrap: anywhere; }

/* ── the format page: a pack, layer by layer, and what protects it ───── */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px 40px; align-items: center; }
.hero > div:first-child { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
h1.big { font-size: clamp(2.125rem, 5.2vw, 3.5rem); max-width: 16ch; }
.layers { min-width: 0; }
.layer { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; min-width: 0; }
.lhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.lname { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.lwhat { font-size: 0.82rem; color: var(--ink2); }
.lcheck { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); }
.l-file { border: 1.5px dashed var(--ink3); background: var(--bg); }
.l-sig { border: 2px solid var(--accent); background: var(--surface); }
.l-list { border: 1px solid var(--line); background: var(--surface); }
.l-data { background: var(--sunk); }
.l-att { border: 1.5px dashed var(--accent); background: var(--accent-soft); }
.feat { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.feat a {
  display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; padding: 20px 10px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none; text-align: center; font-weight: 600; font-size: 0.9rem; line-height: 1.3;
}
.feat a:hover { border-color: var(--accent); }
.feat a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) { .feat { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .feat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ico { display: block; flex: none; color: var(--accent); }
.ico .bg { fill: var(--surface); }

/* ── the protection page: each protection in full ─────────────────────── */
.guard { scroll-margin-top: 16px; padding-top: 28px; border-top: 1px solid var(--line); }
.ghead { display: flex; align-items: flex-start; gap: 20px; }
.ghead > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 74ch; }
.ghead .ico .bg { fill: var(--bg); }
.gbody { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.how { padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; font-size: 0.94rem; }
.how li::marker { color: var(--accent); font-weight: 700; }
#demos, #ladder { scroll-margin-top: 16px; }
#ladder td .chip { white-space: nowrap; }
@media (max-width: 760px) {
  .gbody { grid-template-columns: minmax(0, 1fr); }
  .ghead { flex-direction: column; gap: 12px; }
}

/* ── the protection page: from its maker to your agent ───────────────── */
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; }
.actor {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; padding: 22px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.actor.a-hub { border: 2px solid var(--accent); }
.actor h3 { text-align: center; }
.actor + .actor::before {
  content: "\2192"; position: absolute; left: -36px; top: 52px; width: 28px; text-align: center;
  color: var(--accent); font-size: 1.75rem; font-weight: 700; line-height: 1;
}
.ticks { align-self: stretch; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; color: var(--ink2); }
.holds { align-self: stretch; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.86rem; }
.hand { align-self: stretch; font-family: var(--mono); font-size: 0.75rem; color: var(--accent); }
.flow + .grid2 { margin-top: 18px; }
@media (max-width: 860px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .actor + .actor::before { content: "\2193"; left: 50%; top: -36px; margin-left: -14px; }
}
.cite { max-width: 46rem; }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.poster img { display: block; width: 100%; height: auto; }
