/* ============================================================
   Your Story Wish — "bedtime": ink-blue night, one pool of
   lamplight, cream paper for anything you read or edit.
   ============================================================ */
:root {
  --night: #101627;
  --night-2: #182036;
  --night-3: #222c48;
  --paper: #f7efdf;
  --paper-2: #efe4cd;
  --ink: #2a2330;
  --ink-soft: #6b5f66;
  --cream-text: #f3e9d6;
  --cream-soft: rgba(243, 233, 214, .72);
  --gold: #e8b95a;
  --gold-2: #f6d78a;
  --coral: #ff7f5c;
  --coral-2: #ff9a7d;
  --moss: #7fae7a;
  --sky: #8fb7d6;
  --lilac: #b39ddb;
  --rule: rgba(243, 233, 214, .14);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
  --shadow-paper: 0 20px 40px -22px rgba(20, 15, 30, .55);
  --display: "Fraunces", "Gelasio", Georgia, serif;
  --body: "Figtree", "Nunito", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--cream-text); background: var(--night); font-family: var(--body);
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image:
    radial-gradient(70rem 50rem at 70% -10%, rgba(232, 185, 90, .22), transparent 60%),
    radial-gradient(45rem 45rem at -10% 40%, rgba(143, 183, 214, .10), transparent 60%),
    radial-gradient(60rem 40rem at 50% 120%, rgba(179, 157, 219, .12), transparent 60%);
}
body::before { /* grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .35; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--gold-2); opacity: .0; animation: twinkle 6s ease-in-out infinite; box-shadow: 0 0 8px var(--gold-2); }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.6) } 50% { opacity: .9; transform: scale(1) } }
main, header, footer { position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -.015em; line-height: 1.04; margin: 0 0 .5em; }
h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1; }
h1 em, h2 em { font-style: italic; color: var(--gold-2); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--gold-2); }
.wrap { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.eyebrow { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.lede { font-size: 1.2rem; color: var(--cream-soft); max-width: 36rem; }
.hint { font-size: .92rem; color: var(--cream-soft); }
section { padding: 4rem 0; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 1.4rem 0 1.6rem; }
.brand { font-family: var(--display); font-size: 2.2rem; font-weight: 500; letter-spacing: -.01em; text-decoration: none; color: var(--cream-text); display: flex; gap: .9rem; align-items: center; white-space: nowrap; }
.brand .mark { width: 3.6rem; height: 3.6rem; flex: none; filter: drop-shadow(0 0 10px rgba(232,185,90,.45)); transition: filter .3s, transform .3s; }
.brand .word em { font-style: italic; color: var(--gold-2); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.brand .star { transform-origin: 31px 8px; animation: starpulse 3.2s ease-in-out infinite; }
@keyframes starpulse { 0%, 100% { transform: scale(1); opacity: 1 } 50% { transform: scale(1.25) rotate(12deg); opacity: .85 } }
.brand:hover .mark { filter: drop-shadow(0 0 16px rgba(246,215,138,.8)); transform: translateY(-1px) rotate(-4deg); }
.brand:hover .star { animation-duration: 1.2s; }
.nav nav { display: flex; align-items: center; }
.nav a.link { color: var(--cream-soft); text-decoration: none; margin-left: 1.6rem; font-weight: 600; white-space: nowrap; }
.nav a.link:hover { color: var(--gold-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .9rem 1.6rem; border-radius: 999px; font-weight: 700;
  text-decoration: none; border: 0; cursor: pointer; font-family: var(--body); font-size: 1rem; transition: transform .15s, box-shadow .15s, background .15s; }
.btn.primary { background: var(--coral); color: #2a130c; box-shadow: 0 12px 30px -12px var(--coral); }
.btn.primary:hover { transform: translateY(-2px); background: var(--coral-2); box-shadow: 0 18px 34px -12px var(--coral); }
.btn.ghost { background: transparent; color: var(--cream-text); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold-2); }
.btn.small { padding: .55rem 1.05rem; font-size: .9rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* motion */
.rise { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.rise.d1 { animation-delay: .1s } .rise.d2 { animation-delay: .25s } .rise.d3 { animation-delay: .4s } .rise.d4 { animation-delay: .55s }
@keyframes rise { from { opacity: 0; transform: translateY(22px) } to { opacity: 1; transform: none } }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rise, .reveal { animation: none; opacity: 1; transform: none; transition: none; } }

/* ---------------- hero: the book that turns its own pages ---------------- */
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center; padding: 3rem 0 5rem; min-height: 78vh; }
.lamp { position: absolute; z-index: -1; right: -10%; top: -10%; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(246,215,138,.35), rgba(246,215,138,.08) 55%, transparent 70%); filter: blur(10px); pointer-events: none; }
.book-stage { position: relative; padding: 2rem 0 3rem; }
.book { position: relative; width: 100%; aspect-ratio: 2 / 1.414; perspective: 2200px; animation: bob 7s ease-in-out infinite; filter: drop-shadow(0 40px 50px rgba(0,0,0,.6)); }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.book .page { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; }
.book .page.left { left: 0; border-radius: 8px 0 0 8px; }
.book .page.right { right: 0; border-radius: 0 8px 8px 0; }
.book .spine { position: absolute; left: 50%; top: 0; bottom: 0; width: 8px; transform: translateX(-50%); z-index: 3; transition: opacity .4s;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.02) 45%, rgba(0,0,0,.02) 55%, rgba(0,0,0,.28)); }
.book.closed .spine { opacity: 0; }
.book .leaf { position: absolute; inset: 0; display: none; background: var(--paper); }
.book .page.left .leaf { box-shadow: inset -22px 0 30px -22px rgba(0,0,0,.35); }
.book .page.right .leaf { box-shadow: inset 22px 0 30px -22px rgba(0,0,0,.35); }
.book .leaf.on { display: block; }
.book .leaf.empty, .book .face.empty { background: none; box-shadow: none; }
.book { transition: opacity .6s; }
.book.fade { opacity: 0; }
/* title page, closing page and back cover, drawn the way the printed ones are */
.book .wash { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .22; }
.book .tp, .book .cp { position: absolute; inset: 0; overflow: hidden; }
.book .tp .in, .book .cp .in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink); padding: 8% 9%; }
.book .tp h4, .book .cp h4 { font-family: var(--display); font-weight: 600; line-height: 1.05; margin: 0; color: var(--ink); }
.book .tp h4 { font-size: clamp(1rem, 2.1vw, 1.7rem); }
.book .tp p { font-family: "Gelasio", Georgia, serif; font-style: italic; font-size: clamp(.7rem, 1.1vw, .95rem); margin: .5em 0 1.2em; }
.book .tp .frame { display: block; width: 62%; aspect-ratio: 1; background: #fff; padding: 3%; border-radius: 6px; box-shadow: 0 8px 24px -12px rgba(0,0,0,.4); }
.book .tp .frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.book .cp .in { justify-content: center; }
.book .cp .rule { width: 2.2rem; height: 1.5px; background: var(--ink); opacity: .6; margin-bottom: 1rem; }
.book .cp h4 { font-size: clamp(1.1rem, 2.3vw, 1.9rem); }
.book .cp p { font-family: "Gelasio", Georgia, serif; font-style: italic; font-size: clamp(.7rem, 1.1vw, .95rem); margin: 1.2em 0 0; }
.book .page, .book .flip .face { container-type: inline-size; }
.book .txt, .book .flip .txt { position: absolute; inset: 0; padding: 8% 11% 8% 12%; font-family: "Gelasio", Georgia, serif; color: var(--ink); font-size: calc(3.9cqi * var(--scale, 1)); line-height: 1.48; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.book .txt p { margin: 0 0 .8em; }
.book .txt .rule { width: 2rem; height: 1.5px; background: var(--accent, var(--coral)); margin-bottom: 1em; }
.book img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* the turning leaf: picture on the front, next words on the back */
.book .flip { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; transform-origin: left center; transform-style: preserve-3d; z-index: 4; visibility: hidden; }
.book .flip .face { position: absolute; inset: 0; backface-visibility: hidden; background: var(--paper); overflow: hidden; }
.book .flip .front { border-radius: 0 8px 8px 0; box-shadow: inset 22px 0 30px -22px rgba(0,0,0,.35); }
.book .flip .back { transform: rotateY(180deg); border-radius: 8px 0 0 8px; box-shadow: inset -22px 0 30px -22px rgba(0,0,0,.35); }
.book .flip.go { visibility: visible; animation: flip 1.25s cubic-bezier(.55,.05,.35,1) forwards; }
@keyframes flip { 0% { transform: rotateY(0) } 100% { transform: rotateY(-180deg) } }
.hero-cover { position: absolute; right: -3%; bottom: -2%; width: 27%; border-radius: 10px; box-shadow: var(--shadow); transform: rotate(6deg); border: 5px solid var(--paper); animation: bob2 9s ease-in-out infinite; z-index: 6; transition: opacity .5s; }
.book.closed ~ .hero-cover { opacity: 0; }
@keyframes bob2 { 0%, 100% { transform: rotate(6deg) translateY(0) } 50% { transform: rotate(7deg) translateY(-12px) } }
.stamp { position: absolute; left: -2%; top: 0; background: var(--gold); color: #2a1e08; padding: .55rem 1rem; border-radius: 999px; font-weight: 800; transform: rotate(-7deg); box-shadow: 0 10px 30px -10px var(--gold); z-index: 7; font-size: .95rem; }

/* ---------------- how it works ---------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 2rem; }
.step { position: relative; padding: 1.8rem 1.6rem 1.6rem; border-radius: 22px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--rule); overflow: hidden; }
.step .n { position: absolute; right: 1rem; top: .2rem; font-family: var(--display); font-size: 5rem; color: rgba(232,185,90,.14); line-height: 1; font-style: italic; }
.step h3 { color: var(--gold-2); }
.step p { color: var(--cream-soft); margin: 0; }
/* each step's picture shows that step, all from the example book */
.step-art { position: relative; aspect-ratio: 16/10; border-radius: 14px; margin-bottom: 1.1rem; background: var(--paper); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.step-art.s1 { gap: 4%; padding: 6% 7%; background: linear-gradient(135deg, #f7f1e4, #ece3d0); }
.step-art.s1 .snap { height: 82%; aspect-ratio: 3/4; object-fit: cover; border: 5px solid #fff; border-bottom-width: 18px; box-shadow: 0 12px 24px -12px rgba(0,0,0,.45); transform: rotate(-4deg); }
.step-art.s1 .arrow { font-family: var(--display); font-style: italic; font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--coral); }
.step-art.s1 .char { height: 92%; aspect-ratio: 1; object-fit: contain; }
.step-art.s2 { background: linear-gradient(135deg, #1b2440, #101830); }
.step-art.s2 img { position: absolute; height: 78%; aspect-ratio: 210/297; object-fit: cover; border-radius: 6px; box-shadow: 0 16px 30px -14px rgba(0,0,0,.8); }
.step-art.s2 img:nth-child(1) { transform: translateX(-62%) rotate(-10deg); opacity: .9; }
.step-art.s2 img:nth-child(3) { transform: translateX(62%) rotate(10deg); opacity: .9; }
.step-art.s2 img:nth-child(2) { z-index: 2; height: 86%; box-shadow: 0 0 0 3px var(--gold), 0 20px 36px -14px rgba(0,0,0,.9); }
.step-art.s3 { background: radial-gradient(ellipse at 50% 120%, rgba(232,185,90,.35), transparent 60%), linear-gradient(135deg, #f7f1e4, #ece3d0); perspective: 900px; }
.step-art.s3 .bookcover { height: 84%; aspect-ratio: 210/297; object-fit: cover; border-radius: 3px 8px 8px 3px; transform: rotateY(-18deg); box-shadow: -10px 0 0 -2px #e8e0cf, -12px 0 0 -2px #cfc5b0, 18px 24px 34px -14px rgba(0,0,0,.55); }
.step-art.s3 .tag { position: absolute; right: 6%; bottom: 7%; background: var(--gold); color: #2a1e08; font-weight: 800; font-size: .8rem; padding: .35rem .7rem; border-radius: 999px; box-shadow: 0 8px 20px -8px var(--gold); }

/* ---------------- story covers ---------------- */
.tfilter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 1.6rem; }
.tfilter button { font: inherit; font-weight: 700; font-size: .9rem; color: var(--cream-text); background: transparent; border: 0; cursor: pointer;
  padding: .5rem 1rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--rule); transition: box-shadow .15s, color .15s; }
.tfilter button:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold-2); }
.tfilter button.on { background: var(--gold); color: #2a1e08; box-shadow: none; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; }
.tcard { position: relative; display: block; aspect-ratio: 3 / 4.1; border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--cream-text);
  box-shadow: 0 18px 36px -18px rgba(0,0,0,.85); transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; background: var(--night-2); }
.tcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16,22,39,0) 40%, rgba(16,22,39,.55) 68%, rgba(16,22,39,.95) 100%); }
.tcard:hover { transform: translateY(-8px); box-shadow: 0 30px 44px -18px rgba(0,0,0,.9); }
.tcard:hover img { transform: scale(1.05); }
.tcard .ages { position: absolute; top: .8rem; left: .8rem; z-index: 2; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #2a1e08; background: var(--gold); padding: .25rem .6rem; border-radius: 999px; }
.tcard .tcap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 1rem 1.1rem 1.1rem; }
.tcard h3 { font-size: 1.25rem; line-height: 1.1; margin: 0 0 .3rem; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.tcard p { font-size: .82rem; line-height: 1.35; margin: 0; color: var(--cream-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard[hidden] { display: none; }

/* ---------------- three looks ---------------- */
.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2rem; }
.look { border-radius: 22px; overflow: hidden; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); transition: transform .25s; }
.look:hover { transform: translateY(-8px); }
.look img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.look div { padding: 1.1rem 1.3rem 1.3rem; }
.look h3 { margin-bottom: .2rem; }
.look p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* ---------------- example spreads ---------------- */
.spread { display: grid; grid-template-columns: 1fr 1fr; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); margin: 1.4rem 0; background: var(--paper); color: var(--ink); }
.spread .text { padding: 2.6rem; display: flex; align-items: center; font-family: "Gelasio", Georgia, serif; font-size: 1.1rem; line-height: 1.5; }
.spread .text p { margin: 0 0 .8em; }
.spread img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 3/4; }
.spread.flip .text { order: 2; }

/* ---------------- pricing ---------------- */
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 2rem; }
.price-card { position: relative; border-radius: 24px; padding: 2rem; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.price-card.dark { background: var(--night-3); color: var(--cream-text); box-shadow: inset 0 0 0 1px var(--rule), var(--shadow); }
.price-card.dark .ticks li::before { color: var(--gold-2); }
.price-card .ribbon { position: absolute; top: 1.2rem; right: -.6rem; background: var(--gold); color: #2a1e08; padding: .35rem .9rem; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border-radius: 6px 0 0 6px; box-shadow: 0 8px 20px -8px var(--gold); }
.price { font-family: var(--display); font-size: 3rem; font-weight: 600; }
.price small { font-size: 1rem; font-family: var(--body); opacity: .7; font-weight: 600; }
.ticks { list-style: none; padding: 0; margin: 1rem 0 1.4rem; }
.ticks li { padding-left: 1.6rem; position: relative; margin: .4rem 0; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--moss); font-weight: 900; }

/* ---------------- paper panels (forms, editor) ---------------- */
.panel { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 1.6rem; position: relative; box-shadow: var(--shadow-paper); }
.panel .hint { color: var(--ink-soft); }
.panel .eyebrow { color: #8a6a2a; }
.panel h3 { color: var(--ink); }
form.create { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 1.6rem; }
form.create .full { grid-column: 1 / -1; }
label { display: block; font-weight: 700; margin-bottom: .35rem; }
input[type=text], input[type=number], input[type=email], input[type=search], textarea, select {
  width: 100%; padding: .85rem 1rem; border-radius: 12px; border: 1.5px solid rgba(42,35,48,.12); background: #fffdf8; font: inherit; color: var(--ink); }
input:focus, textarea:focus { outline: 2px solid rgba(232,185,90,.6); border-color: var(--gold); }
.drop { border: 2px dashed rgba(232,185,90,.55); border-radius: 18px; padding: 1.6rem; text-align: center; background: rgba(232,185,90,.06); cursor: pointer; color: var(--cream-text); }
.drop .hint { color: var(--cream-soft); }
.drop img { max-height: 220px; border-radius: 12px; display: none; margin: .8rem auto 0; }
.drop.has img { display: block; }
.person { margin-bottom: 1rem; }
.person-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .4rem; }
.person-row input[type=text] { flex: 1; }
.person input.look { font-size: .9rem; }
.person-row .btn.ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(42,35,48,.2); }

/* create page: theme + style pickers reuse the shelf and looks */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin: 0 0 .5rem; }
.theme { display: block; color: var(--cream-text); padding: 1.1rem 1.2rem; border-radius: 16px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--rule); position: relative; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.theme:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--gold); }
.theme h3 { margin-bottom: .25rem; padding-right: 5rem; font-size: 1.15rem; }
.theme p { color: var(--cream-soft); font-size: .92rem; margin: 0; }
.theme .ages { position: absolute; top: .9rem; right: .9rem; font-size: .7rem; font-weight: 800; color: var(--gold); background: rgba(232,185,90,.14); padding: .2rem .55rem; border-radius: 999px; }
.theme input { position: absolute; opacity: 0; }
.theme.selected { box-shadow: 0 0 0 2.5px var(--gold), var(--shadow); background: var(--night-3); }

/* progress */
.progress { text-align: center; padding: 5rem 0; }
.pages { display: flex; gap: .5rem; justify-content: center; margin: 1.6rem 0; }
.pages span { width: 18px; height: 26px; border-radius: 3px; background: var(--night-3); animation: flip2 1.6s ease-in-out infinite; }
.pages span:nth-child(2){animation-delay:.15s}.pages span:nth-child(3){animation-delay:.3s}.pages span:nth-child(4){animation-delay:.45s}.pages span:nth-child(5){animation-delay:.6s}
@keyframes flip2 { 0%,100% { transform: scaleX(1); background: var(--night-3) } 50% { transform: scaleX(.15); background: var(--gold) } }
.status-line { font-family: var(--display); font-size: 1.6rem; color: var(--gold-2); }
.notice { background: rgba(143,183,214,.14); border-left: 4px solid var(--sky); padding: .8rem 1rem; border-radius: 0 12px 12px 0; }
.panel .notice { background: rgba(143,183,214,.22); }

/* book editor */
.bookhead { display: grid; grid-template-columns: 300px 1fr; gap: 2.4rem; align-items: center; margin: 2rem 0; }
.bookhead img { width: 100%; border-radius: 16px; box-shadow: var(--shadow); border: 6px solid var(--paper); }
.inline-form { display: flex; gap: .6rem; align-items: center; margin: .4rem 0 .8rem; }
.inline-form input { max-width: 22rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.page-card { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; margin: 1.6rem 0; padding: 1.4rem; }
.page-card textarea { min-height: 11rem; font-family: "Gelasio", Georgia, serif; font-size: 1.05rem; line-height: 1.55; }
.page-card .pic { position: relative; }
.page-card .pic img { width: 100%; border-radius: 14px; display: block; }
.page-card .pic .act { position: absolute; bottom: .8rem; right: .8rem; }
.pagenum { font-size: .75rem; font-weight: 800; color: #8a6a2a; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .6rem; }
.saved { color: #4c6a3b; font-weight: 700; font-size: .9rem; margin-left: .6rem; }
.htmx-request .btn { opacity: .5; cursor: wait; }
.htmx-indicator { display: none; } .htmx-request .htmx-indicator { display: inline; }
.buy { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin: 3rem 0; }
.panel .btn.ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(42,35,48,.2); }
.panel .btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }

/* a text page drawn the way it prints */
.pageview { position: relative; aspect-ratio: 210 / 297; border-radius: 14px; overflow: hidden; background: #fbf6ec; box-shadow: var(--shadow-paper); color: var(--ink); }
.pageview .wash { position: absolute; inset: -12%; background-size: cover; background-position: center; filter: blur(28px) saturate(1.05); opacity: .32; }
.pageview { container-type: inline-size; }
.pageview .words { position: absolute; left: 12%; right: 11%; top: 50%; transform: translateY(-50%); font-family: "Gelasio", Georgia, serif; font-size: calc(3.9cqi * var(--scale, 1)); line-height: 1.48; }
.pageview .words p { margin: 0 0 .8em; }
.pageview .rule { width: 2.4rem; height: 1.5px; background: var(--accent); margin-bottom: 1em; position: relative; }
.pageview .rule::after { content: ""; position: absolute; right: -.7rem; top: -.2rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.pageview .pnum { position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%); width: 1.3rem; height: 1.3rem; border-radius: 50%; color: #fff; font-size: .6rem; font-weight: 800; display: grid; place-items: center; }
.pageview .editbtn { position: absolute; right: .8rem; bottom: .8rem; background: rgba(251,246,236,.92); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(42,35,48,.2); }

/* reader */
.reader-top { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 1rem; }
.spread-page { display: none; grid-template-columns: 1fr 1fr; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--paper); color: var(--ink); }
.spread-page.on { display: grid; }
.spread-page.single { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
.spread-page .picture { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 210/297; -webkit-user-drag: none; user-select: none; }
.pageview.flat { border-radius: 0; box-shadow: none; }
.paper { aspect-ratio: 210/297; background: var(--paper); position: relative; }
.paper .words.centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; font-family: "Gelasio", Georgia, serif; }
.paper .sheet { width: 55%; border-radius: 12px; margin-top: 1rem; box-shadow: var(--shadow-paper); }
.reader-nav { display: flex; justify-content: space-between; margin: 1.2rem 0 3rem; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--rule); }

footer { padding: 3rem 0 4rem; color: var(--cream-soft); font-size: .9rem; border-top: 1px solid var(--rule); margin-top: 2rem; }

@media (max-width: 860px) {
  .hero, .steps, .pricing, .spread, form.create, .bookhead, .page-card, .buy, .spread-page { grid-template-columns: 1fr; }
  .looks { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 0; padding-bottom: 3rem; }
  .hero-cover { display: none; }
  .nav a.link:not(:last-child) { display: none; }
  .brand { font-size: 1.35rem; gap: .55rem; }
  .brand .mark { width: 2.3rem; height: 2.3rem; }
  .bk { flex-basis: 132px; }
}

/* locked pages on a preview book */
.locked { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin: 1.6rem 0; padding: 1.8rem; border-radius: 22px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--rule); }
.locked h3 { color: var(--gold-2); }
.locked-words { max-height: 22rem; overflow: hidden; position: relative; font-family: "Gelasio", Georgia, serif; color: var(--cream-soft); font-size: .95rem; line-height: 1.5; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.locked-words p { margin: 0 0 .9em; }
.locked-words .pagenum { display: block; color: var(--gold); margin-bottom: .2rem; }
@media (max-width: 860px) { .locked { grid-template-columns: 1fr; } }

/* legal pages */
.legal { max-width: 52rem; margin: 1.5rem auto 3rem; padding: 2.4rem clamp(1.2rem, 4vw, 3rem); }
.legal h2 { font-size: 1.5rem; margin: 2rem 0 .6rem; color: var(--ink); }
.legal h3 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; color: #8a6a2a; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: .45rem 0; }
.legal .fill { background: rgba(232,185,90,.25); border-bottom: 1.5px dashed #8a6a2a; padding: 0 .2rem; }

/* help centre */
.help-cats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.help-cats a { text-decoration: none; color: var(--cream-text); font-weight: 600; font-size: .9rem; padding: .45rem .9rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--rule); }
.help-cats a:hover { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold-2); }
.help-group { margin: 2.2rem 0; }
.help-group h2 { font-size: 1.6rem; margin-bottom: .2rem; }
.faq { border-top: 1px solid var(--rule); }
.faq:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: .9rem 2rem .9rem 0; font-weight: 700; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .4rem; top: .7rem; color: var(--gold); font-size: 1.4rem; font-weight: 400; transition: transform .2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 0 1.1rem; color: var(--cream-soft); max-width: 46rem; line-height: 1.6; }

