/* DownDrill documentation. downdrill.com's colours, type, mark, header and footer; no framework,
   no script, nothing loaded from elsewhere. The colour tokens are the landing page's own, and so
   are the rules the three places share: tests/unit/test_one_look.py holds all three to them. */

:root {
  color-scheme: light dark;

  --bg: #f6f3ec;
  --surface: #fffdf8;
  --sunk: #ece8dd;
  --ink: #16212b;
  --soft: #34424e;
  --muted: #5c6872;
  --rule: #d8d2c3;
  --line: rgb(22 33 43 / 5%);
  --accent: #0f4c5c;
  --accent-strong: #0a3843;
  --accent-soft: #dbe9ec;
  --on-accent: #ffffff;
  --header: rgb(246 243 236 / 88%);
  --shadow: rgb(22 33 43 / 22%);

  /* The same three outcomes the app shows, in the app's colours. */
  --good: #1a7f37;
  --good-bg: #e2f2e6;
  --bad: #b42318;
  --bad-bg: #fbe5e1;
  --warn: #8a6100;
  --warn-bg: #faefcd;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1317;
    --surface: #131c21;
    --sunk: #090f12;
    --ink: #e9ece9;
    --soft: #c6cdd0;
    --muted: #94a1a8;
    --rule: #25323a;
    --line: rgb(233 236 233 / 4%);
    --accent: #6fc6d6;
    --accent-strong: #93d8e5;
    --accent-soft: #10292f;
    --on-accent: #06222a;
    --header: rgb(12 19 23 / 86%);
    --shadow: rgb(0 0 0 / 55%);

    --good: #62d081;
    --good-bg: #10301b;
    --bad: #ff8d7d;
    --bad-bg: #3a1512;
    --warn: #e6c25a;
    --warn-bg: #30270b;
  }
}

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

html {
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
pre,
table {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

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

.wrap {
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 0.9rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 6px;
}

.skip:focus {
  top: 0.75rem;
  color: var(--on-accent);
}

/* Header, as on downdrill.com */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  border-bottom: 1px solid var(--rule);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}

.site-header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  flex: none;
}

/* The mark: a D, with two chevrons pointing down cut out of it. */
.mark-body {
  fill: var(--accent);
}

.mark-cut {
  fill: none;
  stroke: var(--bg);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-nav {
  display: flex;
  gap: 1.6rem;
  margin-left: 1rem;
  flex: 1;
}

.site-nav a,
.site-signin {
  color: var(--soft);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-signin:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* "Docs" beside the name says which of DownDrill's three places this is. */
.brand-place {
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}

.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.button:active {
  transform: translateY(1px);
}

.button-small {
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
}

/* The page: the contents beside the text on a wide screen, above it on a narrow one */

.docs {
  display: grid;
  gap: 1.5rem;
  padding-block: 1.75rem 4rem;
}

.docs-nav {
  display: none;
}

.contents {
  display: grid;
  gap: 0.15rem;
}

.contents a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--soft);
  font-size: 0.95rem;
  text-decoration: none;
}

.contents a:hover {
  background: var(--sunk);
  color: var(--ink);
}

