/* Waxfinch: "Colored In". Tokens first (see ../design/printables-store.DESIGN.md), then components. */
@font-face { font-family: Fredoka; src: url(/fonts/fredoka.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Figtree; src: url(/fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --bg: #ffffff; --surface: #f1f4f9; --outline: #15161c; --hair: #d9deea;
  --ink: #15161c; --body: #3b3e4a; --muted: #5e6272;
  --accent: #ff8a1f; --on-accent: #15161c; --sheet: #ffffff;
  --error: #a8201a; --ok: #17633d;
  --r-card: 18px; --r-sheet: 12px;
  --display: Fredoka, ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --text: Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a; --surface: #1f2129; --outline: #f3f4f7; --hair: #343743;
    --ink: #f3f4f7; --body: #d5d8e0; --muted: #a3a8b8;
    --accent: #ff9a3d; --on-accent: #14151a;
    --error: #ff9b8f; --ok: #6ed39a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--body); font: 400 17px/1.6 var(--text); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 2px solid var(--outline); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.12; margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 32px; letter-spacing: -0.01em; }
h2 { font-size: 24px; margin-top: 48px; }
h3 { font-size: 20px; font-weight: 500; }
p, ul, ol, dl, table { margin: 16px 0 0; }
ul, ol { padding-left: 22px; }
li + li { margin-top: 6px; }
strong { color: var(--ink); font-weight: 600; }
small, .fine { font-size: 15px; color: var(--muted); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 20; }

/* the one colored-in word */
.col { background: var(--accent); color: var(--on-accent); padding: 0 .22em .04em; display: inline-block; transform: rotate(-1deg); border-radius: 14px 22px 16px 24px / 20px 14px 22px 16px; }

/* header */
.top { border-bottom: 2px solid var(--outline); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 12px; padding-bottom: 10px; }
.mark { display: inline-flex; align-items: center; gap: 8px; font: 600 24px/1 var(--display); color: var(--ink); text-decoration: none; margin-right: auto; min-height: 44px; }
.mark svg { width: 34px; height: 34px; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 14px; }
.top nav a { font: 500 15px/1 var(--display); text-decoration: none; padding: 15px 0; display: inline-block; }
.top nav a:hover, .top nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; }

/* buttons, tags */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 24px; border: 2px solid var(--outline); border-radius: 999px; background: var(--bg); color: var(--ink); font: 600 18px/1.1 var(--display); text-decoration: none; cursor: pointer; transition: transform .16s ease; text-align: center; }
.btn:hover { transform: translateY(-2px); }
.btn.fill { background: var(--accent); color: var(--on-accent); border-color: var(--outline); }
.btn[disabled] { cursor: not-allowed; color: var(--muted); border-style: dashed; border-color: var(--muted); transform: none; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.tag { display: inline-block; font: 500 14px/1 var(--display); border: 2px solid var(--outline); border-radius: 999px; padding: 6px 12px; color: var(--ink); background: var(--bg); }
.price { display: inline-block; font: 600 24px/1 var(--display); background: var(--accent); color: var(--on-accent); padding: 8px 14px; border: 2px solid var(--outline); border-radius: 14px 18px 14px 20px / 18px 14px 20px 14px; transform: rotate(-2deg); }
.price.off { background: var(--bg); color: var(--ink); }

/* hero */
.hero { padding: 32px 0 8px; display: grid; gap: 32px; }
.hero h1 { font-size: 36px; }
.lead { font-size: 19px; margin-top: 16px; max-width: 34em; }
.stack { display: flex; justify-content: center; align-items: flex-start; gap: 0; max-width: 360px; margin: 0 auto; width: 100%; padding: 12px 20px; }
.stack img { width: 54%; flex: none; border: 2px solid var(--outline); border-radius: var(--r-sheet); background: var(--sheet); }
.stack img:nth-child(1) { transform: rotate(-5deg); margin-top: 14px; }
.stack img:nth-child(2) { transform: rotate(4deg); margin-left: -8%; }

/* sheets (page pictures are always on white paper) */
.sheet { margin: 0; }
.sheet img { width: 100%; border: 2px solid var(--outline); border-radius: var(--r-sheet); background: var(--sheet); transition: transform .18s ease; }
.sheet:hover img { transform: translateY(-2px); }
.sheet figcaption { font: 500 15px/1.3 var(--display); color: var(--ink); margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; margin-top: 24px; }
.strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 24px; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.strip img { flex: 0 0 86%; width: 86%; scroll-snap-align: start; border: 2px solid var(--outline); border-radius: var(--r-sheet); background: var(--sheet); }

/* cards */
.cards { display: grid; gap: 20px; margin-top: 24px; }
.card { border: 2px solid var(--outline); border-radius: var(--r-card); overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.card > img { width: 100%; border-bottom: 2px solid var(--outline); }
.card .in { padding: 20px; display: flex; flex-direction: column; gap: 0; flex: 1; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.buyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 20px; }
.panel { background: var(--surface); border-radius: var(--r-card); padding: 24px 20px; margin-top: 48px; }
.panel h2 { margin-top: 0; }
.cols { display: grid; gap: 20px; margin-top: 8px; }
.cols h3 { margin-top: 16px; }
.split { display: grid; gap: 24px; align-items: center; }
.split .sheet { max-width: 260px; }

/* product */
.crumbs { font-size: 15px; color: var(--muted); padding-top: 20px; }
.crumbs a { color: var(--muted); }
.phead { display: grid; gap: 28px; padding: 16px 0 0; }
.phead .cover { border: 2px solid var(--outline); border-radius: var(--r-card); width: 100%; }
.pside { display: grid; gap: 20px; align-content: start; }
.pside .sheet { max-width: 420px; margin: 0 auto; width: 100%; }
.free { background: var(--surface); border-radius: var(--r-card); padding: 20px; }
.free h2 { margin: 0; font-size: 24px; }
.contact { margin: 24px 0 0; }
.contact img { border: 2px solid var(--outline); border-radius: var(--r-sheet); background: var(--sheet); width: 100%; max-width: 660px; }
.contact figcaption { font: 500 15px/1.3 var(--display); color: var(--ink); margin-top: 8px; }
.inside { display: grid; gap: 20px; margin-top: 24px; align-items: center; }
.inside .contact { margin: 0; }
.frees { display: grid; gap: 20px; margin-top: 24px; }
.freecard { border: 2px solid var(--outline); border-radius: var(--r-card); padding: 20px; display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; }
.freecard h3 { margin: 0; }
/* inline links: a 44 px tall touch area without changing the line layout */
main p a, main li a, main dd a, main h3 a, .crumbs a, footer .by a { padding-block: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; border-top: 2px solid var(--outline); padding-top: 16px; margin-top: 24px; }
.facts dt { font: 500 15px/1.5 var(--display); color: var(--ink); }
.facts dd { margin: 0; font-size: 16px; }
.pagelist { columns: 2; column-gap: 24px; padding-left: 22px; }
.pagelist li { break-inside: avoid; }
.maynot { display: grid; gap: 16px; margin-top: 8px; }
.maynot > div { border: 2px solid var(--outline); border-radius: var(--r-card); padding: 4px 20px 20px; }
details { border-bottom: 2px solid var(--hair); }
details:first-of-type { margin-top: 16px; border-top: 2px solid var(--hair); }
summary { font: 500 18px/1.3 var(--display); color: var(--ink); cursor: pointer; padding: 12px 0; min-height: 48px; }
details p { margin: 0 0 16px; }
.tablewrap { overflow-x: auto; margin-top: 16px; border: 2px solid var(--outline); border-radius: var(--r-sheet); }
table { border-collapse: collapse; width: 100%; margin: 0; font-size: 16px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hair); vertical-align: top; }
th { font: 500 15px/1.3 var(--display); color: var(--ink); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--bg); border-top: 2px solid var(--outline); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.buybar .btn { min-height: 44px; padding: 8px 18px; font-size: 16px; }
.buybar span { font: 500 15px/1.2 var(--display); color: var(--ink); }
body.has-bar { padding-bottom: 76px; }

/* thanks */
.status { border: 2px solid var(--outline); border-radius: var(--r-card); padding: 24px 20px; margin-top: 24px; }
.status h2 { margin-top: 0; display: flex; gap: 10px; align-items: center; }
.status svg { width: 28px; height: 28px; flex: none; }
.status.bad { border-color: var(--error); }
[hidden] { display: none !important; }

/* footer */
footer { margin-top: 72px; border-top: 2px solid var(--outline); padding: 28px 0 40px; font-size: 15px; }
footer .fcols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
footer h2 { font-size: 15px; margin: 0 0 8px; font-weight: 500; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li + li { margin-top: 0; }
footer li a { display: inline-block; padding: 11px 0; }
footer .by { margin-top: 28px; color: var(--muted); }

@media (min-width: 720px) {
  body { font-size: 18px; }
  .wrap { padding: 0 32px; }
  h1 { font-size: 44px; }
  h2 { font-size: 32px; margin-top: 72px; }
  .hero { grid-template-columns: 1.15fr .85fr; align-items: center; padding: 64px 0 24px; }
  .hero h1 { font-size: 52px; }
  .top nav { gap: 0 22px; }
  .top nav a { font-size: 16px; }
  .stack { max-width: 460px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 28px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
  .strip img { flex-basis: 46%; width: 46%; }
  .cols { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .cols.two { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 260px 1fr; gap: 40px; }
  .phead { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; padding-top: 24px; }
  .inside { grid-template-columns: 1fr 1fr; gap: 40px; }
  .frees { grid-template-columns: 1fr 1fr; gap: 28px; }
  .freecard { grid-template-columns: 150px 1fr; gap: 24px; padding: 28px; }
  .maynot { grid-template-columns: 1fr 1fr; }
  .panel { padding: 40px; }
  .buybar { display: none; }
  body.has-bar { padding-bottom: 0; }
  footer .fcols { grid-template-columns: repeat(4, 1fr); }
  .pagelist { columns: 3; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .sheet img { transition: none; }
  .btn:hover, .sheet:hover img { transform: none; }
}
@media print { .top nav, .buybar, footer { display: none; } }
