/* Floof Pop – colors taken from the Floof Pop logo and signature */
:root {
  --paper: #fbf3e4;      /* cream, like the book covers */
  --paper-2: #f6e8cf;    /* deeper cream for bands */
  --card: #fffaf1;
  --ink: #4a1631;        /* signature plum */
  --ink-soft: #6f4a5c;
  --rose: #d9687a;       /* logo rose */
  --rose-dark: #b94d61;
  --sage: #9bb88c;       /* logo sage */
  --mustard: #f4be45;    /* logo mustard */
  --line: #2a1220;       /* thick "coloring book" outline */
  --radius: 22px;
  --shadow: 0 6px 0 rgba(74, 22, 49, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.6 "Nunito", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose-dark); }
h1, h2, h3, h4 { font-weight: 900; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.small { font-size: .88rem; color: var(--ink-soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { font-weight: 800; color: var(--rose-dark); text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; margin-bottom: .6em; }
.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 40ch; }
.note { margin-top: 2rem; color: var(--ink-soft); font-weight: 700; }
.card { background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Header */
.top { background: var(--paper); border-bottom: 3px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.brand img { width: 88px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 800; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { background: var(--paper-2); }
.nav a[aria-current] { background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--line); }
.nav .nav-kids { margin-left: 8px; background: var(--sage); border: 2px solid var(--line); }
.nav .nav-kids:hover { background: #b2cba5; }
.menu-btn { display: none; font: inherit; font-weight: 800; color: var(--ink); background: var(--card); border: 3px solid var(--line); border-radius: 999px; padding: 6px 18px; cursor: pointer; }

/* Buttons */
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.center-btns { justify-content: center; }
.btn {
  display: inline-block; font: inherit; font-weight: 800; cursor: pointer;
  background: var(--rose); color: #fff; text-decoration: none;
  border: 3px solid var(--line); border-radius: 999px;
  padding: 12px 26px; box-shadow: 0 4px 0 var(--line);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.btn-soft { background: var(--card); color: var(--ink); }
.btn-off { background: var(--paper-2); color: var(--ink-soft); box-shadow: none; cursor: default; border-style: dashed; }
.btn-off:hover { transform: none; box-shadow: none; }

/* Sections */
.sec { padding: 64px 0; }
.sec-top0 { padding-top: 0; }
.band { background: var(--paper-2); border-block: 3px solid var(--line); padding: 64px 0; }
.page-head { padding: 48px 0 40px; }
.crumbs { font-size: .92rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 1.2em; }
.crumbs a { color: var(--ink-soft); }

/* Slim strip for parents who scanned a Kiki book */
.kiki-strip { background: var(--sage); border-bottom: 3px solid var(--line); text-align: center; font-weight: 800; font-size: .95rem; padding: 7px 0; }
.kiki-strip a { color: var(--line); }

/* Home hero */
.hero { position: relative; overflow: hidden; background: var(--hero-bg, var(--paper)); border-bottom: 3px solid var(--line); }
.hero-img { position: absolute; top: 0; right: 0; height: 100%; width: auto; max-width: none; }
.hero-in { position: relative; min-height: clamp(460px, 44vw, 620px); display: flex; align-items: center; padding: 48px 0; }
.hero-text { max-width: 470px; }

/* Home: new book feature */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.feature-peek { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feature-peek img { border: 3px solid var(--line); border-radius: 14px; background: #fff; }
.feature-peek img:nth-child(odd) { transform: rotate(-1.5deg); }
.feature-peek img:nth-child(even) { transform: rotate(1.5deg); }

/* Why cards */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 1.5rem; }
.why-card { padding: 24px; }
.why-card p { color: var(--ink-soft); }
.why-card p:last-child { margin: 0; }
.why-card:nth-child(1) h3 { color: var(--rose-dark); }
.why-card:nth-child(2) h3 { color: #5f8a50; }
.why-card:nth-child(3) h3 { color: #b98314; }
.email { font-weight: 900; color: var(--ink) !important; user-select: all; }

/* Book cards */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.book-card { display: block; padding: 20px; color: var(--ink); text-decoration: none; transition: transform .15s; }
.book-card:hover { transform: translateY(-4px); }
.book-card h3 { margin-top: 18px; }
.book-card p { color: var(--ink-soft); font-weight: 600; }
.more { font-weight: 900; color: var(--rose-dark); }
.book-cover { position: relative; }
.book-cover img { border-radius: 8px; border: 2px solid var(--line); }
.book-cover.big img { border-width: 3px; box-shadow: 10px 10px 0 var(--sage); }
.badge {
  position: absolute; top: -12px; left: -12px; z-index: 1;
  background: var(--mustard); color: var(--line); font-weight: 900;
  border: 3px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: .9rem;
}

/* Book page */
.book-hero { padding: 40px 0 64px; }
.book-hero-in { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.book-sub { color: var(--ink-soft); font-weight: 800; font-size: 1.15rem; }
.facts { padding: 0; margin: 0 0 1.6em; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px; font-weight: 700; font-size: .92rem; }
.peek { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 1.5rem; }
.peek img { border: 3px solid var(--line); border-radius: 14px; background: #fff; }
.back-sec { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.back-sec > img { border: 3px solid var(--line); border-radius: 10px; }
.faq dt { font-weight: 900; font-size: 1.1rem; margin-top: 1.2em; }
.faq dd { margin: .3em 0 0; color: var(--ink-soft); }

/* Free pages previews */
.free-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.free-grid figure { margin: 0; }
.free-grid img { border: 3px solid var(--line); border-radius: 14px; background: #fff; }
.free-grid figcaption { font-weight: 800; text-align: center; margin-top: 8px; }
@media (max-width: 860px) { .free-grid { grid-template-columns: repeat(2, 1fr); } }

/* Sign-up */
.signup { padding: 40px; text-align: center; max-width: 720px; margin-inline: auto; }
.signup-form, .unlock-form { display: flex; gap: 10px; margin: 1.5rem 0 .6rem; }
.signup-form input, .unlock-form input {
  flex: 1; min-width: 0; font: inherit; padding: 12px 20px;
  border: 3px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.signup-form input:focus { outline: 3px solid var(--mustard); outline-offset: 2px; }
.form-msg { min-height: 1.6em; font-weight: 700; margin: 0 0 .4em; }

/* Our story */
.story-page { padding-top: 40px; }
.story { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }
.prose h2 { font-size: 1.5rem; margin-top: 1.4em; }
.story-art { position: sticky; top: 130px; display: grid; justify-items: center; gap: 4px; padding-top: 40px; }
.story-logo { width: 240px; }
.story-sig { width: 230px; }

/* Kids door */
.kids { background: var(--paper-2); border-top: 3px solid var(--line); padding: 64px 0; }
.kids-in { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: center; }
.kids img { border: 3px solid var(--line); border-radius: var(--radius); }
.kids p { max-width: 46ch; }

/* Footer */
.foot { border-top: 3px solid var(--line); padding: 48px 0 84px; } /* room for the Top button */
.foot-in { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; align-items: start; }
.foot-sig { width: 190px; }
.foot-tag { font-weight: 700; color: var(--ink-soft); }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot-cols h4 { font-size: 1rem; margin-bottom: .6em; }
.foot-cols a { display: block; color: var(--ink); text-decoration: none; font-weight: 700; padding: 3px 0; }
.foot-cols a:hover { color: var(--rose-dark); }
.foot-base { border-top: 2px dashed rgba(42, 18, 32, .25); margin-top: 32px; padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-base p { margin: 0; }

/* Back to top */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  background: var(--card); color: var(--ink); text-decoration: none; font-weight: 900;
  border: 3px solid var(--line); border-radius: 999px; padding: 10px 18px;
  box-shadow: 0 4px 0 var(--line);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--mustard); }
@media (max-width: 600px) { .to-top { right: 14px; bottom: 14px; padding: 8px 14px; } }

/* Phone menu */
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--paper); border-bottom: 3px solid var(--line); padding: 12px 16px 18px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 16px; }
  .nav .nav-kids { margin: 6px 0 0; text-align: center; }
}
/* Tablets */
@media (max-width: 920px) {
  .nav a { padding: 8px 10px; }
  .hero-img { position: static; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; object-position: 88% 50%; }
  .hero-in { min-height: 0; padding: 8px 0 44px; }
  .hero-text { max-width: none; }
  .feature, .book-hero-in, .back-sec, .story { grid-template-columns: 1fr; gap: 32px; }
  .book-cover.big { max-width: 440px; }
  .why { grid-template-columns: 1fr; }
  .kids-in { grid-template-columns: 1fr; }
  .kids img { max-width: 280px; }
  .story-art { position: static; justify-items: start; padding-top: 0; }
  .story-logo { display: none; } /* already in the header on small screens */
  .story-sig { width: 200px; }
  .foot-in { grid-template-columns: 1fr; }
}
/* Phones */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .brand img { width: 64px; }
  .sec, .band, .kids { padding: 48px 0; }
  .peek { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .signup { padding: 28px 20px; }
  .signup-form { flex-direction: column; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
}

/* ================= Coloring studio (/color/) ================= */
.studio-head { padding-bottom: 24px; }
.studio {
  display: grid; gap: 20px; align-items: start;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  grid-template-areas: "brushes main colors" "pages main colors";
  grid-template-rows: auto 1fr;
}
.studio-main { grid-area: main; display: grid; gap: 12px; min-width: 0; }
.spanel[data-panel="brushes"] { grid-area: brushes; }
.spanel[data-panel="pages"] { grid-area: pages; }
.spanel[data-panel="colors"] { grid-area: colors; }
.stabs { display: none; }
.spanel { padding: 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.side-h { font-size: 1.15rem; margin: 0; }
.side-sub { font-weight: 900; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 6px 0 0; }

.stage { position: relative; overflow: hidden; padding: 0; background: #fff; aspect-ratio: 1; width: 100%;
  max-width: min(100%, calc(100vh - 210px)); justify-self: center; touch-action: none; cursor: crosshair; border-radius: 14px; }
.stage[data-tool="hand"] { cursor: grab; }
.stage[data-tool="picker"] { cursor: copy; }
#studioCanvas { display: block; width: 100%; height: 100%; transform-origin: 0 0; user-select: none; -webkit-user-select: none; }
.studio-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
.seg { display: inline-flex; border: 3px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.ibtn { min-width: 44px; height: 42px; display: grid; place-items: center; border: 0; background: none; color: var(--ink);
  font: 800 1.1rem/1 "Nunito", sans-serif; cursor: pointer; padding: 0 10px; }
.ibtn.txt { font-size: .95rem; }
.ibtn + .ibtn { border-left: 2px solid var(--line); }
.ibtn.wide { font-size: .88rem; min-width: 64px; font-variant-numeric: tabular-nums; }
.ibtn:disabled { opacity: .35; cursor: default; }
.ibtn:not(:disabled):hover { background: var(--paper-2); }
.btn.sm { padding: 8px 18px; font-size: .95rem; box-shadow: 0 3px 0 var(--line); }
.studio-status { text-align: center; min-height: 1.5em; margin: 0; font-weight: 700; color: var(--ink-soft); font-size: .95rem; }

.tools { display: grid; gap: 6px; }
.tool { font: 800 .95rem/1.2 "Nunito", sans-serif; color: var(--ink); background: var(--paper); text-align: left;
  border: 2px solid var(--line); border-radius: 999px; padding: 9px 14px; cursor: pointer; min-height: 42px; }
.tool:hover { background: var(--paper-2); }
.tool[aria-pressed="true"] { background: var(--mustard); box-shadow: 0 3px 0 var(--line); }
.size-block { display: grid; gap: 6px; }
.size-block[hidden] { display: none; }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row input { flex: 1; min-width: 0; accent-color: var(--rose-dark); }
.size-dot-box { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border: 2px dashed var(--ink-soft); border-radius: 50%; }
#sizeDot { display: block; border-radius: 50%; border: 2px solid var(--line); }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 800; cursor: pointer; margin-top: 4px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--rose-dark); }

.page-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.page-pick { display: grid; gap: 4px; justify-items: center; padding: 6px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); cursor: pointer; font: 700 .78rem/1.2 "Nunito", sans-serif; color: var(--ink); text-align: center; }
.page-pick img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; background: #fff; }
.page-pick[aria-pressed="true"] { background: var(--mustard); box-shadow: 0 3px 0 var(--line); }

.live { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-swatch { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--line); flex: none; }
.hex { display: grid; gap: 2px; font-weight: 800; font-size: .75rem; color: var(--ink-soft); }
.hex input { width: 110px; font: 800 1rem "Nunito", sans-serif; color: var(--ink); padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; text-transform: lowercase; }
.live-name { font-weight: 800; font-size: .85rem; color: var(--rose-dark); }
.wheel { width: 220px; height: 220px; justify-self: center; touch-action: none; cursor: crosshair; }
.pal-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pal-tab { font: 800 .8rem/1 "Nunito", sans-serif; padding: 8px 11px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; min-height: 34px; }
.pal-tab[aria-pressed="true"] { background: var(--sage); }
.palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.swatch { width: 100%; aspect-ratio: 1; min-width: 32px; border-radius: 50%; border: 3px solid var(--line); cursor: pointer; padding: 0; transition: transform .12s; }
.swatch[aria-pressed="true"] { transform: scale(1.12); box-shadow: 0 0 0 2px var(--card), 0 0 0 5px var(--line); }
.palette.mine.removing .swatch { border-style: dashed; opacity: .8; }
#recentWrap { display: grid; gap: 6px; }
#recentWrap[hidden] { display: none; }
.mine-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.mine-btns [hidden] { display: none; }

/* phones and tablets: canvas on top, panels in tabs below */
@media (max-width: 900px) {
  .studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; grid-template-rows: none; gap: 12px; }
  .studio .studio-main, .studio .spanel[data-panel] { grid-area: auto; }
  .stage { max-width: 100%; }
  .stabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stab { font: 900 1rem/1 "Nunito", sans-serif; padding: 12px 6px; border: 3px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); cursor: pointer; min-height: 48px; }
  .stab[aria-selected="true"] { background: var(--mustard); box-shadow: 0 3px 0 var(--line); }
  .spanel { display: none; }
  .studio[data-tab="brushes"] .spanel[data-panel="brushes"],
  .studio[data-tab="colors"] .spanel[data-panel="colors"],
  .studio[data-tab="pages"] .spanel[data-panel="pages"] { display: grid; }
  .spanel[data-panel="brushes"] .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool { text-align: center; padding: 10px 8px; min-height: 48px; }
  .page-picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .studio-bar { gap: 8px; }
}
@media (max-width: 420px) {
  .studio-bar .btn.sm { padding: 8px 14px; }
  .ibtn { min-width: 40px; padding: 0 8px; }
}

/* Studio full screen: picture as big as the screen allows */
body.studio-full { overflow: hidden; }
body.studio-full .top, body.studio-full .to-top, body.studio-full .kiki-strip { display: none; }
.studio.is-full {
  position: fixed; inset: 0; z-index: 100; margin: 0; overflow: auto;
  background: var(--paper); padding: 10px; gap: 10px;
  grid-template-columns: 190px minmax(0, 1fr) 260px; grid-template-rows: 1fr;
  grid-template-areas: "brushes main colors";
}
.studio.is-full .spanel[data-panel="pages"] { display: none; }          /* pick pages outside full screen */
.studio.is-full .studio-main { gap: 8px; align-content: start; }
.studio.is-full .studio-bar { order: -1; gap: 6px; }                     /* compact toolbar on top */
.studio.is-full .studio-bar .btn.sm { padding: 6px 14px; font-size: .88rem; box-shadow: 0 2px 0 var(--line); }
.studio.is-full .ibtn { height: 36px; min-width: 38px; }
.studio.is-full .stage { max-width: min(100%, calc(100vh - 72px)); max-width: min(100%, calc(100dvh - 72px)); }
.studio.is-full .studio-status { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 101;
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 3px 14px; font-size: .82rem;
  pointer-events: none; max-width: 90vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio.is-full .spanel { padding: 12px; gap: 8px; overflow: auto; max-height: calc(100dvh - 20px); }
#fullBtn[aria-pressed="true"] { background: var(--mustard); }
@media (max-width: 900px) {
  .studio.is-full { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; grid-template-rows: none; padding: 6px; gap: 8px; }
  .studio.is-full .studio-main, .studio.is-full .spanel[data-panel] { grid-area: auto; }
  .studio.is-full .stage { max-width: 100%; border-radius: 8px; }
  .studio.is-full .studio-status { position: static; transform: none; border: 0; background: none; padding: 0; }
  .studio.is-full .spanel { max-height: none; }
  .studio.is-full[data-tab="pages"] .spanel[data-panel="pages"] { display: grid; }
}

/* Free pages library (thank-you page) */
.library { display: grid; gap: 34px; }
.edition { border: 3px solid var(--line); border-radius: 18px; background: #fff8ee; padding: 24px; }
.edition-new { box-shadow: 6px 6px 0 var(--line); }
.edition-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.edition-head h2 { margin: .1rem 0; }
.edition-head p { margin: 0; }
.new-tag { background: var(--mustard); color: var(--ink); border-radius: 99px; padding: 2px 10px; margin-right: 4px; }
.lock-msg { background: #fde6e6; border: 2px solid var(--rose); border-radius: 12px; padding: 12px 16px; font-weight: 700; }

/* Book sample pages in the studio */
.from-book { display: block; margin-top: -2px; color: var(--rose); font: 800 .62rem/1.1 Nunito, sans-serif; font-style: normal;
  text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.book-note { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  border: 2px solid var(--line); border-radius: 14px; background: #fff8ee; padding: 10px 14px; margin-top: 10px; }
.book-note p { margin: 0; }
.book-note[hidden] { display: none; }
.studio.is-full .book-note { display: none; }
