/* Cozy Coloring Pages: warm paper, crayon colours, chunky sticker shapes. */
:root {
  --paper: #fbf5ea; --paper-2: #f3e9d8; --card: #fffdf8; --ink: #2a2320; --ink-2: #5d524b; --muted: #8a7f76;
  --tomato: #f05a3c; --tomato-d: #c63f24; --sunny: #ffc93c; --sunny-l: #fff1c9; --sky: #5ab4e5; --sky-l: #dcf0fb;
  --leaf: #6cc070; --leaf-l: #e2f3df; --plum: #9b6bd1; --plum-l: #eee3fa; --pumpkin: #f08a24;
  --r: 20px; --line: 2px solid var(--ink); --pop: 4px 4px 0 var(--ink);
  --display: "Grandstander", "Comic Sans MS", system-ui, sans-serif; --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 500 17px/1.6 var(--body); background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.08; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.small { font-size: .85rem; color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

/* highlighted words with a crayon squiggle under them */
.hl { position: relative; display: inline-block; isolation: isolate; --hl: var(--tomato); }
.hl.halloween { --hl: var(--pumpkin); } .hl.christmas { --hl: var(--leaf); }
.squiggle { position: absolute; left: -2%; bottom: -.16em; width: 104%; height: .32em; color: var(--hl); z-index: -1; }

/* stickers and buttons */
.sticker { display: inline-block; font: 800 .85rem/1 var(--display); letter-spacing: .02em; padding: .5em .9em .45em; border: var(--line); border-radius: 999px; transform: rotate(-2deg); background: var(--card); box-shadow: 2px 2px 0 var(--ink); margin-bottom: 14px; }
.sticker.sunny { background: var(--sunny); } .sticker.sky { background: #fff; } .sticker.leaf { background: var(--leaf-l); }
.sticker.tomato { background: var(--tomato); color: #fff; } .sticker.plum { background: var(--plum-l); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 800 1rem/1.1 var(--body); text-decoration: none; cursor: pointer;
  padding: 13px 20px; border: var(--line); border-radius: 14px; background: var(--tomato); color: #fff; box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.alt { background: var(--sunny); color: var(--ink); } .btn.ghost { background: var(--card); color: var(--ink); }
.btn.big { font-size: 1.1rem; padding: 16px 26px; border-radius: 16px; }
.btn .i { width: 20px; height: 20px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(251, 245, 234, .94); backdrop-filter: blur(8px); border-bottom: var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.3rem/1 var(--display); white-space: nowrap; }
.logo .mark { width: 40px; height: 40px; flex: none; transition: transform .3s; }
.logo:hover .mark { transform: rotate(-14deg); }
.logo b { color: var(--tomato); font-weight: 900; }
.nav { margin-left: auto; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; font-weight: 800; padding: 8px 14px; border-radius: 999px; border: 2px solid transparent; }
.nav a:hover { border-color: var(--ink); background: var(--card); }
.nav a.halloween::before, .nav a.christmas::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; background: var(--pumpkin); }
.nav a.christmas::before { background: var(--leaf); }

/* home hero */
.hero { padding: 56px 0 30px; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.ticks { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 0; font-weight: 700; color: var(--ink-2); }
.ticks li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--leaf); color: #fff; font-size: .8rem; font-weight: 900; }
.hero-art { position: relative; padding: 10px; }
.ba { position: relative; background: #fff; border: var(--line); border-radius: 22px; padding: 14px; box-shadow: 8px 8px 0 var(--ink); transform: rotate(1.6deg); overflow: hidden; user-select: none; -webkit-user-select: none; }
.ba img { width: 100%; border-radius: 10px; }
.ba-over { position: absolute; inset: 14px; pointer-events: none; }
.ba-over .before { width: 100%; height: 100%; clip-path: inset(0 calc(100% - var(--x)) 0 0); background: #fff; }
.ba-handle { position: absolute; top: -14px; bottom: -14px; left: var(--x); width: 4px; margin-left: -2px; background: var(--ink); }
.ba-handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--sunny); border: var(--line); font-weight: 900; font-size: 1.2rem; box-shadow: 2px 2px 0 var(--ink); }
.ba-tag { position: absolute; top: 26px; font: 800 .8rem/1 var(--display); background: var(--card); border: var(--line); border-radius: 999px; padding: 6px 10px; pointer-events: none; }
.ba-tag.l { left: 26px; } .ba-tag.r { right: 26px; background: var(--sunny); }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.tape { position: absolute; width: 110px; height: 30px; background: rgba(255, 201, 60, .75); border: 1px solid rgba(42, 35, 32, .15); z-index: 2; pointer-events: none; }
.tape.t1 { top: -2px; left: 30px; transform: rotate(-8deg); } .tape.t2 { bottom: 4px; right: 22px; transform: rotate(-6deg); background: rgba(90, 180, 229, .6); }
.ba-note { position: absolute; right: 8px; top: -20px; font: 800 1.05rem/1 var(--display); color: var(--tomato); transform: rotate(6deg); margin: 0; }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 34px auto 20px; }
.steps > div { background: var(--card); border: var(--line); border-radius: var(--r); padding: 22px 22px 8px; box-shadow: var(--pop); }
.steps p { color: var(--ink-2); }
.num { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: var(--line); font: 900 1.4rem/1 var(--display); margin-bottom: 12px; transform: rotate(-4deg); color: #fff; }
.num.tomato { background: var(--tomato); } .num.sky { background: var(--sky); } .num.leaf { background: var(--leaf); }

/* sections and cards */
.more { margin: 44px auto; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-head h2 { margin: 0; } .sec-head h2 a { text-decoration: none; }
.sec-head > a { font-weight: 800; color: var(--tomato-d); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sec-head > a::after { content: " →"; }
.sec-head .sticker { margin: 0; }
.soon .lede { margin-top: -4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; text-decoration: none; background: var(--card); border: var(--line); border-radius: var(--r); padding: 10px 10px 14px; box-shadow: var(--pop); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translate(-3px, -3px) rotate(-.6deg); box-shadow: 7px 7px 0 var(--ink); }
.thumb { position: relative; display: block; background: #fff; border-radius: 12px; overflow: hidden; border: 1.5px solid #eadfcd; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .colored { position: absolute; inset: 0; opacity: 0; transition: opacity .35s; background: #fff; }
.card:hover .colored, .card:focus-visible .colored { opacity: 1; }
.go { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .85rem; background: var(--sunny); border: var(--line); border-radius: 999px; padding: 5px 11px 5px 8px; box-shadow: 2px 2px 0 var(--ink); }
.go .i { width: 16px; height: 16px; }
.ct { font: 800 1.12rem/1.2 var(--display); margin: 12px 4px 4px; }
.cs { font-size: .85rem; font-weight: 700; color: var(--muted); margin: 0 4px; }
.empty { background: var(--card); border: 2px dashed var(--ink); border-radius: var(--r); padding: 30px; text-align: center; }

/* breadcrumbs and page heads */
.crumbs { font-size: .9rem; font-weight: 700; color: var(--muted); margin: 22px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { color: var(--ink-2); }
.page-head { margin: 14px 0 26px; }
.page-head h1 { margin-bottom: .35em; }
.page-head .lede { margin: 0; }
.how-line { font-weight: 800; margin-top: 10px; color: var(--tomato-d); }

/* the coloring studio */
.studio { display: grid; grid-template-columns: 82px minmax(0, 1fr) 264px; gap: 16px; background: var(--card); border: var(--line); border-radius: 26px; padding: 14px; box-shadow: 6px 6px 0 var(--ink); }
.tools { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.tools button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 7px; font: 800 .72rem/1 var(--body); color: var(--ink); background: transparent; border: 2px solid transparent; border-radius: 14px; cursor: pointer; }
.tools button:hover { background: var(--paper); }
.tools button[aria-pressed="true"] { background: var(--sunny); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.tools button:disabled { opacity: .35; cursor: default; background: transparent; }
.tools output { text-align: center; font-weight: 800; font-size: .78rem; color: var(--ink-2); }
.tsep { height: 2px; background: var(--paper-2); margin: 4px 8px; border-radius: 2px; }
.canvas-wrap { position: relative; background: var(--paper-2); border-radius: 18px; padding: 12px; display: grid; place-items: center; min-width: 0; }
.stage, .placeholder { width: min(100%, calc(74vh * var(--ar))); aspect-ratio: var(--ar); }
.stage { overflow: auto; background: #fff; border-radius: 8px; box-shadow: 0 6px 18px rgba(60, 40, 20, .12); overscroll-behavior: contain; }
.frame { width: 100%; }
.view { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.stage.moving .view { cursor: grab !important; } .stage.moving:active .view { cursor: grabbing !important; }
.placeholder { border-radius: 8px; background: #fff; object-fit: contain; }
.studio:not(.ready) .stage { display: none; }
.studio.ready .placeholder { display: none; }
.studio-toast { position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; font-weight: 700; font-size: .92rem; padding: 10px 16px; border-radius: 12px; transition: .25s; max-width: 90%; text-align: center; }
.studio-toast.show { opacity: 1; transform: translate(-50%, 0); }
.side { display: flex; flex-direction: column; gap: 14px; }
.pick { display: flex; align-items: center; gap: 12px; }
.current { width: 52px; height: 52px; border-radius: 50%; background: var(--c, #ffc93c); border: var(--line); box-shadow: 2px 2px 0 var(--ink); flex: none; }
.pick b { display: block; font-family: var(--display); font-size: 1.05rem; }
.custom { position: relative; font-size: .85rem; font-weight: 800; color: var(--tomato-d); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sw { aspect-ratio: 1; border-radius: 50%; background: var(--c); border: 2px solid rgba(42, 35, 32, .25); cursor: pointer; padding: 0; transition: transform .1s; }
.sw:hover { transform: scale(1.12); }
.sw.on { border-color: var(--ink); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.suggest b { display: block; font-size: .85rem; margin-bottom: 6px; }
.suggest div { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 8px; background: var(--paper); border-radius: 12px; }
.shapes[hidden] { display: none; }
.shapes b { display: block; font-size: .85rem; margin-bottom: 6px; }
.shapes div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.shapes button { aspect-ratio: 1; padding: 7px; background: #fff; border: 2px solid #e6dccb; border-radius: 12px; cursor: pointer; }
.shapes button svg { width: 100%; height: 100%; fill: #fff; stroke: var(--ink); stroke-width: 6; stroke-linejoin: round; }
.shapes button:hover { border-color: var(--ink); }
.shapes button[aria-pressed="true"] { background: var(--sunny); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.shapes button[aria-pressed="true"] svg { fill: var(--sunny-l); }
.size { display: grid; gap: 4px; font-weight: 800; font-size: .88rem; }
.size[hidden] { display: none; }
.size input { accent-color: var(--tomato); width: 100%; }
.finish { display: grid; gap: 10px; margin-top: auto; }
.link { background: none; border: 0; font: 800 .9rem var(--body); color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.hint { font-size: .82rem; color: var(--muted); margin: 0; }

/* print options under the studio */
.paper-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; margin: 34px 0; align-items: start; }
.print-card { background: var(--sky-l); border: var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--pop); }
.print-card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 14px; }
.pinit { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: #b5172a; }
.example { margin: 0; background: var(--card); border: var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--pop); transform: rotate(1deg); max-width: 380px; }
.example img { border-radius: 10px; width: 100%; }
.example figcaption { font-weight: 700; color: var(--ink-2); padding: 12px 4px 2px; }
.example .sticker { margin: 0 8px 0 0; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.facts li { background: var(--card); border: var(--line); border-radius: 14px; padding: 12px 16px; }

/* book promo */
.promo { margin: 56px auto; }
.promo-in { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; background: var(--sunny-l); border: var(--line); border-radius: 28px; padding: 32px 40px; box-shadow: 6px 6px 0 var(--ink); }
.promo-cover img { width: 240px; border-radius: 8px; border: var(--line); transform: rotate(-4deg); box-shadow: 8px 10px 0 rgba(42, 35, 32, .25); }
.promo h2 { margin-bottom: .1em; } .promo .sub { color: var(--ink-2); font-weight: 700; }

/* footer */
.foot { margin-top: 70px; background: var(--ink); color: #eadfcd; padding: 44px 0 26px; }
.foot-in { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; }
.foot .logo { color: #fff; margin-bottom: 12px; }
.foot h4 { color: #fff; font-size: 1.05rem; }
.foot-in > div:not(.foot-brand) a { display: block; text-decoration: none; padding: 3px 0; font-weight: 700; }
.foot a:hover { color: var(--sunny); }
.foot .small { margin-top: 26px; color: #a99d92; }

.prose { max-width: 680px; margin: 40px 0; } .prose p { font-size: 1.08rem; }
.ad { margin: 30px auto; text-align: center; min-height: 90px; }

/* tablets */
@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { max-width: 520px; margin: 0 auto; width: 100%; }
  .studio { grid-template-columns: 1fr; }
  .tools { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .tools::-webkit-scrollbar { display: none; }
  .tools button { min-width: 58px; flex: none; }
  .tsep { width: 2px; height: auto; margin: 6px 2px; flex: none; }
  .tools output { align-self: center; min-width: 40px; }
  .stage, .placeholder { width: min(100%, calc(68vh * var(--ar))); }
  .swatches { grid-template-columns: repeat(12, 1fr); }
  .shapes div { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .shapes button { padding: 5px; border-radius: 10px; }
  .finish { grid-template-columns: 1fr 1fr; } .finish .link { grid-column: 1 / -1; }
  .paper-row { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; }
}
/* phones */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top-in { flex-wrap: wrap; gap: 4px; padding: 8px 0; min-height: 0; }
  .logo { font-size: 1.15rem; } .logo .mark { width: 34px; height: 34px; }
  .nav { margin: 0 -16px; padding: 0 16px 4px; width: calc(100% + 32px); }
  .nav a { padding: 6px 12px; border-color: rgba(42, 35, 32, .15); background: var(--card); font-size: .92rem; }
  .hero { padding-top: 30px; }
  .steps { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card { padding: 7px 7px 11px; border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); }
  .ct { font-size: .98rem; margin-top: 9px; } .cs { font-size: .75rem; }
  .go { font-size: .74rem; padding: 4px 9px 4px 6px; right: 5px; bottom: 5px; }
  .studio { padding: 8px; border-radius: 20px; gap: 10px; box-shadow: 4px 4px 0 var(--ink); }
  .canvas-wrap { padding: 6px; border-radius: 14px; }
  .tools button { min-width: 52px; padding: 7px 2px 6px; }
  .swatches { grid-template-columns: repeat(8, 1fr); gap: 7px; }
  .promo-in { grid-template-columns: 1fr; padding: 24px; gap: 22px; text-align: center; }
  .promo-cover img { width: 190px; margin: 0 auto; }
  .ba-note { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
