:root {
  --paper: #000000;
  --ink: #ffffff;
  --body: #b3b3b3;
  --muted: #999999;
  --chip: #333333;
  --chip-hover: #404040;
  --press: #e2e2e2;
  --pre-bg: #161616;
  --pre-border: #262626;
  --field: #1c1c1e;
  --line: #2c2c2e;
  --accent: #0a84ff;
  --accent-press: #409cff;
  --ok: #30d158;
  --warn: #ffd60a;
  --danger: #ff453a;
}

*,
*::before,
*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
a { cursor: pointer; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--ink); font-weight: 700; }
li::marker { color: var(--muted); }

.pride {
  height: 4px;
  flex-shrink: 0;
  background: linear-gradient(90deg,
    #e40303 0 16.66%,
    #ff8c00 16.66% 33.33%,
    #ffed00 33.33% 50%,
    #008026 50% 66.66%,
    #24408e 66.66% 83.33%,
    #732982 83.33% 100%);
}
.wrap {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding-inline: 24px;
}
:is(a, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.site-header { padding-block: 24px; }
.wordmark {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { text-decoration: underline; }

main {
  flex: 1;
  padding-block: clamp(3rem, 9vh, 5.5rem) clamp(3rem, 8vh, 5rem);
}
h1 {
  font-size: clamp(2.75rem, 9vw, 3.25rem);
  line-height: 1.23;
  font-weight: 700;
}
h2 {
  margin-top: clamp(3rem, 8vh, 4.5rem);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 700;
}

.meta {
  margin-top: 12px;
  font-size: 1rem;
  color: var(--body);
}
.lede {
  margin-top: 32px;
  font-size: 1.25rem;
  line-height: 1.4;
  max-width: 34ch;
}
.about {
  margin-top: 12px;
  font-size: 1rem;
  color: var(--body);
  max-width: 44ch;
}
.time {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}
.clock {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 0.1em;
  cursor: pointer;
}

.chips {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips a {
  display: inline-flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  gap: 10px;
}
.chips svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.chips a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.chips a:active {
  background: var(--press);
  color: var(--paper);
}
@media (prefers-reduced-motion: no-preference) {
  .chips a {
    transition: background-color 150ms ease, color 150ms ease;
  }
}

.prose {
  margin-top: 24px;
  max-width: 52ch;
  color: var(--body);
  font-size: 1rem;
}
.prose p + p { margin-top: 1em; }
.prose a { color: var(--ink); }

.intro {
  margin-top: 24px;
  color: var(--body);
  max-width: 60ch;
}
.doc p, .doc ul, .doc ol {
  margin-top: 0.75rem;
  color: var(--body);
}
.doc ul { padding-left: 1.5rem; }
.doc ol { padding-left: 1.5rem; }
.doc li { margin-bottom: 0.6rem; }

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code {
  background: #1f1f1f;
  padding: 0.1em 0.3em;
  border-radius: 3px;
  color: var(--ink);
}
pre {
  background: var(--pre-bg);
  border: 1px solid var(--pre-border);
  padding: 0.8rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
  margin-top: 0.75rem;
  color: var(--ink);
}
pre code { background: none; padding: 0; color: inherit; }
hr {
  border: none;
  border-top: 1px solid var(--pre-border);
  margin: 2.5rem 0;
}
.small { font-size: 0.85rem; color: var(--muted); }

.colophon {
  padding-block: 1.5rem 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
}
.colophon a {
  color: var(--muted);
  text-decoration: none;
}
.colophon a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (max-width: 30rem) {
  .lede { font-size: 1.125rem; }
}

/* components */

h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 700;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 80ms ease;
}
.btn:hover { background: var(--chip-hover); border-color: var(--chip-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: var(--chip); border-color: var(--line); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.btn--primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn--primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: none; border-color: var(--line); }
.btn--ghost:hover { background: none; border-color: var(--ink); }
.btn--danger { background: none; border-color: var(--line); color: var(--danger); }
.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #ffffff; }
.btn--sm { padding: 6px 12px; font-size: 0.875rem; }
.btn--lg { padding: 14px 24px; font-size: 1.0625rem; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}
.switch .track {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #3a3a3c;
  transition: background-color 200ms ease;
}
.switch .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: transform 200ms ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:disabled + .track { opacity: 0.4; }
.switch input:disabled ~ .switch-label { opacity: 0.4; }
.switch input:focus-visible + .track {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.switch-label { font-size: 0.9375rem; color: var(--body); }

.field { display: grid; gap: 8px; }
.field > label { font-size: 0.875rem; color: var(--body); }
.field > .hint { margin-top: 0; font-size: 0.8125rem; color: var(--muted); }
.input, .select, .textarea {
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--muted); }
.input[type="range"] { padding: 0; background: none; border: 0; accent-color: var(--accent); }
.input[type="file"] { padding: 8px; cursor: pointer; }
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23999999' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}
.select:hover { border-color: var(--chip-hover); }
.select option { background: var(--field); color: var(--ink); }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 2px;
}
.check label { font-size: 0.9375rem; color: var(--body); }
.check input {
  appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--field);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.check input[type="checkbox"] { border-radius: 5px; }
.check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check input[type="radio"] {
  border-radius: 50%;
  display: grid;
  place-content: center;
}
.check input[type="radio"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 150ms ease;
}
.check input[type="radio"]:checked { border-color: var(--accent); }
.check input[type="radio"]:checked::before { transform: scale(1); }
.check input:hover { border-color: var(--chip-hover); }
.check input:disabled { opacity: 0.4; cursor: not-allowed; }
.check input:disabled + label { opacity: 0.4; }
.check input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.9375rem;
}
.table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--pre-border);
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--pre-border);
  color: var(--body);
}
.table tr:last-child td { border-bottom: 0; }

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--field);
  padding: 12px 14px;
}
.note p { margin-top: 0; color: var(--body); }
.note p + p { margin-top: 0.5em; }
.note--ok { border-left-color: var(--ok); }
.note--warn { border-left-color: var(--warn); }
.note--danger { border-left-color: var(--danger); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
}
.tag--outline { background: none; border: 1px solid var(--line); color: var(--body); }
.tag--accent { background: var(--accent); color: #ffffff; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--chip);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.progress--ok > span { background: var(--ok); }

.card {
  border: 1px solid var(--pre-border);
  border-radius: 12px;
  background: var(--pre-bg);
  padding: 20px;
}
.card > :first-child { margin-top: 0; }

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.swatch {
  border: 1px solid var(--pre-border);
  border-radius: 10px;
  overflow: hidden;
}
.swatch-color { height: 56px; }
.swatch-meta {
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}
.swatch-name { color: var(--ink); font-weight: 600; font-size: 0.8125rem; }

kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  background: var(--chip);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--ink);
}
mark {
  background: var(--ink);
  color: var(--paper);
  padding: 0 2px;
  border-radius: 2px;
}
blockquote {
  margin-top: 0.75rem;
  padding-left: 14px;
  border-left: 3px solid var(--line);
  color: var(--body);
}
details {
  border: 1px solid var(--pre-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 14px;
}
summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
  padding-block: 2px;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "";
  flex-shrink: 0;
  width: 12px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23999999' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 8px;
  transition: transform 200ms ease;
}
details[open] summary::after { transform: rotate(180deg); }
details[open] summary { margin-bottom: 10px; }
@keyframes details-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
details[open] > *:not(summary) {
  animation: details-reveal 250ms ease both;
}
details > p { margin-top: 0; }
details > p + p { margin-top: 0.5em; }

@media (prefers-reduced-motion: reduce) {
  .btn, .switch .track, .switch .thumb,
  .check input, .check input::before,
  details > summary::after { transition: none; }
  details[open] > *:not(summary) { animation: none; }
  .btn:active { transform: none; }
}