/* SPDX-License-Identifier: BSD-2-Clause */
/* Copyright (c) 2026 Authors of shirudo */
/* The palette and fonts of the documentation theme at docs.shirudo.dev. */

:root {
  --bg: #fff;
  --soft: #f4f6f8;
  --fg: #171b22;
  --muted: #5d6675;
  --line: #e2e6eb;
  --accent: #8b1e3f;
  --accent-soft: #f8ecf0;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --width: 50rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --soft: #161b22;
    --fg: #e4e8ee;
    --muted: #9ba5b3;
    --line: #262d37;
    --accent: #e8899f;
    --accent-soft: #3a1b25;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: var(--width);
  padding: 0 1.25rem;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.brand img {
  display: block;
  height: 2.5rem;
  width: auto;
}

.top nav {
  display: flex;
  gap: 1.5rem;
}

.top nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}

.top nav a:hover {
  color: var(--accent);
}

main {
  padding: 2.5rem 0 1rem;
}

.etymology {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.lead {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.1);
}

.button.quiet {
  background: transparent;
  color: var(--accent);
}

.button.quiet:hover {
  background: var(--accent-soft);
  filter: none;
}

h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.cases {
  padding: 0;
  list-style: none;
}

.cases li {
  margin: 0 0 0.75rem;
  padding-left: 0.9rem;
  border-left: 3px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

figure {
  margin: 0;
}

/* Below this width the labels of the diagram are too small to read, so
 * a narrow screen scrolls it instead. */
figure > a {
  display: block;
  overflow-x: auto;
}

figure > a img {
  display: block;
  width: 100%;
  min-width: 40rem;
  height: auto;
}

figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0 2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.index h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.index ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.index li {
  margin: 0.25rem 0;
}

footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--muted);
}
