/* Fun on Paper: the site shell. Playful and printable — graph paper, chunky
   sticker shapes, pinned-up printouts. Light only: the product is paper.
   Fonts: Fredoka (headings) and Atkinson Hyperlegible (body), both SIL OFL 1.1,
   self-hosted, latin subset. Licences in /assets/fonts/. */

@font-face {
  font-family: "Fredoka";
  src: url(/assets/fonts/fredoka-var.woff2) format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url(/assets/fonts/atkinson-hyperlegible-400.woff2) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url(/assets/fonts/atkinson-hyperlegible-700.woff2) format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #FFFDF7;
  --white: #FFFFFF;
  --ink: #1B1B1F;
  --ink-soft: #46464F;          /* 8.9:1 on paper */
  --grid: rgba(63, 167, 245, .11);
  --tomato: #F2604B;            /* decoration and large text only */
  --tomato-ink: #B8321E;        /* 5.6:1 on white: tomato for small text */
  --sun: #FFD23F;
  --sky: #8FD0FF;
  --mint: #7DE8BE;
  --lilac: #CDBDFF;
  --peach: #FFB59E;
  --line: 3px solid var(--ink);
  --wobble: 20px 12px 24px 10px / 12px 22px 10px 20px;
  --pop: 5px 5px 0 var(--ink);
  --display: "Fredoka", "Baloo 2", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 18px/1.6 var(--body);
  background-color: var(--paper);
  /* Graph paper, CSS only. */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
a { color: var(--ink); text-decoration-color: var(--tomato); text-decoration-thickness: 3px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; letter-spacing: .005em; }
h1 { font-size: clamp(36px, 7vw, 60px); margin: 0 0 14px; font-weight: 700; }
h2 { font-size: clamp(26px, 4.4vw, 34px); margin: 44px 0 12px; }
h3 { font-size: 21px; margin: 26px 0 6px; }
p, ul, ol { margin: 0 0 14px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.prose { max-width: 720px; }
.lead { font-size: 20px; color: var(--ink-soft); max-width: 640px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 10; border: var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* A hand-drawn underline under one word of a heading. */
.scribble {
  padding-bottom: .12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 20 2, 30 11, 48 6 S 80 2, 96 7 S 112 9, 118 4' fill='none' stroke='%23F2604B' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left bottom / 100% .32em;
}

/* ---- header: logo left, one button ---------------------------------------- */
.topbar { padding: 14px 0; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 48px; }
.logo-mark { width: 44px; height: 44px; flex: none; }
.logo-word { font: 700 25px/1 var(--display); white-space: nowrap; }
.logo-paper { position: relative; }
.logo-paper::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 6px; border-radius: 6px;
  background: var(--sun); z-index: -1; transform: rotate(-2deg);
}

/* ---- buttons: chunky stickers --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border: var(--line); border-radius: 16px 12px 18px 10px;
  background: var(--white); color: var(--ink); box-shadow: 4px 4px 0 var(--ink);
  font: 600 19px/1 var(--display); text-decoration: none; cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-sun { background: var(--sun); }
.btn-tomato { background: var(--tomato); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--ink); }
@media (max-width: 420px) {
  .topbar .btn { padding: 0 14px; font-size: 17px; }
  .logo-word { font-size: 21px; }
  .logo-mark { width: 38px; height: 38px; }
}

main { padding: 12px 0 56px; }

/* ---- home ------------------------------------------------------------------ */
.home-hero { max-width: 1000px; margin: 0 auto; padding: 28px 16px 8px; text-align: center; }
.home-hero .lead { margin: 0 auto 22px; }
.sticker {
  display: inline-block; font: 600 16px/1 var(--display); padding: 9px 14px; margin-bottom: 18px;
  background: var(--mint); border: var(--line); border-radius: 999px; transform: rotate(-3deg);
}
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px; margin: 32px 0; padding: 0; list-style: none; }
.tile {
  display: grid; grid-template-rows: auto 1fr; gap: 14px; height: 100%; padding: 20px;
  border: var(--line); border-radius: var(--wobble); box-shadow: var(--pop); background: var(--white);
  color: var(--ink); text-decoration: none; transform: rotate(var(--tilt, -1.2deg));
  transition: transform .15s;
}
.tiles li:nth-child(2n) .tile { --tilt: 1.1deg; }
.tiles li:nth-child(3n) .tile { --tilt: -.6deg; }
.tile:hover { transform: rotate(0) translateY(-3px); }
.tile-tomato { background: var(--peach); }
.tile-sun { background: var(--sun); }
.tile-sky { background: var(--sky); }
.tile-mint { background: var(--mint); }
.tile-lilac { background: var(--lilac); }
.tile b { display: block; font: 700 25px/1.15 var(--display); margin-bottom: 4px; }
.tile span { display: block; font-size: 17px; }
.tile .go { font: 600 18px/1 var(--display); margin-top: 10px; }
.mini {
  background: var(--white); border-radius: 4px; padding: 9% 9% 5%; aspect-ratio: 5 / 4; overflow: hidden;
  box-shadow: 0 2px 0 rgba(0,0,0,.15); display: grid; place-items: center;
}
.mini .card.card-5 { width: 62%; }
.mini .card.card-90 { width: 100%; }
.mini .card-foot { display: none; }
/* At thumbnail size the word "FREE" cannot fit its square: the star says it. */
.mini .cell.free span:not(.star) { display: none; }
.note-box {
  max-width: 760px; margin: 24px auto 0; padding: 20px 22px; background: var(--white);
  border: var(--line); border-radius: var(--wobble); transform: rotate(.4deg);
}
.note-box h2 { margin-top: 0; }

/* ---- content below the maker -------------------------------------------- */
.faq h3 { font-size: 20px; }
.steps { padding-left: 24px; }
.steps li { margin-bottom: 8px; }
.steps li::marker { font: 700 20px var(--display); color: var(--tomato-ink); }

.ad-slot { min-height: 100px; margin: 0 auto 32px; max-width: 728px; }
.ad-slot:empty { display: none; }

/* ---- footer: an ink band with a zigzag top edge ----------------------------- */
.bottom {
  position: relative; margin-top: 40px; padding: 48px 0 40px; background: var(--ink); color: var(--paper); font-size: 17px;
}
.bottom::before {
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 15px;
  background: linear-gradient(135deg, transparent 50%, var(--ink) 50%) 0 0 / 22px 15px repeat-x,
              linear-gradient(225deg, transparent 50%, var(--ink) 50%) 0 0 / 22px 15px repeat-x;
}
.bottom-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.bottom a { color: var(--paper); text-decoration-color: var(--sun); display: inline-flex; min-height: 48px; align-items: center; }
.bottom a:hover { color: var(--sun); }
.bottom-logo { font: 700 26px/1 var(--display); color: var(--sun); margin-bottom: 12px; }
.bottom-head { font: 600 19px/1 var(--display); color: var(--mint); margin-bottom: 6px; }
.bottom-list { list-style: none; padding: 0; margin: 0; }
@media (max-width: 760px) { .bottom-grid { grid-template-columns: 1fr 1fr; } .bottom-about { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .tile:hover { transform: rotate(var(--tilt, -1.2deg)); } }
@media print {
  .no-print, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
}