.help-cats[hidden] { display: none; }

/* about */
.about-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; padding: 2rem 0 3rem; }
.about-art { position: relative; aspect-ratio: 1; }
.about-art img { position: absolute; border-radius: 16px; box-shadow: var(--shadow); border: 5px solid var(--paper); object-fit: cover; }
.about-art .a { width: 70%; height: 82%; left: 0; top: 0; transform: rotate(-3deg); }
.about-art .b { width: 46%; aspect-ratio: 1; right: 0; bottom: 0; transform: rotate(5deg); }
.about-story { max-width: 46rem; margin: 0 auto; padding: 2.4rem clamp(1.2rem, 4vw, 3rem); font-size: 1.08rem; line-height: 1.7; }
.about-story h2 { font-size: 1.9rem; }
.about-story .fill { background: rgba(232,185,90,.25); border-bottom: 1.5px dashed #8a6a2a; padding: 0 .2rem; }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 1.6rem; }
.value { padding: 1.6rem; border-radius: 20px; background: var(--night-2); box-shadow: inset 0 0 0 1px var(--rule); }
.value h3 { color: var(--gold-2); font-size: 1.25rem; }
.value p { color: var(--cream-soft); margin: 0; }
.about-how { max-width: 46rem; font-size: 1.08rem; line-height: 1.7; color: var(--cream-soft); }
.about-cta { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 2rem; border-radius: 22px; background: var(--night-3); box-shadow: inset 0 0 0 1px var(--rule); }
@media (max-width: 860px) { .about-hero, .values { grid-template-columns: 1fr; } .about-art { display: none; } .about-cta { flex-direction: column; align-items: flex-start; } }

/* create page: story picker with covers */
.theme.tpick { padding: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.theme.tpick img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.theme.tpick > div { padding: .9rem 1.1rem 1.1rem; }
.theme.tpick h3 { padding-right: 0; font-size: 1.1rem; }
.theme.tpick .ages { top: .7rem; right: .7rem; background: var(--gold); color: #2a1e08; }

/* example: photo -> character -> book, then a strip of spreads */
.journey { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 1rem; align-items: center; max-width: 820px; margin: 2rem auto 2.4rem; }
.jstep { text-align: center; }
.jstep img, .jphoto { width: 100%; max-width: 200px; aspect-ratio: 1; object-fit: cover; border-radius: 16px; margin: 0 auto .7rem; box-shadow: var(--shadow); display: block; background: var(--paper); }
.jphoto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--ink-soft); border: 2px dashed rgba(42,35,48,.25); font-weight: 700; font-size: .9rem; }
.jphoto svg { width: 44%; }
.jstep p { margin: 0; color: var(--cream-soft); font-size: .95rem; }
.jarrow { font-family: var(--display); font-size: 2rem; color: var(--gold); }
.strip-wrap { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; }
.strip { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: .6rem .2rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(232,185,90,.35) transparent; }
.strip::-webkit-scrollbar { height: 6px; } .strip::-webkit-scrollbar-thumb { background: rgba(232,185,90,.35); border-radius: 3px; }
.mini { flex: 0 0 min(78vw, 440px); scroll-snap-align: center; display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.414; border-radius: 12px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow); position: relative; }
.mini-text { padding: 9% 8%; font-family: "Gelasio", Georgia, serif; color: var(--ink); font-size: clamp(.55rem, 1.05vw, .8rem); line-height: 1.4; display: flex; flex-direction: column; justify-content: center; box-shadow: inset -14px 0 20px -16px rgba(0,0,0,.3); }
.mini-text p { margin: 0 0 .6em; }
.mini-text .rule { width: 1.6rem; height: 1.5px; background: var(--accent, var(--coral)); margin-bottom: .8em; }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-no { position: absolute; bottom: .4rem; left: 50%; transform: translateX(-50%); font-size: .6rem; font-weight: 800; color: var(--ink-soft); background: rgba(247,239,223,.85); padding: .1rem .5rem; border-radius: 999px; }
.strip-btn { font: inherit; font-size: 1.2rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; cursor: pointer; background: var(--night-3); color: var(--gold-2); box-shadow: inset 0 0 0 1.5px var(--rule); }
.strip-btn:hover { box-shadow: inset 0 0 0 1.5px var(--gold); }
@media (max-width: 860px) {
  .journey { grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
  .jarrow { display: none; }
  .strip-wrap { grid-template-columns: 1fr; } .strip-btn { display: none; }
}

.jstep .jsnap { border: 6px solid #fff; transform: rotate(-3deg); }

/* photo guidance on the create page */
.phototip { background: var(--paper); color: var(--ink); border-radius: 22px; padding: 1.6rem 1.4rem 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow-paper); text-align: center; }
.phototip-lead { font-family: var(--display); font-size: 1.3rem; line-height: 1.3; margin: 0 auto 1.3rem; max-width: 30rem; }
.phototip-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; max-width: 34rem; margin: 0 auto 1.2rem; }
.phototip-pair figure { margin: 0; }
.phototip-pair .frame { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 14px 28px -16px rgba(20,15,30,.6); }
.phototip-pair img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.phototip-pair .badge { position: absolute; top: .6rem; left: .6rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; box-shadow: 0 6px 14px -6px rgba(0,0,0,.6); }
.phototip-pair .good .badge { background: var(--moss); }
.phototip-pair .bad .badge { background: var(--coral); }
.phototip-pair .good .frame { outline: 3px solid var(--moss); outline-offset: 2px; }
.phototip-pair .bad .frame { outline: 3px solid var(--coral); outline-offset: 2px; }
.phototip-pair figcaption { font-size: .88rem; line-height: 1.4; margin-top: .7rem; color: var(--ink-soft); }
.phototip-pair figcaption strong { display: block; color: var(--ink); font-size: .95rem; margin-bottom: .15rem; }
.phototip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.phototip-list li { font-size: .84rem; font-weight: 600; color: var(--ink); background: rgba(232,185,90,.22); padding: .35rem .8rem; border-radius: 999px; }
@media (max-width: 600px) { .phototip-pair { gap: .8rem; } .phototip-lead { font-size: 1.1rem; } }

/* extras */
.extras { padding-top: 0; }
.pagepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .5rem; margin: .6rem 0; }
.pagepick label { margin: 0; position: relative; cursor: pointer; }
.pagepick img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; display: block; opacity: .55; transition: opacity .15s, outline .15s; }
.pagepick input { position: absolute; top: .3rem; left: .3rem; width: auto; margin: 0; z-index: 1; }
.pagepick input:checked + img { opacity: 1; outline: 3px solid var(--moss); outline-offset: 1px; }


/* ---------------- coming soon ---------------- */
body.soon { min-height: 100vh; display: grid; place-items: center; }
.soon-wrap { display: grid; justify-items: center; gap: 2.2rem; text-align: center; padding: 2rem 1rem; }
.soon-wrap h1 { font-size: clamp(2.8rem, 8vw, 5.5rem); margin: 0; }
