/* Comic MD: the site is a printed comic page. Newsprint paper, thick ink frames,
   hard offset shadows, caption boxes for headings and a speech balloon or two.
   Keep the focus ring, the skip link and the 3-width check. */
:root {
  --paper: #fff4d6;
  --paper-2: #ffe9b0;
  --ink: #16111a;
  --pink: #ff3b6b;
  --yellow: #ffd62e;
  --cyan: #1fb6e0;
  --muted: #4a4254;
  --display: "Bowlby One", "Arial Black", Impact, sans-serif;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --type: "Special Elite", "Courier New", ui-monospace, monospace;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
  --edge: 3px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 18px/1.6 var(--text);
  background-color: var(--paper);
  background-image: radial-gradient(circle at center, rgba(255, 59, 107, .16) 1.1px, transparent 1.5px);
  background-size: 9px 9px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: .18em; text-decoration-thickness: 2px; text-decoration-color: var(--pink); }
a:hover { background: var(--yellow); }
:focus-visible { outline: 4px solid var(--cyan); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 400; line-height: 1.08; }
h2 { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.1; }
h3 { font-size: 19px; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
code, pre { font-family: var(--mono); font-size: .88em; }
@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: -64px; background: var(--ink); color: var(--yellow); padding: 10px 16px; z-index: 10; font-weight: 700; }
.skip:focus { top: 12px; }

