@import url('../shared/base.css');

:root {
  --bg: #FFF4DF;
  --surface: #FFFFFF;
  --ink: #1D1846;
  --muted: #5B5486;
  --line: #EADFC8;
  --accent: #FF5D4E;
  --on-accent: #FFFFFF;
  --sun: #FFB627;
  --sky: #8FD3FF;
  --shadow: rgba(29, 24, 70, .45);
  --radius: 18px;
  --radius-btn: 999px;
  --font-head: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;
}

body { overflow-x: hidden; font-size: 17px; }
main { max-width: none; padding: 0; }
.wrap { max-width: 1280px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
section { margin-top: 0; padding-top: 110px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.04em; }
h2 { font-size: clamp(38px, 5vw, 72px); line-height: .95; }
.sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 36px; }
.hand { font-family: var(--font-hand); font-size: 30px; margin: 0 0 14px; transform: rotate(-2deg); transform-origin: left; }
.hand--coral { color: var(--accent); }
.textlink { font-weight: 700; text-underline-offset: 5px; }

/* header */
.top { max-width: 1280px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.logo__ribbon { display: inline-block; width: 26px; height: 36px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--key { box-shadow: 0 6px 0 var(--ink); }
.btn--key:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.btn--key:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; padding-top: 30px; padding-bottom: 90px; }
.hero h1 { font-size: clamp(54px, 7.2vw, 108px); line-height: .92; letter-spacing: -.045em; margin: 0; }
.name-sticker {
  display: inline-block; margin: 10px 0 6px; padding: 0 24px 8px; max-width: 100%; overflow-wrap: anywhere;
  background: var(--sun); border: 3px dashed var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink);
  font-family: var(--font-hand); font-weight: 700; font-size: 1.12em; letter-spacing: 0;
  animation: wobble 5s ease-in-out infinite;
}
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(3deg); } }
.hero .lead { font-size: 1.25rem; margin-top: 28px; max-width: 470px; color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 8px; }
.hero__facts { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-weight: 600; color: var(--muted); font-size: .95rem; }
.hero__facts li + li::before { content: '✦'; margin-right: 22px; }

