@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4f5f8;
  --fg: #0c1322;
  --muted: #475066;
  --dim: #69728a;
  --line: #dde1ea;
  --art-line: #c9cfdc;
  --surface: #fff;
  --surface-2: #edf0f6;
  --accent: #2447f9;
  --warn: #8a5200;
  --warn-bg: #fdf0d8;
  --ok: #18794e;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, pre, blockquote, figure { margin: 0; }
ul, ol { padding: 0; }
a { color: inherit; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
code, pre, kbd { font-family: var(--mono); }

.skip {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1088px; margin: 0 auto; padding: 0 var(--gutter); }

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px var(--gutter);
}
.wordmark { display: inline-flex; gap: 10px; font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; }
.wordmark .slash { color: var(--dim); font-weight: 400; }
.top nav { display: flex; gap: 20px; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--fg); }

.hero { padding: 88px 0 16px; }
.hero h1 { font-size: clamp(36px, 6.5vw, 60px); line-height: 1.02; font-weight: 600; letter-spacing: -0.04em; }
.detail-main h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; }
.lede { margin-top: 22px; max-width: 62ch; color: var(--muted); font-size: 19px; line-height: 1.5; }
.lede p + p { margin-top: 10px; }
.facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 22px;
  font-size: 14px; color: var(--muted);
}
.lede a, .facts a, .prose a, .rail a {
  color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.lede a:hover, .facts a:hover, .prose a:hover, .rail a:hover { text-decoration-color: currentColor; }

.group { padding-top: 64px; }
.group h2, .install h2 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.group-desc { margin-top: 6px; max-width: 70ch; color: var(--muted); font-size: 15px; }

.rows { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.row {
  display: flex; flex-direction: column; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.row-head { display: flex; flex-direction: column; gap: 6px; }
.row h3 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; }
.row-runs { font: 400 12.5px/1.4 var(--mono); color: var(--accent); }
.row-purpose { margin: 8px 0 18px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.row .cmd { margin-top: auto; }

.art { border-radius: 10px; background: var(--surface-2); }
.art svg { display: block; width: 100%; height: auto; max-height: 190px; padding: 14px 18px; }
.row .art { margin-bottom: 18px; }
.detail-main .art { margin-top: 28px; max-width: 520px; border: 1px solid var(--line); background: var(--surface); }

.badge {
  display: inline-block; margin-left: 10px; padding: 2px 7px; border-radius: 4px; vertical-align: middle;
  font: 500 11px/1.5 var(--mono); letter-spacing: 0.02em;
  color: var(--warn); background: var(--warn-bg);
}

.cmd {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 10px 14px;
  font: 400 13.5px/1.7 var(--mono);
}
.row .cmd { background: var(--surface-2); border: 0; }
.cmd-prompt { color: var(--accent); user-select: none; }
.cmd pre { flex: 1; min-width: 0; color: var(--fg); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd code { font: inherit; }
.tok { white-space: nowrap; }
.cmd-copy {
  flex: none; appearance: none; border: 0; border-radius: 5px; cursor: pointer;
  padding: 2px 9px; background: var(--fg); color: var(--bg); font: 500 12px/1.75 var(--mono);
}
.cmd-copy:hover { background: var(--accent); color: #fff; }
.cmd-copy[data-state="copied"] { background: var(--ok); color: #fff; }

.install { padding-top: 72px; max-width: 760px; }
.install h2 { margin-bottom: 4px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 40px; font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs span[aria-hidden] { color: var(--dim); }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 240px; column-gap: 56px; padding-top: 24px; }
.detail-main > section { margin-top: 44px; }
.purpose { margin-top: 14px; max-width: 62ch; color: var(--muted); font-size: 18px; line-height: 1.5; }
.label {
  font: 400 12px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg);
  padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid var(--fg);
}
.label-raw { text-transform: none; letter-spacing: 0; }

.rail {
  align-self: start; margin-top: 8px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.rail dl { display: grid; gap: 24px; }
.rail dt { font: 400 12px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }
.rail dd { margin-top: 6px; font: 400 13.5px/1.65 var(--mono); overflow-wrap: anywhere; }
.rail dd strong { font-weight: 500; }

.prose { color: var(--muted); max-width: 72ch; }
.prose > * + * { margin-top: 16px; }
.prose h2 { margin-top: 40px; font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); }
.prose h3 { margin-top: 36px; font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); }
.prose h4, .prose h5 { margin-top: 28px; font-size: 16px; font-weight: 600; color: var(--fg); }
.prose > :first-child { margin-top: 0; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose :not(pre) > code {
  font-size: 0.86em; padding: 2px 5px; border-radius: 4px; background: var(--surface-2); color: var(--fg);
  overflow-wrap: anywhere;
}
.prose pre {
  background: var(--surface-2); border-radius: 8px; padding: 14px 16px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.7; color: var(--fg);
}
.prose blockquote { padding-left: 16px; border-left: 2px solid var(--warn); }
.prose blockquote > * + * { margin-top: 12px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th { text-align: left; font: 400 12px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--dim); }
.prose th, .prose td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

.skillmd.is-collapsed {
  max-height: 420px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.more {
  display: block; margin: 12px auto 0; appearance: none; cursor: pointer;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--fg); font: 500 14px/1.4 var(--sans);
}
.more:hover { border-color: var(--accent); color: var(--accent); }

.foot { margin-top: 112px; border-top: 1px solid var(--line); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 28px; padding-bottom: 40px; font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-main { display: contents; }
  .detail-main > section:not(:first-of-type) { order: 2; }
  .rail { order: 1; margin-top: 32px; }
  .rail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
}
@media (max-width: 700px) {
  .rows { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .hero { padding-top: 48px; }
  .group { padding-top: 48px; }
  .row { padding: 18px; }
  .badge { margin-left: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .cmd-copy, .top nav a, .more { transition: color 0.12s, background-color 0.12s, border-color 0.12s; }
}
.foot-note { flex-basis: 100%; color: var(--dim); }

@media (prefers-reduced-motion: no-preference) {
  .art-blink { transform-box: fill-box; transform-origin: center; animation: art-blink 5s infinite; }
  .art-pop { transform-box: fill-box; transform-origin: center; }
  .art.in-view .art-flow { animation: art-flow 0.9s linear infinite; }
  .art.in-view .art-scan { animation: art-scan 2.8s ease-in-out infinite alternate; }
  .art.in-view .art-pulse { animation: art-pulse 1.4s ease-in-out infinite alternate; }
  .art.in-view .art-pop { animation: art-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
}
@media (prefers-reduced-motion: no-preference) {
  .art-rock, .art-bob { transform-box: fill-box; transform-origin: center; }
  .art.in-view .art-rock { animation: art-rock 2.6s ease-in-out infinite alternate; }
  .art.in-view .art-bob { animation: art-bob 1.8s ease-in-out infinite alternate; }
}
@keyframes art-rock { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes art-bob { from { transform: translate(0, 0) rotate(-1.5deg); } to { transform: translate(3px, -2px) rotate(1.5deg); } }
@keyframes art-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@keyframes art-flow { to { stroke-dashoffset: -16; } }
@keyframes art-scan { from { transform: translateY(-34px); } to { transform: translateY(14px); } }
@keyframes art-pulse { from { opacity: 1; } to { opacity: 0.35; } }
@keyframes art-pop { from { transform: scale(0); } to { transform: scale(1); } }
