/*
 * Site of zdkmd (distribution design §5): the tokens of zdkQrCode, light and dark after the
 * system, green accent, system fonts; no outside resource, no inline style (CSP).
 */
:root {
  color-scheme: light dark;
  --bg: #f4f6f5;
  --panel: #ffffff;
  --panel-2: #eef1ef;
  --chip: #e6eae8;
  --line: #d3d9d6;
  --text: #1b201d;
  --text-2: #384039;
  --dim: #5a635e;
  --strong: #0b0e0c;
  --accent: #0a7337;
  --on-accent: #ffffff;
  --shadow: rgb(16 24 20 / 18%);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;

  /* The terminal of the captures: its default colors, then its 16 colors. */
  --term-fg: #1b201d;
  --term-bg: #ffffff;
  --t0: #24292f;
  --t1: #cf222e;
  --t2: #116329;
  --t3: #7d4e00;
  --t4: #0969da;
  --t5: #8250df;
  --t6: #1b7c83;
  --t7: #6e7781;
  --t8: #57606a;
  --t9: #a40e26;
  --t10: #1a7f37;
  --t11: #633c01;
  --t12: #218bff;
  --t13: #a475f9;
  --t14: #3192aa;
  --t15: #8c959f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f0e;
    --panel: #141716;
    --panel-2: #101312;
    --chip: #1b1f1d;
    --line: #232826;
    --text: #d9dedb;
    --text-2: #c3cac6;
    --dim: #8b938f;
    --strong: #ffffff;
    --accent: #1ed760;
    --on-accent: #121212;
    --shadow: rgb(0 0 0 / 60%);

    --term-fg: #d9dedb;
    --term-bg: #0b0d0c;
    --t0: #1b1f1d;
    --t1: #ff7b72;
    --t2: #3fb950;
    --t3: #d29922;
    --t4: #58a6ff;
    --t5: #bc8cff;
    --t6: #39c5cf;
    --t7: #b1bab4;
    --t8: #6e7681;
    --t9: #ffa198;
    --t10: #56d364;
    --t11: #e3b341;
    --t12: #79c0ff;
    --t13: #d2a8ff;
    --t14: #56d4dd;
    --t15: #f0f6fc;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px / 1.55 var(--sans);
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

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

code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--chip);
  color: var(--strong);
  font-size: 0.88em;
}

kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--strong);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

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

.site-bar,
.site-main,
.site-foot p {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
}

/* Header: brand, sections, language. */
.site-head {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}

.site-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 8px 0;
}

.site-brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-right: auto;
  color: var(--strong);
  font: 700 18px / 1 var(--mono);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-brand b,
.hero h1 b,
.choice h1 b {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.site-nav a,
.lang-switch a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--chip);
  color: var(--strong);
}

.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.lang-switch a {
  min-width: 44px;
  min-height: 36px;
  justify-content: center;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--dim);
  font: 700 12.5px / 1 var(--mono);
  letter-spacing: 0.08em;
}

.lang-switch a[aria-current="page"] {
  background: var(--chip);
  color: var(--strong);
}

.site-main {
  flex: 1;
  padding: 48px 0 72px;
}

.site-foot {
  border-top: 1px solid var(--line);
}

.site-foot p {
  padding: 18px 0;
  color: var(--dim);
  font-size: 13.5px;
}

.site-foot a {
  color: var(--text-2);
}

/* Hero. */
.hero h1,
.choice h1 {
  color: var(--strong);
  font: 700 52px / 1.05 var(--mono);
  letter-spacing: 0.02em;
}

.tagline {
  max-width: 34ch;
  margin-top: 16px;
  color: var(--strong);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.3;
}