.collage { position: relative; min-height: 560px; }
.collage__back { position: absolute; inset: 40px 30px 30px 50px; background: var(--sky); border-radius: 6px; transform: rotate(-7deg); }
.collage__paper { position: absolute; inset: 20px 50px 60px 20px; background: #fff; border-radius: 6px; transform: rotate(4deg); box-shadow: 0 30px 60px -30px var(--shadow); }
.collage__img {
  position: relative; top: 70px; width: 92%; margin: 0 auto; aspect-ratio: 1200 / 896; object-fit: cover; transform: rotate(-2deg);
  clip-path: polygon(0 0,100% 0,100% 95%,95% 99%,90% 95.5%,85% 99%,80% 96%,75% 99.5%,70% 96%,65% 98.5%,60% 95.5%,55% 99%,50% 96%,45% 99%,40% 95.5%,35% 98.5%,30% 96%,25% 99.5%,20% 96%,15% 99%,10% 95.5%,5% 98.5%,0 96%);
}
.tape { position: absolute; height: 34px; background: rgba(255, 182, 39, .75); }
.tape--l { top: 52px; left: 18%; width: 150px; transform: rotate(-9deg); }
.tape--r { top: 60px; right: 12%; width: 120px; transform: rotate(11deg); }
.collage__badge { position: absolute; right: -6px; top: 0; width: 148px; height: 148px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transform: rotate(12deg); box-shadow: 0 10px 0 var(--ink); }
.collage__badge strong { font-size: 56px; line-height: .9; }
.collage__badge span { font-weight: 700; font-size: 14px; line-height: 1.2; max-width: 100px; }
.collage__note { position: absolute; left: -10px; bottom: 6px; margin: 0; max-width: 300px; background: #fff; padding: 16px 20px; border-radius: 4px; font-family: var(--font-hand); font-size: 26px; line-height: 1.15; transform: rotate(-3deg); box-shadow: 6px 6px 0 var(--ink); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .collage { min-height: 420px; }
  .collage__note { left: 0; }
  .collage__badge { width: 110px; height: 110px; }
  .collage__badge strong { font-size: 40px; }
}

/* marquee */
.marquee { background: var(--ink); padding: 24px 0; overflow: hidden; transform: rotate(-1.5deg); margin: 0 -20px; }
.marquee__track { display: flex; gap: 40px; width: max-content; font-weight: 800; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.02em; white-space: nowrap; animation: marquee 38s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.m-sun { color: var(--sun); } .m-sky { color: var(--sky); } .m-coral { color: var(--accent); }
.m-out { color: transparent; -webkit-text-stroke: 2px var(--bg); }

/* open book */
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 44px; }
.sec-head h2 { margin: 0; max-width: 760px; }
.sec-head p { margin: 0; max-width: 360px; color: var(--muted); font-size: 1.1rem; }
.spread-wrap { position: relative; }
.spread { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 50px 80px -50px var(--shadow), 0 0 0 1px var(--line); }
.spread img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; }
.spread__page { position: relative; padding: 64px 60px 48px; display: flex; align-items: center; background: linear-gradient(90deg, rgba(29,24,70,.10), rgba(29,24,70,0) 9%); }
.spread__page p { margin: 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.45; font-weight: 600; }
.dropcap { float: left; font-weight: 800; font-size: 3.4em; line-height: .8; margin: 8px 14px 0 0; color: var(--accent); }
.spread__num { position: absolute; bottom: 24px; right: 34px; font-weight: 700; color: #A49CC4; }
.spread__note { position: absolute; margin: 0; }
.spread__note--a { left: -6px; top: -40px; }
.spread__note--b { right: 10px; bottom: -46px; transform: rotate(2deg); }
@media (max-width: 760px) { .spread { grid-template-columns: 1fr; } .spread__page { padding: 32px 26px; } .spread__note { display: none; } }

/* shelf */
.shelf-scroll { overflow-x: auto; }
.shelf { display: flex; align-items: flex-end; gap: 10px; min-width: 860px; padding: 0 12px; border-bottom: 18px solid var(--ink); height: 400px; }
.spine { width: var(--w); height: var(--h); background: var(--c); color: var(--t); text-decoration: none; border-radius: 6px 6px 0 0; display: flex; justify-content: center; padding-top: 22px; writing-mode: vertical-rl; font-weight: 800; font-size: 24px; box-shadow: inset -10px 0 0 rgba(0,0,0,.16); transition: transform .18s ease; }
.spine:hover, .spine:focus-visible { transform: translateY(-18px); color: var(--t); }
.shelf__photos { flex: 1; display: flex; justify-content: flex-end; align-items: flex-end; gap: 12px; padding-bottom: 2px; }
.shelf__photos img { width: 150px; height: 150px; object-fit: cover; border: 8px solid #fff; box-shadow: 0 16px 30px -16px var(--shadow); }
.shelf__photos img:first-child { transform: rotate(-6deg); }
.shelf__photos img:last-child { width: 130px; height: 130px; transform: rotate(7deg); }

/* steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.step { padding: 30px 30px 36px; box-shadow: 0 24px 40px -30px var(--shadow); }
.step--white { background: #fff; transform: rotate(-1.5deg); }
.step--sun { background: var(--sun); transform: rotate(1deg) translateY(24px); }
.step--sky { background: var(--sky); transform: rotate(-.5deg); }
.step__n { display: block; font-weight: 800; font-size: 110px; line-height: .85; color: transparent; -webkit-text-stroke: 2px var(--ink); }
.step h3 { font-size: 28px; margin: 18px 0 8px; }
.step p { margin: 0; color: #2E2A55; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } .step--sun { transform: rotate(1deg); } }

/* create */
.create { position: relative; border-radius: 6px; box-shadow: 12px 12px 0 var(--ink); }
.create h2 { margin: 0 0 6px; }
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.theme__card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; background: var(--bg); transition: border-color .12s, transform .12s, box-shadow .12s; }
.theme__emoji { font-size: 1.5rem; }
.theme input:checked + .theme__card { border-color: var(--ink); background: var(--sun); transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); }
.theme input:focus-visible + .theme__card { outline: 3px solid var(--accent); }
#createBtn { margin-top: 28px; width: 100%; }
.reassure { text-align: center; color: var(--muted); font-size: .95rem; margin: 14px 0 0; }
.dropzone { border-radius: 10px; }

