:root {
  --paper: #f7f9fc;
  --grid: #dde8f5;
  --margin: #f1a4a4;
  --ink: #1c1e24;
  --ballpoint: #2a49b8;
  --red: #e5383b;
  --highlight: #ffe14d;
  --teal: #0b8a74;
  --teal-dark: #076656;
  --wobbly: 18px 6px 22px 8px / 8px 20px 6px 18px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font: 400 1.125rem/1.55 "Shantell Sans", "Comic Sans MS", cursive;
  font-variation-settings: "INFM" 10, "BNCE" 0;
  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;
}

/* Notebook margin line. */
body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 56px;
  border-left: 2px solid var(--margin);
  pointer-events: none;
}

a { color: inherit; }

:focus-visible { outline: 3px solid var(--ballpoint); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1120px, 100% - 2 * 96px); margin-inline: auto; }

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; font-variation-settings: "INFM" 100, "BNCE" 45; }
h1 { font-size: clamp(3rem, 6.4vw, 5.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2.25rem, 4vw, 3rem); }
h3 { font-size: 1.3125rem; font-variation-settings: "INFM" 70, "BNCE" 20; }

p { margin: 0; }

/* Handwritten margin notes in ballpoint. */
.note {
  color: var(--ballpoint);
  font-weight: 500;
  font-variation-settings: "INFM" 100, "BNCE" 35;
}

