/* Cheatsheet site: graph paper, ink, a highlighter and hard-edged cards.
   Fonts load from Google Fonts; the stacks fall back to system fonts offline. */
:root {
  --paper: #f3f7f4;
  --grid: #d9e4de;
  --ink: #0f1b17;
  --muted: #475a52;
  --hi: #f7e03c;
  --pen: #d9372b;
  --card: #ffffff;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --text: "Instrument Sans", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 18px/1.55 var(--text); background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: .2em; text-decoration-thickness: 2px; text-decoration-color: var(--pen); }
a:hover { background: var(--hi); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: .98; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(34px, 4.6vw, 54px); }
h3 { font-size: 22px; letter-spacing: -.02em; line-height: 1.1; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: 12px; top: -56px; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 20; }
.skip:focus { top: 12px; }
.tag { font: 500 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.tag b { background: var(--ink); color: var(--hi); padding: 5px 7px; font-weight: 600; letter-spacing: .04em; }
.mark { background: linear-gradient(transparent 56%, var(--hi) 56%, var(--hi) 90%, transparent 90%); padding: 0 .06em; margin: 0 -.06em; }

/* Header */
.top { border-bottom: 2px solid var(--ink); background: var(--paper); position: relative; z-index: 5; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 68px; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font: 600 17px/1 var(--mono); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.wordmark:hover { background: none; }
.wordmark .cap { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--hi); border-radius: 8px; font-size: 15px; box-shadow: 0 3px 0 #3b4a43; }
.nav { display: flex; gap: 6px 22px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { font: 500 14px/1 var(--mono); text-decoration: none; padding: 8px 4px; display: inline-block; }
.nav a:hover { background: var(--hi); }

/* Buttons */
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.btn { display: inline-block; font: 600 16px/1 var(--text); padding: 16px 22px; background: var(--ink); color: var(--paper); text-decoration: none; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 5px 5px 0 var(--hi); transition: transform .12s, box-shadow .12s; }
.btn:hover { background: var(--ink); color: var(--paper); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--hi); }
.btn-quiet { background: var(--card); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.btn-quiet:hover { background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }

/* Hero */
.hero { padding: 64px 0 72px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(44px, 6.2vw, 84px); margin: 22px 0 24px; }
.lede { font-size: 20px; color: var(--muted); max-width: 33em; }
.one-liner { margin-top: 26px; font: 500 14px/1.5 var(--mono); }
.one-liner code { background: var(--ink); color: var(--paper); padding: 9px 12px; border-radius: 8px; display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.fan { position: relative; aspect-ratio: 1.1 / 1; }
.fan a { position: absolute; display: block; background: var(--card); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 8px 10px 0 rgba(15, 27, 23, .9); overflow: hidden; transition: transform .2s; }
.fan a:hover { background: var(--card); }
.fan img { width: 100%; }
.fan .f-git { width: 80%; left: 20%; top: 0; transform: rotate(3deg); z-index: 1; }
.fan .f-editor { width: 47%; left: 0; top: 14%; transform: rotate(-4deg); z-index: 2; }
.fan .f-card { width: 25%; right: 1%; bottom: 0; transform: rotate(6deg); z-index: 3; }
.fan a:hover { transform: rotate(0) translateY(-6px); z-index: 4; }
.note-pen { position: absolute; z-index: 5; font: 500 13px/1.25 var(--mono); background: var(--hi); border: 2px solid var(--ink); padding: 8px 10px; border-radius: 6px; box-shadow: 3px 3px 0 var(--ink); }
.note-pen.n1 { left: 30%; top: 2%; transform: rotate(-3deg); }
.note-pen.n2 { right: 30%; bottom: 3%; transform: rotate(2deg); }

/* Sections */
section { padding: 76px 0; }
.band { background: var(--ink); color: var(--paper); background-image: none; }
.band .tag { color: #a9bcb3; }
.band .tag b { background: var(--hi); color: var(--ink); }
.band a { color: var(--paper); }
.head { display: grid; gap: 18px; margin-bottom: 40px; }
.section-lede { color: var(--muted); max-width: 38em; font-size: 19px; }
.band .section-lede { color: #b7c8c0; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.facts li { background: #16271f; border: 2px solid #34493f; border-radius: 12px; padding: 22px; color: #c9d8d1; }
.facts b { display: block; font: 800 24px/1.05 var(--display); letter-spacing: -.02em; color: var(--paper); margin-bottom: 10px; }
.caps { display: inline-flex; gap: 4px; vertical-align: .1em; margin-inline: 2px; }
.cap { display: inline-block; min-width: 1.7em; padding: .12em .5em; text-align: center; font: 600 .8em/1.3 var(--mono); border: 1.5px solid var(--ink); border-bottom-width: 4px; border-radius: 6px; background: var(--card); color: var(--ink); }
.band .cap { background: #243a30; color: var(--paper); border-color: #6e8a7d; }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: step; }
.steps > li { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 7px 7px 0 var(--ink); padding: 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; counter-increment: step; }
.steps > li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; background: var(--hi); border: 2px solid var(--ink); border-radius: 10px; font: 800 22px/1 var(--display); }
.steps p { color: var(--muted); }
.steps blockquote { margin: 0; font: 600 19px/1.35 var(--display); letter-spacing: -.01em; padding-inline-start: 14px; border-inline-start: 4px solid var(--hi); color: var(--ink); }
pre { margin: 0; background: var(--ink); color: #e5efe9; border-radius: 10px; padding: 16px 18px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
pre .k { color: var(--hi); }
pre .s { color: #9fe7c0; }
.steps pre { font-size: 12.5px; padding: 14px; }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
.themes figure { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.themes a { display: block; background: var(--card); border: 2px solid #6e8a7d; border-radius: 8px; overflow: hidden; box-shadow: 6px 6px 0 var(--hi); transition: transform .15s; }
.themes a:hover { transform: translateY(-5px); background: var(--card); }
.themes figcaption { font-size: 15px; color: #b7c8c0; line-height: 1.4; }
.themes figcaption b { display: block; font: 700 17px/1.2 var(--mono); color: var(--hi); margin-bottom: 4px; }

/* Papers */
.papers { display: flex; flex-wrap: wrap; gap: 14px 40px; align-items: flex-end; margin-top: 10px; }
.paper { display: flex; flex-direction: column; gap: 10px; font: 500 14px/1.3 var(--mono); }
.paper i { display: block; border: 2px solid var(--ink); background: var(--card); border-radius: 3px; box-shadow: 4px 4px 0 var(--hi); }
.paper .a4p { width: 66px; height: 93px; }
.paper .a4l { width: 93px; height: 66px; }
.paper .lt { width: 69px; height: 89px; }
.paper .pk { width: 43px; height: 64px; }
.paper span { color: var(--muted); }

/* Examples */
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.ex { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 7px 7px 0 var(--ink); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.band .ex, .band .ex a { color: var(--ink); }
.band .ex p, .band .ex .meta { color: var(--muted); }
.band .ex a:hover { color: var(--ink); }
.ex .shot { display: grid; place-items: center; background: var(--grid); padding: 22px; height: 260px; border-bottom: 2px solid var(--ink); }
.ex .shot a { display: block; }
.ex .shot a:hover { background: none; }
.ex .shot img { height: 214px; width: auto; max-width: 100%; object-fit: contain; border: 1.5px solid var(--ink); box-shadow: 4px 5px 0 rgba(15, 27, 23, .85); }
.ex .body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ex .meta { font: 500 12.5px/1.4 var(--mono); color: var(--muted); letter-spacing: .02em; }
.ex p { color: var(--muted); font-size: 16px; }
.ex .go { margin-top: auto; padding-top: 8px; font: 600 15px/1 var(--mono); }

/* Install */
.install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.install > div { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 7px 7px 0 var(--ink); padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.install h3 { font-size: 21px; }
.note { margin-top: 26px; font: 500 14px/1.5 var(--mono); color: var(--muted); }

/* Footer */
.foot { background: var(--ink); color: #c4d4cc; padding: 44px 0 52px; font-size: 16px; }
.foot a { color: var(--paper); text-decoration-color: var(--hi); }
.foot a:hover { color: var(--ink); }
.foot-row { display: grid; gap: 14px; }
.foot .wordmark { color: var(--paper); }
.foot .more { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.foot .more b { font: 600 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--hi); }

/* 404 */
.lost { padding: 110px 0 140px; }
.lost h1 { font-size: clamp(44px, 7vw, 92px); margin: 22px 0 18px; }

@media (max-width: 1060px) {
  .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .fan { max-width: 640px; margin: 0 auto; width: 100%; }
  .steps, .install { grid-template-columns: minmax(0, 1fr); }
  section { padding: 60px 0; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 40px 0 56px; }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .examples { grid-template-columns: minmax(0, 1fr); }
  .note-pen { display: none; }
  .btn { padding: 15px 18px; }
}