/* book: laid out like a real picture book (square sheets, words set on the art) */
.book__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.book__head h2 { margin: 0; }
.book__tools { display: flex; gap: 10px; flex-wrap: wrap; }
.pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 26px; margin-top: 18px; }
@media (max-width: 760px) { .pages { grid-template-columns: 1fr; } }
.page { position: relative; }
.page--cover { grid-column: 1 / -1; max-width: 640px; width: 100%; justify-self: center; }

.sheet {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; container-type: inline-size;
  border-radius: 4px; background: repeating-linear-gradient(45deg, #FBF1DC 0 12px, #F6E8CB 12px 24px);
  box-shadow: 0 24px 50px -30px var(--shadow), 0 0 0 1px var(--line), inset 6px 0 10px -6px rgba(29, 24, 70, .18);
}
.page--reading .sheet { box-shadow: 0 0 0 5px var(--sun), 0 24px 50px -20px var(--shadow); }
.sheet__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet__wait { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 2.6rem; }
.sheet__wait span { font-size: 1rem; }

/* the words, typeset like a printed picture book:
   calm area  -> set straight on the painting, ink chosen from the area's colour, with a soft halo of that colour
   busy area  -> a small rounded caption plate sized to the text, never a full-width band */
.words { position: absolute; z-index: 1; display: flex; padding: 6cqw 7cqw; --halo: #fff9ee; --fit: 1; overflow: hidden; break-inside: avoid; }
.pages { --type: 3.35cqw; }
.pages.type-young { --type: 3.9cqw; }
.pages.type-older { --type: 2.8cqw; }
.words p { margin: 0; font-family: 'Andika', var(--font-body); font-weight: 700; font-size: calc(var(--type) * var(--fit)); line-height: 1.5; letter-spacing: .01em; word-spacing: .06em; }
.words .line { display: block; width: max-content; max-width: none; white-space: nowrap; }
.words--top .line, .words--bottom .line { margin-inline: auto; }
.words--top { inset: 0 0 auto 0; max-height: 44%; justify-content: center; text-align: center; }
.words--bottom { inset: auto 0 0 0; max-height: 44%; justify-content: center; align-items: flex-end; text-align: center; }
.words--left { inset: 0 auto 0 0; width: 46%; padding: 6cqw 2cqw 6cqw 6cqw; align-items: center; text-align: left; }
.words--right { inset: 0 0 0 auto; width: 46%; padding: 6cqw 6cqw 6cqw 2cqw; align-items: center; justify-content: flex-end; text-align: left; }

.words--ink-dark { color: #241E45; }
.words--ink-light { color: #FFF8EC; }
.words--clear p, .words--cover .words__title, .words--cover .words__by { position: relative; isolation: isolate; }
/* a soft glow of the area's own colour behind the words, drawn as a gradient so it prints as cleanly as it shows */
.words--clear p::before, .words--cover.words--clear .words__title::before, .words--cover .words__by::before {
  content: ''; position: absolute; inset: -3cqw -4.5cqw; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--halo) 92%, transparent) 0%, color-mix(in srgb, var(--halo) 75%, transparent) 55%, transparent 100%);
}
/* busy areas only: a quiet paper plate, no drop shadow */
.words--plate:not(.words--cover) p { padding: 2.2cqw 3.2cqw; border-radius: 3cqw; }
.words--plate.words--ink-dark:not(.words--cover) p { background: rgba(255, 250, 241, .86); }
.words--plate.words--ink-light:not(.words--cover) p { background: rgba(28, 25, 58, .74); }
.words__locked { font-size: 2.6cqw !important; }

/* cover: title set in the open sky the cover painting leaves at the top */
.words--cover { inset: 0 0 auto 0; flex-direction: column; align-items: center; text-align: center; padding: 4.5cqw 10cqw 0; }
.words__title { margin: 0; font-weight: 800; font-size: calc(6.4cqw * var(--fit)); line-height: 1; letter-spacing: -.035em; text-wrap: balance; }

.words--cover.words--plate { padding-top: 3.5cqw; }
.words--cover.words--plate .words__title { background: rgba(255, 250, 241, .92); padding: 1.6cqw 3cqw; border-radius: 2.4cqw; }
.words--cover.words--plate.words--ink-light .words__title { background: rgba(28, 25, 58, .78); }
.words__by { margin: 1.4cqw 0 0; font-family: var(--font-hand); font-size: 3.6cqw; color: var(--accent); }
.words--cover .words__by::before { inset: -1.5cqw -4cqw; }

.sheet__pno { position: absolute; z-index: 2; bottom: 2cqw; font-weight: 700; font-size: 2cqw; color: var(--ink); opacity: .7; }
.sheet__pno--right { right: 3.4cqw; }
.sheet__pno--left { left: 3.4cqw; }

/* text-only pages: set on a soft, blurred wash of the book's own art, never plain white */
.page--text .sheet { background: linear-gradient(135deg, #FDEBD3, #F7D9E3 55%, #DDEBF7); }
.sheet__blur { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; filter: blur(28px) saturate(1.15) brightness(1.08); }
.sheet__inner { position: absolute; inset: 0; display: grid; place-items: center; padding: 12cqw; text-align: center; background: rgba(255, 249, 238, .45); }
.sheet--dedication p { margin: 0; font-family: var(--font-hand); font-size: 4.8cqw; line-height: 1.25; color: #B8301F; max-width: 70%; }
.sheet--end p { margin: 0; font-weight: 800; font-size: 8.5cqw; letter-spacing: -.04em; }
.sheet--end p::before, .sheet--end p::after { content: '✦'; color: var(--sun); font-size: .5em; vertical-align: middle; margin: 0 .5em; }

.page__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 28px; padding: 8px 2px 0; }
.page__num { font-weight: 700; font-size: .82rem; color: var(--muted); }

/* pricing: hanging price tags */
.pricing { text-align: center; }
.pricing h2 { margin-bottom: 0; }
.pricing .lead { max-width: 520px; margin-top: 14px; }
.tiers { gap: 28px; margin-top: 56px; text-align: left; align-items: start; }
.tier { --card: #fff; --tc: var(--ink); background: transparent; border: 0; border-radius: 0; padding: 70px 32px 34px; isolation: isolate; color: var(--tc); filter: drop-shadow(0 20px 20px rgba(29,24,70,.16)); }
.tier::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 36px, transparent 10px, var(--tc) 11px, var(--tc) 13px, var(--card) 14px); clip-path: polygon(50% 0, 100% 9%, 100% 100%, 0 100%, 0 9%); }
.tier:nth-child(3) { --card: var(--ink); --tc: var(--bg); }
.tier--hl { --card: var(--accent); --tc: #fff; transform: translateY(-24px) rotate(-1.5deg); box-shadow: none; padding-top: 80px; }
.tier__badge { top: 34px; left: auto; right: -18px; transform: rotate(12deg); width: 112px; height: 112px; padding: 20px; border-radius: 0; display: grid; place-items: center; text-align: center; white-space: normal; line-height: 1.05; font-size: .82rem; background: var(--sun); color: var(--ink); clip-path: polygon(50% 0,62.4% 12%,79.4% 9.5%,82.4% 26.5%,97.6% 34.5%,90% 50%,97.6% 65.5%,82.4% 73.5%,79.4% 90.5%,62.4% 88%,50% 100%,37.6% 88%,20.6% 90.5%,17.6% 73.5%,2.4% 65.5%,10% 50%,2.4% 34.5%,17.6% 26.5%,20.6% 9.5%,37.6% 12%); }
.tier__name { font-size: 28px; }
.tier__tag { color: inherit; opacity: .75; }
.tier__price { font-size: 72px; letter-spacing: -.04em; }
.tier--hl .tier__price { font-size: 96px; }
.tier:nth-child(3) .tier__price { color: var(--sun); }
.tier__note { color: inherit; opacity: .75; }
.tier__list li { border-top-color: color-mix(in srgb, var(--tc) 18%, transparent); }
.tier__list li::before { color: inherit; }
.tier--hl .tier__list li::before, .tier:nth-child(3) .tier__list li::before { color: var(--sun); }
.tier__btn.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.tier--hl .tier__btn.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.tier--owned { opacity: .55; }
@media (max-width: 860px) { .tier--hl { transform: none; } .tier__badge { right: 8px; } }

/* stamps + footer */
.stamps { display: flex; flex-wrap: wrap; justify-content: center; gap: 36px; padding-top: 80px; }
.stamp { width: 176px; height: 176px; margin: 0; border-radius: 50%; border: 3px dashed var(--ink); display: grid; place-items: center; text-align: center; padding: 26px; font-weight: 800; font-size: 19px; line-height: 1.15; }
.stamp:nth-child(1) { transform: rotate(-8deg); }
.stamp:nth-child(3) { transform: rotate(-3deg); }
.stamp--coral { border-color: var(--accent); color: #B8301F; transform: rotate(6deg); }
.foot { border-top: 0; padding-top: 60px; }
.foot__mark { margin: 0 0 18px; font-weight: 800; font-size: clamp(80px, 17vw, 260px); line-height: .9; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px var(--ink); }

@media (prefers-reduced-motion: reduce) { .marquee__track, .name-sticker { animation: none; } }

/* print / save as PDF: one landscape 10 x 7.5 in page per sheet, full-bleed art, words on the pictures */
@page { size: 10in 7.5in; margin: 0; }
@media print {
  .demo-banner, .top, .hero, .marquee, #inside, #worlds, .steps, #create, .pricing, .stamps, .foot, .book__head, .notice, .page__meta { display: none !important; }
  html, body { background: transparent !important; margin: 0; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  section { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  .pages { display: block; margin: 0; }
  .page, .page--cover { display: block; width: 10in; max-width: none; margin: 0; break-after: page; page-break-after: always; transform: none !important; }
  .sheet { break-inside: avoid; page-break-inside: avoid; }
  .sheet { width: 10in; height: 7.5in; aspect-ratio: auto; border-radius: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* spine colours (no inline styles: strict CSP) */
.spine--space { --c:#1B1F5E; --t:#FFB627; --h:360px; --w:96px; }
.spine--ocean { --c:#3FC1C9; --t:#0E3B4A; --h:320px; --w:84px; }
.spine--dinosaurs { --c:#5E9E4A; --t:#FFF4DF; --h:380px; --w:108px; }
.spine--forest { --c:#2F6B4F; --t:#FFE7A8; --h:300px; --w:80px; }
.spine--pirates { --c:#FF5D4E; --t:#FFFFFF; --h:346px; --w:100px; }
.spine--jungle { --c:#D9A441; --t:#1D1846; --h:372px; --w:88px; }
.spine--superhero { --c:#14557B; --t:#FFCF40; --h:330px; --w:104px; }
.spine--candy { --c:#FFC6E0; --t:#6B2E57; --h:296px; --w:92px; }

/* phones: hero button full width, less space before the book */
@media (max-width: 640px) {
  .hero { gap: 28px; padding-bottom: 48px; }
  .hero .lead { font-size: 1.08rem; margin-top: 18px; }
  .hero .btn--big { width: 100%; }
}