/* Hand-drawn outline for any box. */
.sketch { position: relative; }
.sketch::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobbly);
  filter: url(#wobble);
  pointer-events: none;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 2.5px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-variation-settings: "INFM" 70, "BNCE" 20;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 5px 0 var(--ink);
}
.btn:hover { background: var(--highlight); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn--go { background: var(--teal); color: #fff; }
.btn--go:hover { background: var(--teal-dark); }

kbd {
  display: inline-block;
  min-width: 2em;
  padding: 0.05em 0.5em;
  border: 2px solid var(--ink);
  border-radius: 8px 5px 9px 6px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

/* ---------- Nav ---------- */
.nav { display: flex; align-items: center; gap: 2rem; padding-block: 1.5rem; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-size: 1.5rem; font-weight: 800; text-decoration: none; font-variation-settings: "INFM" 100, "BNCE" 45; }
.logo img { width: 40px; height: 40px; transform: rotate(-6deg); }
.nav__links { display: flex; gap: 1.5rem; margin-left: auto; align-items: center; }
.nav__links a:not(.btn) { text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 3.5rem;
  align-items: center;
  padding-block: 3rem;
}
.hero__lede { max-width: 30rem; margin-top: 1.5rem; font-size: 1.3125rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero__try { position: relative; }
.hero__nudge { position: absolute; top: calc(100% + 0.5rem); left: 40%; display: flex; align-items: flex-start; gap: 0.25rem; white-space: nowrap; }
.hero__nudge svg { width: 54px; flex: none; }
.hero__shortcut { margin-top: 5rem; font-size: 1rem; }

/* Browser window illustration. */
.mock { margin: 0; transform: rotate(1.2deg); }
.mock__frame { background: #fff; border-radius: var(--wobbly); box-shadow: 8px 10px 0 var(--ink); }
.mock__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 2.5px solid var(--ink);
}
.mock__bar i { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; }
.mock__url {
  flex: 1;
  margin-left: 0.5rem;
  padding: 0.15rem 0.8rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.875rem;
  color: #555;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock__ext { width: 28px; height: 28px; border-radius: 7px; outline: 2.5px dashed var(--red); outline-offset: 3px; }
.tape {
  position: absolute;
  width: 110px;
  height: 30px;
  background: rgb(255 225 77 / 0.65);
  z-index: 2;
}
.tape--l { top: -14px; left: -30px; transform: rotate(-24deg); }
.tape--r { top: -12px; right: -26px; transform: rotate(18deg); }

/* Everything in the page area is laid out on a 600 × 400 grid, scaled with the container. */
.stage { position: relative; aspect-ratio: 3 / 2; container-type: inline-size; overflow: hidden; border-radius: 0 0 18px 18px; }
.stage svg.layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.article { position: absolute; left: 15%; top: 8.5%; width: 62%; font-family: Georgia, serif; color: #333; }
.article h4 { margin: 0; font: 700 5cqw/6cqw Georgia, serif; color: #222; }
.article .meta { margin-top: 0.67cqw; font-size: 2.17cqw; line-height: 2.67cqw; }
.article .sub { margin-top: 3cqw; font: 700 2.67cqw/3.33cqw Georgia, serif; }
.article ul { margin: 1cqw 0 0; padding: 0; list-style: none; font-size: 2.33cqw; line-height: 4.67cqw; }
.bars { display: grid; gap: 1.5cqw; margin-top: 2.33cqw; }
.bars i { height: 1.17cqw; border-radius: 1cqw; background: #e4e6ea; }
.bars i:nth-child(2) { width: 92%; }
.bars i:nth-child(3) { width: 64%; }

.dock {
  position: absolute;
  left: 2.5%;
  top: 9%;
  display: flex;
  flex-direction: column;
  gap: 1.1cqw;
  padding: 1.2cqw;
  border-radius: 2.3cqw;
  background: #1c2321;
  box-shadow: 0 1cqw 3cqw rgb(0 0 0 / 0.25);
}
.dock svg { width: 3.1cqw; height: 3.1cqw; padding: 0.5cqw; box-sizing: content-box; border-radius: 1cqw; fill: none; stroke: #cfdad6; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock svg.on { background: var(--teal); stroke: #fff; }
.dock hr { width: 60%; margin: 0.4cqw auto; border: 0; border-top: 1px solid rgb(255 255 255 / 0.15); }

/* The one orchestrated moment: annotations draw themselves on load. */
.ink { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw var(--t, 0.6s) ease-out var(--d, 0s) forwards; }
.write { clip-path: inset(0 100% 0 0); animation: write 0.7s steps(14) var(--d, 0s) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes write { to { clip-path: inset(0 0 0 0); } }

/* ---------- Features ---------- */
.section { padding-block: 5rem; }
.section__intro { max-width: 34rem; margin-top: 1rem; font-size: 1.3125rem; }
.notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2.5rem;
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
}
.sticky {
  position: relative;
  padding: 2.25rem 1.5rem 1.75rem;
  background: var(--bg);
  box-shadow: 2px 3px 0 rgb(0 0 0 / 0.08), 6px 14px 18px -10px rgb(0 0 0 / 0.25);
  transform: rotate(var(--r));
}
.sticky::after {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 84px;
  height: 26px;
  margin-left: -42px;
  background: rgb(255 255 255 / 0.55);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.04);
  transform: rotate(calc(var(--r) * -2));
}
.sticky svg { width: 56px; height: 56px; margin-bottom: 0.75rem; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; filter: url(#wobble); }
.sticky p { margin-top: 0.5rem; }
.notes li:nth-child(1) { --bg: #fff1a6; --r: -1.6deg; }
.notes li:nth-child(2) { --bg: #ffd6e0; --r: 1.2deg; }
.notes li:nth-child(3) { --bg: #c9f2e3; --r: -0.6deg; }
.notes li:nth-child(4) { --bg: #d6e6ff; --r: 0.9deg; }
.notes li:nth-child(5) { --bg: #ffe0b8; --r: -1.3deg; }
.notes li:nth-child(6) { --bg: #fff1a6; --r: 1.6deg; }
.uses { margin: 3.5rem 0 0 auto; max-width: 26rem; transform: rotate(-2deg); font-size: 1.25rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin: 3.5rem 0 0; padding: 0; list-style: none; }
.step { position: relative; }
.step__num { position: relative; display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 1rem; font-size: 1.75rem; font-weight: 800; font-variation-settings: "INFM" 100, "BNCE" 45; }
.step__num svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; }
.step p { margin-top: 0.5rem; max-width: 18rem; }
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  left: 84px;
  right: -1.5rem;
  border-top: 3px dashed var(--ink);
  opacity: 0.35;
}

/* ---------- FAQ ---------- */
.faq { max-width: 46rem; margin-top: 2.5rem; }
.faq details { padding: 1.1rem 0; border-bottom: 2px solid var(--ink); }
.faq summary { cursor: pointer; font-size: 1.3125rem; font-weight: 700; font-variation-settings: "INFM" 70, "BNCE" 20; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; display: inline-block; width: 1.5rem; color: var(--teal); font-weight: 800; }
.faq details[open] summary::before { content: "\2212"; }
.faq details p { margin: 0.6rem 0 0 1.5rem; max-width: 40rem; }

/* ---------- Leaderboard ---------- */
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.board__tabs { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.board__tabs button { padding: 0.35rem 1rem; border: 2px solid var(--ink); border-radius: var(--wobbly); background: #fff; color: var(--ink); font: inherit; font-size: 1rem; cursor: pointer; }
.board__tabs button:hover { background: var(--highlight); }
.board__tabs button[aria-selected="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.board__sheet { min-height: 12rem; padding: 2rem 2.25rem; background: #fff; border-radius: var(--wobbly); box-shadow: 8px 10px 0 var(--ink); transform: rotate(0.8deg); }
.board__list { margin: 0; padding-left: 2.2rem; }
.board__list li { padding: 0.45rem 0; border-bottom: 2px dashed var(--grid); }
.board__list li::marker { color: var(--teal); font-weight: 800; }
.board__list li span { display: inline-block; max-width: calc(100% - 6rem); vertical-align: top; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__list li b { float: right; font-variant-numeric: tabular-nums; }
/* Today's leader gets the highlighter. */
.board__list li:first-child span { font-weight: 700; background: linear-gradient(transparent 55%, var(--highlight) 55%); }
.board__empty { padding-block: 2rem; font-size: 1.25rem; }

/* ---------- Install ---------- */
.install { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; padding: 3rem; margin-block: 2rem 5rem; background: #fff; border-radius: var(--wobbly); box-shadow: 8px 10px 0 var(--ink); }
.install ol { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.6rem; }
.install code { padding: 0.05em 0.35em; background: var(--highlight); border-radius: 4px; font: inherit; font-weight: 700; }
.install .btn { margin-top: 1.75rem; }
.install__badge { display: inline-block; margin-top: 1.5rem; border-radius: 6px; }
.install__badge img { display: block; width: 248px; height: auto; }

.footer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.5rem; padding-block: 2rem 3rem; font-size: 1rem; }
.footer__tm { flex-basis: 100%; font-size: 0.875rem; color: #555; }

/* ---------- Text pages (privacy policy) ---------- */
.doc { max-width: 46rem; margin-block: 2rem 4rem; padding: 3rem; background: #fff; border-radius: var(--wobbly); box-shadow: 8px 10px 0 var(--ink); }
.doc h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
.doc h2 { margin-top: 2.25rem; font-size: 1.625rem; }
.doc > p, .doc ul { margin-top: 0.75rem; }
.doc ul { display: grid; gap: 0.4rem; padding-left: 1.4rem; }
.doc code { padding: 0.05em 0.35em; background: var(--highlight); border-radius: 4px; font: inherit; font-weight: 700; }

/* ---------- Draw on this page ---------- */
.scribble { position: fixed; inset: 0; z-index: 50; display: none; touch-action: none; cursor: crosshair; mix-blend-mode: multiply; }
.drawing .scribble { display: block; }
.pad {
  position: fixed;
  left: 16px;
  top: 50%;
  z-index: 51;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 14px;
  background: #1c2321;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
  transform: translateY(-50%);
}
.drawing .pad { display: flex; }
.pad button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #cfdad6; cursor: pointer; }
.pad button:hover { background: rgb(255 255 255 / 0.08); }
.pad button[aria-pressed="true"] { background: var(--teal); }
.pad button span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; background: var(--c); }
.pad svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pad hr { width: 22px; margin: 2px auto; border: 0; border-top: 1px solid rgb(255 255 255 / 0.15); }
.pad__hint {
  position: fixed;
  bottom: 16px;
  left: 50%;
  z-index: 51;
  display: none;
  padding: 0.4rem 1rem;
  background: #fff1a6;
  font-size: 1rem;
  box-shadow: 3px 4px 0 var(--ink);
  border: 2px solid var(--ink);
  transform: translateX(-50%) rotate(-1deg);
}
.drawing .pad__hint { display: block; }

@media (max-width: 900px) {
  .wrap { width: min(100% - 2.5rem, 640px); }
  body::before { display: none; }
  .nav__links { display: none; } /* the hero has the same button */
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; }
  .hero__nudge { position: static; margin: 0.75rem 0 0 4rem; }
  .hero__shortcut { margin-top: 1.5rem; }
  .tape--l { left: -10px; }
  .tape--r { right: 2px; }
  .notes, .steps, .install, .board { grid-template-columns: 1fr; }
  .board__sheet { padding: 1.5rem; }
  .notes { max-width: 26rem; }
  .step:not(:last-child)::after { display: none; }
  .install, .doc { padding: 2rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ink, .write { animation: none; stroke-dashoffset: 0; clip-path: none; }
}