.lead {
  max-width: 68ch;
  margin-top: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

.command-label {
  margin-top: 28px;
  color: var(--dim);
  font: 700 12.5px / 1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-top: 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.hero .command {
  width: fit-content;
  border-left: 3px solid var(--accent);
}

.command code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 8px 0;
  background: none;
  font-size: 14.5px;
  white-space: pre;
}

.command .prompt {
  color: var(--dim);
  user-select: none;
}

.copy {
  flex: none;
  min-width: 76px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 14px / 1 var(--sans);
  cursor: pointer;
}

.copy[hidden] {
  display: none;
}

.facts {
  margin-top: 14px;
  color: var(--dim);
  font-size: 14px;
}

/* Sections. */
.section {
  margin-top: 80px;
  scroll-margin-top: 72px;
}

.section h2 {
  color: var(--strong);
  font-size: 28px;
  line-height: 1.25;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.cards.install {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
}

.card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.card h3 {
  color: var(--strong);
  font-size: 16px;
  line-height: 1.35;
}

.card p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.55;
}

.card .keys {
  margin: 0 0 10px;
}

/* A long command wraps at its spaces, the URL at need, rather than hide its end. */
.card .command code {
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Preview: the captures in a terminal frame. Every capture is 80 columns wide; the font follows
   the width of the frame (container units), so the screen fits at every size and every zoom. */
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 24px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
}

.shots > li:first-child {
  grid-column: 1 / -1;
  width: min(100%, 820px);
  justify-self: center;
}

.shot {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shot h3 {
  color: var(--strong);
  font-size: 16px;
}

.shot p {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 14.5px;
}

.term {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--term-bg);
  box-shadow: 0 18px 40px -24px var(--shadow);
  container-type: inline-size;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.term-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.term-bar span {
  min-width: 0;
  overflow: hidden;
  margin-left: 8px;
  color: var(--dim);
  font: 12px / 1.2 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-screen {
  overflow: hidden;
  padding: 10px 12px;
  color: var(--term-fg);
  font-size: calc((100cqi - 24px) / 50);
  line-height: 1.15;
  white-space: pre;
}

.term-screen .w {
  display: inline-block;
  width: 2ch;
}

.f0 {
  color: var(--t0);
}
.f1 {
  color: var(--t1);
}
.f2 {
  color: var(--t2);
}
.f3 {
  color: var(--t3);
}
.f4 {
  color: var(--t4);
}
.f5 {
  color: var(--t5);
}
.f6 {
  color: var(--t6);
}
.f7 {
  color: var(--t7);
}
.f8 {
  color: var(--t8);
}
.f9 {
  color: var(--t9);
}
.f10 {
  color: var(--t10);
}
.f11 {
  color: var(--t11);
}
.f12 {
  color: var(--t12);
}
.f13 {
  color: var(--t13);
}
.f14 {
  color: var(--t14);
}
.f15 {
  color: var(--t15);
}
.b0 {
  background: var(--t0);
}
.b1 {
  background: var(--t1);
}
.b2 {
  background: var(--t2);
}
.b3 {
  background: var(--t3);
}
.b4 {
  background: var(--t4);
}
.b5 {
  background: var(--t5);
}
.b6 {
  background: var(--t6);
}
.b7 {
  background: var(--t7);
}
.b8 {
  background: var(--t8);
}
.b9 {
  background: var(--t9);
}
.b10 {
  background: var(--t10);
}
.b11 {
  background: var(--t11);
}
.b12 {
  background: var(--t12);
}
.b13 {
  background: var(--t13);
}
.b14 {
  background: var(--t14);
}
.b15 {
  background: var(--t15);
}
.fr {
  color: var(--term-bg);
}
.br {
  background: var(--term-fg);
}
.bd {
  font-weight: 700;
}
.dm {
  opacity: 0.6;
}
.it {
  font-style: italic;
}
.ul {
  text-decoration: underline;
}
.st {
  text-decoration: line-through;
}
.ul.st {
  text-decoration: underline line-through;
}

/* Versions: CHANGELOG.md. */
.releases {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.release {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  scroll-margin-top: 72px;
}

.release h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  scroll-margin-top: 72px;
}

.release h3 .anchor {
  color: var(--strong);
  font: 700 20px / 1.2 var(--mono);
  text-decoration: none;
}

.release h3 .anchor:hover {
  color: var(--accent);
}

.release h3:target .anchor {
  color: var(--accent);
}

.release time {
  color: var(--dim);
  font-size: 14px;
}

.release h4 {
  margin-top: 14px;
  color: var(--dim);
  font: 700 12.5px / 1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.release p,
.release li {
  color: var(--text-2);
  font-size: 14.5px;
}

.release p {
  margin-top: 8px;
}

.release ul {
  margin-top: 8px;
  padding-left: 20px;
}

.release li + li {
  margin-top: 6px;
}

/* Licence, `/` and 404. */
.licence {
  max-width: 76ch;
}

.licence h1 {
  margin-bottom: 20px;
  color: var(--strong);
  font-size: 32px;
}

.licence p {
  margin-top: 12px;
  color: var(--text-2);
}

.licence h2 {
  margin-top: 36px;
  color: var(--strong);
  font-size: 22px;
  line-height: 1.3;
}

.licence .sources {
  margin-top: 12px;
  padding-left: 20px;
  color: var(--text-2);
}

.licence .sources li + li {
  margin-top: 6px;
}

/* The commits of the sources: long, cut anywhere on a narrow screen. */
.sources a {
  overflow-wrap: anywhere;
}

.licence .back {
  margin-top: 28px;
}

.choice {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.choices a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--strong);
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 760px) {
  .site-nav {
    order: 1;
    width: calc(100% + 20px);
    margin: 0 -10px;
  }

  .site-nav a {
    padding: 0 10px;
  }

  .site-main {
    padding-top: 32px;
  }

  .hero h1,
  .choice h1 {
    font-size: 40px;
  }

  .tagline {
    font-size: 21px;
  }

  .hero .command {
    width: 100%;
  }

  .hero .command code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .shots {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
