/* ============ The Coloring Post ============ */
:root {
  --paper: #FFFDF7;
  --paper-deep: #FBF7EC;
  --ink: #29261F;
  --ink-soft: #6B675C;
  --line: #E9E3D4;
  --post-red: #E4573D;
  --sky: #2F6BD8;
  --sun: #F5B52E;
  --leaf: #4A9E5C;
  --grape: #8B5CC7;
  --radius: 14px;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- airmail divider ---------- */
.airmail {
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    var(--post-red) 0 16px,
    var(--paper) 16px 28px,
    var(--sky) 28px 44px,
    var(--paper) 44px 56px
  );
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 50;
}
.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.logo-mark { width: 34px; height: 30px; }
.logo-word { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.01em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: #fff; color: var(--ink);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.btn-primary { background: var(--post-red); color: #fff; border-color: var(--ink); }
.btn-small { font-size: 0.9rem; padding: 0.45rem 1rem; }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem;
  align-items: center;
  max-width: 1120px; margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2.5rem);
}
.eyebrow {
  font-weight: 800; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--post-red); margin-bottom: 0.75rem;
}
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
.hero-ctas { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.cta-note { font-size: 0.9rem; color: var(--ink-soft); }

/* stamps: perforated postage-stamp frames.
   Transparent holes tile across the background; the opaque image covers the
   middle, so scallops only show on the padding rim. */
.stamp {
  padding: 10px;
  background: radial-gradient(circle, transparent 0, transparent 4px, #fff 4.5px, #fff);
  background-size: 20px 20px;
  background-position: -10px -10px;
  filter: drop-shadow(0 6px 14px rgba(41, 38, 31, 0.22));
  position: relative;
}
.stamp img { border: 1px solid var(--line); background: #fff; }
.hero-mail { position: relative; height: 420px; }
.hero-mail .stamp { position: absolute; width: 58%; }
.stamp-1 { top: 0; left: 0; transform: rotate(-5deg); z-index: 3; }
.stamp-2 { top: 12%; right: 0; transform: rotate(4deg); z-index: 2; }
.stamp-3 { bottom: 0; left: 14%; transform: rotate(-1.5deg); z-index: 1; }
.postmark {
  position: absolute; top: -14px; right: -14px;
  width: 62px; height: 62px; border-radius: 50%;
  border: 2.5px solid var(--post-red); color: var(--post-red);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 0.62rem; letter-spacing: 0.08em;
  transform: rotate(12deg); background: rgba(255, 255, 255, 0.85);
}

/* ---------- doors ---------- */
.doors { max-width: 1120px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem); text-align: center; }
.door-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.door {
  background: #fff; border: 2.5px solid var(--ink); border-radius: var(--radius);
  padding: 1.5rem 1.25rem; text-align: left; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  font-size: 1rem; color: var(--ink);
}
.door:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.door:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.door-emoji { font-size: 2rem; }
.door-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.door-text { color: var(--ink-soft); line-height: 1.45; }
.door-go { font-weight: 800; color: var(--post-red); margin-top: auto; }
.door:nth-child(2) .door-go { color: var(--sky); }
.door:nth-child(3) .door-go { color: var(--leaf); }

/* ---------- how ---------- */
.how { background: var(--paper-deep); padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem); text-align: center; }
.how-steps {
  list-style: none; margin: 1.5rem auto 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; max-width: 1000px;
}
.how-steps li { text-align: center; padding: 0 0.5rem; }
.how-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  margin-bottom: 0.6rem;
}
.how-steps li:nth-child(1) .how-num { background: var(--post-red); }
.how-steps li:nth-child(2) .how-num { background: var(--sun); color: var(--ink); }
.how-steps li:nth-child(3) .how-num { background: var(--sky); }
.how-steps p { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- wizard ---------- */
.wizard-wrap { padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem); }
.wizard {
  max-width: 640px; margin: 0 auto; position: relative;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.wstep-center { text-align: center; }
.track-grid { display: grid; gap: 0.8rem; margin-top: 1rem; }
.track-btn {
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  padding: 1rem; border-radius: var(--radius);
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer;
  text-align: left;
}
.track-btn:hover { background: var(--paper-deep); }
.track-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.field { display: block; border: 0; padding: 0; margin: 0 0 1.4rem; }
.field > span, .field legend {
  display: block; font-weight: 800; font-size: 0.95rem; margin-bottom: 0.5rem; padding: 0;
}
.field em { font-weight: 400; color: var(--ink-soft); font-style: normal; }
.field input[type="text"], .field input[type="email"], .field input[type="time"] {
  width: 100%; font-family: var(--body); font-size: 1.05rem;
  padding: 0.65rem 0.9rem; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--paper);
}
.field input:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--body); font-weight: 700; font-size: 0.95rem;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer;
}
.chip:hover { background: var(--paper-deep); }
.chip:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.chip.selected { background: var(--sky); border-color: var(--ink); color: #fff; }
#kid-interests .chip.selected, #care-interests .chip.selected { background: var(--post-red); color: #fff; }
.other-input { margin-top: 0.6rem; }
.tm-note, .privacy-note, .care-intro, .disclaimer-inline {
  font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.6rem;
}
.care-intro { font-size: 1rem; margin-top: -0.5rem; }

.wnext { margin-top: 0.5rem; }
.wback {
  position: absolute; top: 0.9rem; left: 1.2rem;
  background: none; border: none; color: var(--ink-soft);
  font-family: var(--body); font-weight: 700; font-size: 0.9rem; cursor: pointer; padding: 0.2rem;
}
.wback:hover { color: var(--ink); }

/* generating */
.crayon-loader { font-size: 3rem; animation: scribble 1.1s ease-in-out infinite; display: inline-block; }
@keyframes scribble {
  0%, 100% { transform: rotate(-18deg) translateX(-14px); }
  50% { transform: rotate(-10deg) translateX(14px); }
}
@media (prefers-reduced-motion: reduce) { .crayon-loader { animation: none; } }
.gen-note { color: var(--ink-soft); }

/* reveal */
.stamp-reveal { max-width: 420px; margin: 1rem auto; }
.reveal-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.reveal-cta { border-top: 2px dashed var(--line); padding-top: 1.25rem; }
.reveal-cta p { margin-bottom: 0.75rem; }

/* done */
.done-mark { font-size: 3rem; }
.done-sub { color: var(--ink-soft); font-size: 0.95rem; }

.err {
  color: #B3261E; background: #FCEEED; border: 1.5px solid #B3261E;
  border-radius: 10px; padding: 0.6rem 0.9rem; font-size: 0.95rem; margin-top: 1rem;
}

/* ---------- trust ---------- */
.trust {
  max-width: 1120px; margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.trust-item strong { font-family: var(--display); font-size: 1.05rem; display: block; margin-bottom: 0.3rem; }
.trust-item p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* ---------- footer ---------- */
.footer { text-align: center; padding-bottom: 2rem; }
.footer .airmail { margin-bottom: 2rem; }
.footer p { margin: 0.3rem auto; max-width: 46em; padding: 0 1rem; }
.fine { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- print: only the coloring page ---------- */
@media print {
  body * { visibility: hidden; }
  .stamp-reveal, .stamp-reveal * { visibility: visible; }
  .stamp-reveal {
    position: fixed; inset: 0; max-width: none; margin: 0; padding: 0;
    box-shadow: none; -webkit-mask: none; mask: none;
  }
  .stamp-reveal img { width: 100%; height: 100vh; object-fit: contain; border: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mail { height: 340px; max-width: 420px; margin: 0 auto; width: 100%; }
  .door-grid, .how-steps, .trust { grid-template-columns: 1fr; }
}
