html[theme="light"] {
  --bg: #fafafa;
  --fg: #222222;
  --muted: #666666;
  --link: #111111;
  --dot: rgba(0, 0, 0, 0.06);
}

html[theme="dark"] {
  --bg: #0d0d0d;
  --fg: #eaeaea;
  --muted: #999999;
  --link: #ffffff;
  --dot: rgba(255, 255, 255, 0.06);
}

html {
  color-scheme: light dark;
}

html,
body,
nav,
main,
a,
button,
.icon {
  transition:
    background-color 0.45s ease,
    color 0.45s ease,
    border-color 0.45s ease,
    fill 0.45s ease;
}

main {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg);
  background-color: var(--bg);

  background-image:
    radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 1rem 1rem;

  line-height: 1.6;
}

main {
  --max-width: 720px;
  max-width: var(--max-width);
  background: transparent;
  padding: 4rem 1.5rem;
  margin: 0 auto;
  height: auto;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.overheated {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}
.overheated svg {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;

  padding: 0 0.3rem;
  border-radius: 0.5rem;

  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);

  font-size: 0.85rem;
  color: var(--fg);
  white-space: nowrap;

  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.inline-badge {
  vertical-align: middle;
  transform: translateY(-1px);
}
.badge:hover {
  background: rgba(0, 0, 0, 0.06);
}
html[theme="dark"] .badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}
.bottom-margin {
  margin-bottom: 0.25rem;
}
.no-underline {
  text-decoration: none;
}

pre {
  margin: 0.5rem 0;
  padding: 1rem 1rem;

  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.55;

  color: var(--fg);
  background:
    linear-gradient(
      transparent,
      transparent
    ),
    rgba(0, 0, 0, 0.03);

  border: 1px solid var(--dot);
  border-radius: 10px;

  white-space: pre;
  overflow: auto;

  tab-size: 2;
}
pre {
  user-select: text;
}
pre:focus {
  border: 2px solid var(--dot);
}

abbr {
  text-decoration: none;
}
sub {
  font-size: 0.35rem;
  vertical-align: top;
  position: relative;
  top: 0.3rem;
}

.row {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: end;
  gap: 1rem;
}
.row h3 {
  margin-top: 0.25rem;
}
.row p {
  margin-top: 0;
  margin-bottom: 0.15rem;
}

table.keys {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9rem;
}
table.keys thead th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--dot);
}
html[theme="dark"] table.keys tbody tr.primary {
  background-color: rgba(255, 255, 255, 0.03);
}
table.keys td {
  padding: 0.75rem 0.75rem;
  vertical-align: top;
}
table.keys td.ok {
  color: #2e7d32;
  font-weight: 500;
}
table.keys td.warn {
  color: #b26a00;
  font-weight: 500;
}
table.keys .fingerprint {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: text;
}
table.keys tr.fingerprint-row td {
  padding-top: 0;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--dot);
}
table.keys tr.fingerprint-row code.fingerprint {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

nav a {
  text-decoration: none;
  color: var(--fg);
  font-size: 0.95rem;
}
nav a:hover {
  opacity: 0.6;
}
nav .links {
  padding: 0.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
nav .links a {
  color: var(--muted);
}
nav .links .home {
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
}
nav .links .theme {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;

  cursor: pointer;
}

.icon {
  display: block;
  width: 18px;
  height: 18px;
  transform: translateY(3px);
  fill: var(--muted);
}
.small-icon {
  width: 14px;
  height: 14px;
  transform: translateY(0);
}
html[theme="dark"] .light-icon {
  display: none;
}
html[theme="light"] .dark-icon {
  display: none;
}

article {
  margin-top: 2rem;
}

.theme-toggle:hover {
  opacity: 0.7;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

p {
  margin: 1rem 0;
  color: var(--muted);
}
h1 {
  font-size: 2.4rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--fg);
}
h2,h3,h4,h5,h6 {
  color: var(--fg);
  margin-bottom: 0;
}
strong {
  color: var(--fg);
  font-weight: 500;
}
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  opacity: 0.7;
}
.desc {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.copy-badge .copy-icon {
  opacity: 0.6
}
.copy-badge:hover .copy-icon,
.copy-badge:focus-visible .copy-icon {
  opacity: 1.0;
}
.copy-badge.copied .copy-icon {
  opacity: 1;
}