/* Header */
.top { background: var(--yellow); border-bottom: var(--edge) solid var(--ink); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 68px; flex-wrap: wrap; padding-block: 8px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 22px; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.wordmark:hover { background: none; }
.wm-balloon { position: relative; width: 34px; height: 26px; background: #fff; border: 3px solid var(--ink); border-radius: 50%; flex: none; }
.wm-balloon::after { content: ""; position: absolute; left: 6px; bottom: -9px; width: 9px; height: 9px; background: #fff; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: skewX(-30deg) rotate(0deg); }
.nav { display: flex; gap: 6px 20px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; padding: 4px 2px; }
.nav a:hover { background: var(--ink); color: var(--yellow); }

/* Section titles are caption boxes */
section { padding: clamp(52px, 7vw, 88px) 0; }
.cap { display: inline-block; background: var(--yellow); border: var(--edge) solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: .28em .7em .2em; transform: rotate(-1.2deg); }
.band { background: var(--paper-2); border-block: var(--edge) solid var(--ink); }
.section-lede { margin-top: 22px; max-width: 62ch; color: var(--muted); }

/* Hero */
.hero { padding-top: clamp(36px, 6vw, 72px); overflow-x: clip; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: center; }
.tag { display: inline-block; background: var(--ink); color: var(--yellow); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; transform: rotate(-1.5deg); }
.hero h1 { font-size: clamp(30px, 4.6vw, 54px); margin-top: 20px; letter-spacing: -.005em; text-shadow: 3px 3px 0 var(--yellow); }
.lede { font-size: 20px; margin-top: 22px; max-width: 50ch; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.btn { display: inline-block; background: var(--pink); color: var(--ink); text-decoration: none; padding: 12px 22px; font-weight: 700; font-size: 17px; border: var(--edge) solid var(--ink); box-shadow: 5px 5px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.btn:hover { background: var(--pink); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.btn-quiet { background: #fff; }
.btn-quiet:hover { background: #fff; }
.one-liner { margin-top: 26px; }
.one-liner code { display: inline-block; max-width: 100%; background: var(--ink); color: var(--yellow); padding: 9px 14px; overflow-wrap: anywhere; box-shadow: 4px 4px 0 var(--pink); }

.hero-art { position: relative; aspect-ratio: 1 / 1.04; }
.sheet { position: absolute; display: block; background: #fff; border: var(--edge) solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.sheet img { width: 100%; height: auto; }
.sheet-a { left: 0; top: 4%; width: 52%; transform: rotate(-5deg); }
.sheet-b { right: 0; top: 0; width: 58%; transform: rotate(3.5deg); }
.sheet-c { left: 8%; bottom: 0; width: 80%; transform: rotate(-1.5deg); }
.sheet:hover { z-index: 3; background: #fff; }
.burst {
  position: absolute; right: 2%; bottom: 7%; z-index: 4; width: 118px; height: 118px; display: grid; place-items: center; text-align: center;
  font-family: var(--display); font-size: 20px; line-height: 1; color: var(--ink); background: var(--yellow); transform: rotate(10deg); padding: 0 14px;
  clip-path: polygon(50% 0, 61% 14%, 79% 6%, 80% 25%, 98% 28%, 88% 45%, 100% 59%, 83% 68%, 87% 88%, 68% 85%, 58% 100%, 46% 87%, 28% 97%, 24% 78%, 5% 79%, 13% 60%, 0 47%, 17% 38%, 12% 19%, 32% 22%);
}

/* The pitch */
.pitch { background: var(--ink); color: var(--paper); padding: clamp(36px, 5vw, 56px) 0; border-block: var(--edge) solid var(--ink); }
.pitch-text { font-family: var(--display); font-size: clamp(24px, 4.2vw, 46px); line-height: 1.12; max-width: 24ch; text-wrap: balance; }
.pitch-text::first-line { color: var(--yellow); }

/* How it works */
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 40px; align-items: start; }
.script-box { position: relative; }
.script-label { display: inline-block; font-family: var(--type); background: var(--cyan); border: var(--edge) solid var(--ink); border-bottom: 0; padding: 3px 12px; font-size: 15px; }
.script { margin: 0; background: #fffdf4; border: var(--edge) solid var(--ink); box-shadow: 7px 7px 0 var(--ink); padding: 20px 22px; overflow-x: auto; font-family: var(--type); font-size: 15px; line-height: 1.55; white-space: pre; }
.script code { font-family: inherit; font-size: inherit; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 22px; }
.steps li { counter-increment: step; position: relative; background: #fff; border: var(--edge) solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 16px 20px 16px 74px; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 42px; height: 42px; display: grid; place-items: center; font-family: var(--display); font-size: 22px; background: var(--pink); border: var(--edge) solid var(--ink); border-radius: 50%; }
.steps p { margin-top: 4px; font-size: 16.5px; color: var(--muted); }
.steps code { background: var(--paper-2); padding: 1px 5px; }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin-top: 40px; align-items: start; }
.themes figure { margin: 0; }
.themes img { border: var(--edge) solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: #fff; transition: transform .15s; }
.themes a:hover { background: none; }
.themes a:hover img { transform: translateY(-4px) rotate(-1deg); }
.themes figcaption { margin-top: 18px; font-size: 15px; line-height: 1.4; color: var(--muted); }
.themes figcaption b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--ink); margin-bottom: 3px; }

/* Facts */
.facts { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.facts li { background: #fff; border: var(--edge) solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 18px 20px; font-size: 16.5px; color: var(--muted); }
.facts li:nth-child(3n+1) { border-top-color: var(--pink); border-top-width: 9px; }
.facts li:nth-child(3n+2) { border-top-color: var(--cyan); border-top-width: 9px; }
.facts li:nth-child(3n) { border-top-color: var(--yellow); border-top-width: 9px; }
.facts b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }
.facts code { background: var(--paper-2); padding: 1px 5px; }

/* Examples */
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 26px; margin-top: 40px; }
.examples article { display: flex; flex-direction: column; gap: 10px; }
.examples img { border: var(--edge) solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: #fff; margin-bottom: 8px; }
.examples a:hover { background: none; }
.examples p { color: var(--muted); font-size: 16px; }

/* Install */
.install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 36px; }
.install pre { margin: 12px 0 0; background: var(--ink); color: var(--yellow); padding: 16px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; border: var(--edge) solid var(--ink); box-shadow: 6px 6px 0 var(--pink); }
.note { color: var(--muted); margin-top: 26px; font-size: 16px; }

/* Footer */
.foot { background: var(--ink); color: var(--paper); padding: 40px 0 56px; font-size: 16px; }
.foot a { color: var(--yellow); text-decoration-color: var(--pink); }
.foot a:hover { background: var(--yellow); color: var(--ink); }
.foot-row { display: grid; gap: 10px; }
.foot .wordmark { color: var(--paper); }
.foot .wm-balloon { background: var(--paper); border-color: var(--paper); }
.foot .wm-balloon::after { background: var(--paper); border-color: var(--paper); }

/* 404 */
.lost { min-height: 62vh; display: flex; align-items: center; padding: 0; }
.lost h1 { font-size: clamp(34px, 5vw, 56px); margin-top: 18px; }
.sfx-404 { font-family: var(--display); font-size: clamp(80px, 18vw, 170px); line-height: .9; color: var(--pink); text-shadow: 4px 4px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); transform: rotate(-4deg); display: inline-block; }

@media (max-width: 980px) {
  .themes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid, .how-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero-art { max-width: 520px; width: 100%; margin: 0 auto; }
  .install { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .nav { gap: 4px 12px; }
  .nav a { font-size: 15px; }
  .themes, .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .themes figcaption { font-size: 14px; }
  .burst { width: 92px; height: 92px; font-size: 16px; }
  .steps li { padding-left: 66px; }
  .sheet { box-shadow: 5px 5px 0 var(--ink); }
}