.contents a[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

.docs-menu {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}

.docs-menu > summary {
  padding: 0.6rem 0.9rem;
  color: var(--soft);
  font-weight: 600;
  cursor: pointer;
}

.docs-menu[open] > summary {
  border-bottom: 1px solid var(--rule);
}

.docs-menu .contents {
  padding: 0.5rem 0.5rem 0.6rem 0;
}

@media (min-width: 56rem) {
  .docs {
    grid-template-columns: 13.5rem minmax(0, 1fr);
    gap: 3.5rem;
    padding-block: 2.75rem 5rem;
  }

  .docs-menu {
    display: none;
  }

  .docs-nav {
    display: block;
    position: sticky;
    top: 5.5rem;
    align-self: start;
  }
}

/* The text */

.docs-main {
  min-width: 0;
  max-width: 46rem;
}

.docs-main > * + * {
  margin-top: 1.1rem;
}

.docs-main h1 {
  font: 400 clamp(2.1rem, 4vw, 2.9rem)/1.1 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.docs-main h2 {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font: 400 clamp(1.5rem, 2.6vw, 1.85rem)/1.2 var(--serif);
  letter-spacing: -0.012em;
}

.docs-main h3 {
  margin-top: 1.8rem;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.3;
}

.docs-main h2 + *,
.docs-main h3 + * {
  margin-top: 0.6rem;
}

.lede {
  color: var(--soft);
  font-size: 1.2rem;
  line-height: 1.55;
}

.docs-main ul:not([class]),
.docs-main ol:not([class]) {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.3rem;
}

.docs-main ul:not([class]) {
  list-style: disc;
}

.docs-main ol:not([class]) {
  list-style: decimal;
}

.docs-main li::marker {
  color: var(--muted);
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

strong {
  font-weight: 650;
}

code {
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  background: var(--sunk);
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.command {
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--sunk);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  /* One click selects all of it, ready to copy. */
  user-select: all;
  -webkit-user-select: all;
  cursor: copy;
}

.command code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.document {
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
}

.document code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.muted {
  color: var(--muted);
}

/* A remark beside the text */

.note {
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.note-warn {
  border-left-color: var(--warn);
}

.note > * + * {
  margin-top: 0.5rem;
}

/* A result, as the app and the evidence show it */

.pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.pill-passed {
  background: var(--good-bg);
  color: var(--good);
}

.pill-failed {
  background: var(--bad-bg);
  color: var(--bad);
}

.pill-not-tested {
  background: var(--warn-bg);
  color: var(--warn);
}

.pill-plain {
  background: var(--sunk);
  color: var(--muted);
}

/* Tables */

.table {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font: 600 0.74rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  font-weight: 600;
}

.table-plain td:first-child {
  font-weight: inherit;
}

/* Cards: the front page's way into each part */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: 0.9rem;
}

.cards a {
  display: grid;
  gap: 0.3rem;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.cards a:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.cards strong {
  font-size: 1.02rem;
}

.cards span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.cards .card-first {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cards .card-first strong {
  color: var(--accent-strong);
}

/* A flow: one box to a stage, numbered */

.flow {
  display: grid;
  gap: 0.75rem;
  counter-reset: flow;
}

.flow li {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 0.95rem 1rem 0.95rem 3.1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  counter-increment: flow;
}

.flow li::before {
  content: counter(flow);
  position: absolute;
  top: 0.95rem;
  left: 1rem;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: 700 0.8rem/1 var(--mono);
}

.flow strong {
  font-size: 1rem;
}

.flow span {
  color: var(--soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

@media (min-width: 46rem) {
  .flow-across {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .flow-across li {
    padding: 2.9rem 1rem 1rem;
  }
}

/* Steps: what to do, in order */

.steps {
  display: grid;
  gap: 1.1rem;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.steps > li > * + * {
  margin-top: 0.55rem;
}

.steps h3 {
  margin-top: 0.15rem;
}

/* Terms and what they mean */

.terms {
  display: grid;
  gap: 0.2rem 1.25rem;
}

.terms dt {
  font-weight: 650;
}

.terms dd {
  margin-bottom: 0.6rem;
  color: var(--soft);
}

@media (min-width: 40rem) {
  .terms {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .terms dd {
    margin-bottom: 0;
  }
}

/* Questions and their answers, opened as downdrill.com's are */

.faq {
  border-top: 1px solid var(--ink);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font: 400 1.4rem/1 var(--mono);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > div {
  padding: 0 2rem 1.2rem 0;
  color: var(--soft);
}

.faq details > div > * + * {
  margin-top: 0.6rem;
}

/* Previous and next page */

.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 0.9rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.pager a {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.pager a:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.pager span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.pager-next {
  text-align: right;
}

.pager-next:only-child {
  grid-column: -2;
}

/* A page with one thing to say: not found. */

.lone {
  display: grid;
  place-items: center;
  min-height: 50vh;
  text-align: center;
}

/* Footer, as on downdrill.com */

.site-footer {
  padding-block: 3rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.footer-brand p {
  max-width: 22rem;
  margin-top: 0.7rem;
}

.footer-title {
  margin-bottom: 0.6rem;
  color: var(--ink);
  font-weight: 600;
}

.site-footer li + li {
  margin-top: 0.35rem;
}

.site-footer nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-end {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
}

.footer-end p:first-child {
  max-width: 40rem;
}

/* Narrower screens, as downdrill.com's */

@media (max-width: 52rem) {
  .site-nav {
    display: none;
  }

  .site-signin {
    margin-left: auto;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 30rem) {
  .site-header-row {
    gap: 0.9rem;
  }

  .brand-place {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
