/* Santa's Lost Present landing page (v2.1)
   One continuous night from top to bottom: the sky is fixed, every piece of scenery fades
   into it on all sides, and no section paints a background of its own, so there are no seams. */

/* =========================================================
   0. The night shifts as you scroll: a dusky glow at the top, a warm hearth glow at the end
   ========================================================= */
.sky-shift { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.sky-shift > span { position: absolute; inset: 0; }
.sky-shift-dusk { background: radial-gradient(75% 60% at 82% -4%, #6d3b7c52, transparent 72%); opacity: var(--dusk, 1); }
.sky-shift-hearth { background: radial-gradient(95% 62% at 50% 108%, #f0a56a2e, #b0609a14 48%, transparent 78%); opacity: var(--hearth, 0); }

/* =========================================================
   1. Buy: the title across the top, then the order card and the book, level with each other
   ========================================================= */
.buy { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + clamp(.3rem, 1.6svh, 1.2rem)) 0 clamp(1.2rem, 4svh, 3rem); }
.buy-art {
  position: absolute; inset: 0 0 -18svh; z-index: -1; overflow: hidden; pointer-events: none;
  /* the village melts into the night well below the fold, so there is no edge before the next scene */
  -webkit-mask-image: linear-gradient(#000 56%, transparent 96%); mask-image: linear-gradient(#000 56%, transparent 96%);
}
.sky-halo { position: absolute; right: -16%; top: -44%; width: min(88vw, 76rem); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, #ffd9a024, #c08ad012 52%, transparent); }
.village-wrap { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(90deg, #0000 4%, #000c 30%, #000 52%); mask-image: linear-gradient(90deg, #0000 4%, #000c 30%, #000 52%); } /* the order card sits on open sky, the book sits in the village */
.v-village {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 8% 100%;
  transform: scaleX(-1); filter: saturate(.76) brightness(.5);
  -webkit-mask-image: linear-gradient(transparent 42%, #000 76%); mask-image: linear-gradient(transparent 42%, #000 76%);
}
.moon { position: absolute; z-index: 1; right: max(3rem, 7.5vw); top: calc(var(--header-h) + 1.5rem); width: clamp(2.6rem, 3.5vw, 3.4rem); aspect-ratio: 1; }
.moon::before { content: ""; position: absolute; inset: -150%; border-radius: 50%; background: radial-gradient(closest-side, #ffe2b03d, #ffe2b012 45%, transparent); animation: moon-glow 7s ease-in-out infinite; }
.moon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 40%, #fffaf0, #ffe6bc 55%, #f0c48c);
  -webkit-mask: radial-gradient(circle at 76% 28%, transparent 49.4%, #000 51%); mask: radial-gradient(circle at 76% 28%, transparent 49.4%, #000 51%);
}
@keyframes moon-glow { 50% { opacity: .6; transform: scale(.9); } }
.v-sleigh { position: absolute; z-index: 1; left: 0; top: 0; width: clamp(6.5rem, 9vw, 9.5rem); opacity: 0; visibility: hidden; }
.v-sleigh img, .f-sleigh img { width: 100%; filter: drop-shadow(0 .3rem .4rem #0b041466); }
.snow { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

.buy-inner { position: relative; z-index: 3; }
.buy-head { margin-bottom: clamp(.9rem, 2.6svh, 1.7rem); }
.buy-head .kicker { margin-bottom: .45rem; }
/* One line, always */
.buy-title { font-size: clamp(2.5rem, 4.5vw, 4.4rem); line-height: 1.04; white-space: nowrap; text-shadow: 0 .2rem 1.6rem #12081f; }
.buy-intro { margin: .45rem 0 0; color: var(--mist); font-size: 1.06rem; }
/* The card and the book share a top edge and a bottom edge */
.buy-grid { display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: stretch; }
.buy-copy, .order-anchor { display: flex; flex-direction: column; min-width: 0; }
.order-anchor, .santa-order { flex: 1 1 auto; }
.order-anchor { scroll-margin-top: calc(var(--header-h) + 1rem); outline: none; }
@media (min-width: 901px) { .order-anchor { scroll-margin-top: 100vh; } } /* arriving at #personalise keeps the one-screen hero whole */

/* Order card */
.santa-order {
  position: relative; width: 100%; display: flex; flex-direction: column;
  padding: clamp(1.05rem, 1.8vw, 1.4rem);
  border-radius: 1.2rem;
  background: linear-gradient(160deg, #3a2550f0, #23142ff2);
  box-shadow: inset 0 0 0 1px #f6bf7838, inset 0 1px 0 #fff1db1f, 0 1.6rem 3rem -1.2rem #0b0414e6;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
/* A ring of lamplight when someone arrives from a "Create their book" button */
.santa-order::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; }
.santa-order.is-arrived::after { animation: card-ring 1.5s var(--ease-out); }
@keyframes card-ring {
  0% { opacity: 1; box-shadow: 0 0 0 0 #ffd99ccc, 0 0 1.4rem #f6bf7866; }
  100% { opacity: 0; box-shadow: 0 0 0 .9rem #ffd99c00, 0 0 3.2rem #f6bf7800; }
}
.santa-order p { margin: 0; }
.santa-order [hidden], .product-photo-dialog:not([open]) { display: none !important; }
.order-banner { color: var(--lamp-hot); font-size: .92rem; }
.santa-order[data-mode="loading"] .order-banner::before { content: ""; display: inline-block; width: .7rem; height: .7rem; margin-right: .55rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -.05rem; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* The fields spread evenly down the card, so its foot lines up with the foot of the book */
.santa-order-form { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; gap: .8rem; }
.order-result { margin-block: auto; }
.order-finish { display: grid; gap: .55rem; }

/* Softback or hardback first. Each price is the whole price: delivery is already in it, so nothing is added at checkout */
.order-formats { min-width: 0; margin: 0; padding: 0 0 .75rem; border: 0; border-bottom: 1px solid #f6bf7830; }
.order-format-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .6rem; }
.order-format-option {
  position: relative; display: grid; gap: .2rem; padding: .62rem .8rem .66rem 2.35rem; border-radius: .95rem;
  background: #160b2280; box-shadow: inset 0 0 0 1.5px #d7b9e03d; cursor: pointer;
  transition: background .35s, box-shadow .35s; -webkit-tap-highlight-color: transparent;
}
.order-format-option input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.order-format-option::before { content: ""; position: absolute; left: .85rem; top: 50%; width: 1.05rem; height: 1.05rem; margin-top: -.525rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #d7b9e09c; transition: box-shadow .35s, background .35s; }
.order-format-name { color: #eadcf2; font-size: .86rem; font-weight: 650; line-height: 1.15; }
.order-format-price { color: var(--ivory); font: 400 1.5rem/1 var(--serif); font-variant-numeric: tabular-nums; transition: color .35s; }
@media (hover: hover) { .order-format-option:hover { background: #ffffff0d; box-shadow: inset 0 0 0 1.5px #d7b9e077; } }
.order-format-option.is-chosen { background: #f6bf7817; box-shadow: inset 0 0 0 1.5px var(--lamp-hot), 0 0 1.5rem -.45rem #f6bf7899; }
.order-format-option.is-chosen::before { background: radial-gradient(circle, #2a1530 0 27%, transparent 30%), linear-gradient(#ffe5b5, #f1b25c); box-shadow: 0 0 .7rem #f6bf7899; }
.order-format-option.is-chosen .order-format-price { color: var(--lamp-hot); }
.order-format-option:focus-within { outline: 2px solid var(--lamp-hot); outline-offset: 3px; }
.order-format-option:focus-within:not(:has(:focus-visible)) { outline: none; }
.order-notes { display: flex; flex-wrap: wrap; align-items: center; column-gap: 1.1rem; row-gap: .35rem; margin-top: .55rem; }
.order-formats .order-delivery { display: flex; align-items: center; gap: .45rem; color: #d6c3e0; font-size: .82rem; font-weight: 600; white-space: normal; }
.order-formats .order-delivery::before { content: ""; flex: none; width: .95rem; height: .95rem; background: var(--lamplight); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h11v9H3zM14 9h4l3 3v3h-7zM6.5 18.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm11 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h11v9H3zM14 9h4l3 3v3h-7zM6.5 18.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm11 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/%3E%3C/svg%3E") center / contain no-repeat; }
.order-when { display: flex; align-items: center; gap: .45rem; color: var(--lamp-hot); font-size: .82rem; font-weight: 650; }
.order-when::before { content: ""; flex: none; width: .8rem; height: .8rem; background: var(--lamp-hot); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.order-delivery:empty { display: none; }

/* Two numbered steps: their name, then their photo */
.order-field > label { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; color: var(--ivory); font-size: .92rem; font-weight: 650; }
.order-step { display: inline-grid; place-items: center; flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: linear-gradient(#ffe5b5, #f1b25c); color: #2a1530; font: 700 .74rem/1 var(--sans); box-shadow: 0 0 .8rem #f6bf7850; }
.santa-order .name-form input {
  display: block; width: 100%; min-height: 3rem; padding: .6rem .95rem;
  border: 0; border-radius: .75rem; background: #160b22b3; color: var(--ivory);
  font: 400 1.35rem/1.2 var(--serif);
  box-shadow: inset 0 0 0 1.5px #d7b9e055; transition: box-shadow .35s;
}
.santa-order .name-form input::placeholder { color: #b9a4c6; }
.santa-order .name-form input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--lamp-hot), 0 0 1.6rem -.3rem #f6bf7870; }
.santa-order .name-form input.is-invited { animation: invite 1.6s var(--ease-out); }
@keyframes invite { 0% { box-shadow: inset 0 0 0 1.5px var(--lamp-hot), 0 0 0 0 #ffd99caa; } 100% { box-shadow: inset 0 0 0 1.5px #d7b9e055, 0 0 0 .8rem #ffd99c00; } }
.order-hint { display: flex; align-items: center; gap: .45rem; margin-top: .45rem !important; color: #d6c3e0; font-size: .82rem; }
.order-hint::before { content: ""; flex: none; width: .8rem; height: .8rem; background: var(--lamp-hot); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }

.order-photo { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.order-photo-picker {
  position: relative; display: inline-flex; align-items: center; gap: .7rem; min-height: 3.1rem; padding: .3rem 1.15rem .3rem .3rem;
  border-radius: 999px; background: #fff1db12; box-shadow: inset 0 0 0 1.5px #fff1db40; color: var(--ivory);
  font-size: .95rem; font-weight: 650; cursor: pointer; transition: background .3s, box-shadow .3s;
}
.order-photo-picker:hover { background: #fff1db22; box-shadow: inset 0 0 0 1.5px #fff1dbaa; }
.order-photo-picker:focus-within { outline: 2px solid var(--lamp-hot); outline-offset: 3px; }
.order-photo-picker input { position: absolute; inset: 0; z-index: 2; opacity: 0; cursor: pointer; font-size: 0; }
/* The paper doll's face waits where their photo will go */
.order-photo-face { position: relative; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; overflow: hidden; background: #3b2752; box-shadow: 0 0 0 1.5px #fff1db55; }
.order-photo-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.order-photo-thumbnail { animation: photo-in .8s var(--ease-out); }
@keyframes photo-in { from { opacity: 0; transform: scale(1.3); } }
.order-photo-links { display: flex; gap: .9rem; }
/* The written confirmation after paying */
.order-confirmation { margin: .4rem 0 .8rem; text-align: left; }
.order-confirmation p { margin: 0 0 .55rem !important; font-size: .88rem !important; }
.order-confirmation .order-confirmation-small { color: #c4b0d1 !important; font-size: .78rem !important; }
.order-confirmation a { color: inherit; }
/* The no-cancel notice the law wants beside the pay button (and the after-Christmas line) */
.order-terms-note { margin: 0 0 .75rem; color: #d6c3e0; font-size: .8rem; line-height: 1.45; text-align: center; }
.order-terms-note strong { color: var(--ivory); font-weight: 650; }
.order-preview-note { margin-bottom: .45rem; color: var(--mist); }
.order-terms-note .order-terms-after { display: block; margin-bottom: .2rem; color: var(--lamp-hot); font-size: .95rem; }
.order-text-button { padding: .2rem 0; border: 0; background: none; color: var(--lamp-hot); font-size: .9rem; font-weight: 650; text-decoration: underline; text-underline-offset: .22em; cursor: pointer; }
.order-text-button:hover { color: #fff; }
.order-note { color: #d6c3e0; font-size: .84rem; line-height: 1.45; margin-top: .4rem !important; }
.order-note:empty { display: none; }
.order-authorisation { display: flex; gap: .7rem; align-items: flex-start; color: #eadcf2; font-size: .88rem; line-height: 1.45; cursor: pointer; }
.order-authorisation input { flex: none; margin: .15rem 0 0; width: 1.15rem; height: 1.15rem; accent-color: var(--lamplight); }
.order-error { padding: .6rem .8rem; border-radius: .7rem; background: #5a1f3a; box-shadow: inset 0 0 0 1px #ff9fb655; color: #ffe1e8; font-size: .88rem; }
.order-pay { width: 100%; min-height: 3.35rem; font-size: 1.02rem; }
.order-pay:disabled { opacity: .55; cursor: progress; transform: none; }
/* Every so often a glint of light runs across the main button */
.order-pay:not(:disabled)::before, .sticky-buy-btn::before {
  content: ""; position: absolute; z-index: -1; inset: -20% auto -20% -60%; width: 40%;
  background: linear-gradient(100deg, transparent, #fffbe9b3, transparent);
  transform: skewX(-18deg) translateX(-120%); animation: glint 7s var(--ease-soft) 3s infinite;
}
.santa-order.is-arrived .order-pay::before { animation: glint-once 1.1s var(--ease-out) .35s; }
@keyframes glint { 0%, 82% { transform: skewX(-18deg) translateX(-120%); } 100% { transform: skewX(-18deg) translateX(560%); } }
@keyframes glint-once { from { transform: skewX(-18deg) translateX(-120%); } to { transform: skewX(-18deg) translateX(560%); } }
/* Reassurance and the policies, on one line right under the button */
.order-trust { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .2rem .5rem; margin: 0; color: #cdb8da; font-size: .8rem; }
.order-secure { display: inline-flex; align-items: center; gap: .4rem; }
.order-secure::before { content: ""; flex: none; width: .85rem; height: .85rem; background: var(--lamplight); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V8a5 5 0 0 1 10 0v2h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h1zm2 0h6V8a3 3 0 0 0-6 0v2z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V8a5 5 0 0 1 10 0v2h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h1zm2 0h6V8a3 3 0 0 0-6 0v2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.order-dot { opacity: .5; }
.order-trust a { color: #e6d3ee; text-decoration: underline; text-decoration-color: #e6d3ee66; text-underline-offset: .2em; }
.order-trust a:hover { color: var(--lamp-hot); text-decoration-color: currentColor; }
.order-result { position: relative; padding: .4rem 0 .2rem; text-align: center; }
.order-result h3 { color: var(--lamp-hot); font-size: 1.7rem; outline: none; }
.order-result p { margin: .5rem 0 .6rem !important; color: #eadcf2; font-size: .95rem; }
.order-result-star { display: block; width: 2.2rem; height: 2.2rem; margin: 0 auto .7rem; background: radial-gradient(#fff6e4, #ffd38e 55%, #e2915a); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); animation: star-spin 7s linear infinite; }
@keyframes star-spin { to { transform: rotate(360deg); } }

/* The book: the cover, the open book in front of it, and the controls underneath */
.purchase-preview { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(.6rem, 1.8svh, 1.1rem); min-width: 0; }
.product-display { position: relative; width: 100%; aspect-ratio: 100 / 54; }
.purchase-preview figure { margin: 0; }
.purchase-cover { position: absolute; left: 0; top: 0; width: 47%; z-index: 2; }
.purchase-spread {
  position: absolute; right: 0; top: 44.5%; width: 58%; z-index: 3;
  /* It leans back like a book on a table, and comes up to meet the pointer, like the cover does */
  --srx: 10deg; --sry: 0deg; --slift: 0px;
  --spread-tilt: perspective(1600px) rotateX(var(--srx)) rotateY(var(--sry)) rotateZ(-1deg) translateY(var(--slift));
}
@media (hover: hover) { .purchase-spread:hover { --srx: 4deg; --slift: -6px; } }
.pdf-preview-button { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: .3rem; -webkit-tap-highlight-color: transparent; }
.pdf-preview-button:focus-visible { outline-offset: .45rem; }
.pdf-cover { position: relative; display: block; }
.pdf-cover img, .pdf-spread img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.pdf-spread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.santa-jacket { transform: perspective(1500px) rotateY(var(--ry, 14deg)) rotateX(var(--rx, 2deg)) translateY(var(--lift, 0px)); transform-style: preserve-3d; transition: transform .9s var(--ease-out); }
@media (hover: hover) { .santa-jacket:hover { --ry: 4deg; --lift: -6px; } }
.santa-jacket .book-jacket { position: relative; overflow: hidden; border-radius: .2rem .55rem .55rem .2rem; background: #4a4060; box-shadow: .35rem .35rem 0 -.05rem #efe2d4, .55rem .55rem 0 -.05rem #cdb4a8, 0 2.2rem 3rem -1rem #0b0414f2; }
.santa-jacket .book-jacket::after { content: ""; position: absolute; z-index: 3; inset: 0; pointer-events: none; background: linear-gradient(90deg, #00000070, #0000 3.5%, #ffffff1c 5%, #0000 8%), linear-gradient(115deg, transparent 30%, #ffffff26 46%, transparent 60%); background-size: 100% 100%, 280% 100%; background-position: 0 0, 130% 0; animation: shine 7s ease-in-out infinite; }
@keyframes shine { 0%, 60% { background-position: 0 0, 130% 0; } 90%, 100% { background-position: 0 0, -40% 0; } }

/* The open book. Tap or click a page to turn it, swipe it, or use the arrows underneath. */
.reader-book { position: relative; display: block; transform: var(--spread-tilt); transition: transform .9s var(--ease-out); cursor: pointer; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.reader-book.is-dragging { transition: none; cursor: grabbing; }
.reader-book.at-start.on-left, .reader-book.at-end.on-right { cursor: default; }
.purchase-spread .pdf-spread { position: relative; overflow: hidden; border-radius: .3rem; background: #5a4250; box-shadow: 0 .2rem 0 #e8d6c6, 0 .4rem 0 #bfa294, 0 1.8rem 2.6rem -1rem #0b0414f0; }
.pdf-spread::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 44%, #1a0a2255 49.6%, #1a0a2288 50%, #1a0a2255 50.4%, transparent 56%); }
.pdf-spread img { -webkit-user-drag: none; }
/* A dog-eared corner says "turn me". It lifts further when the pointer is on that page. */
.reader-corner { position: absolute; z-index: 3; bottom: 0; width: 5.5%; aspect-ratio: 1; pointer-events: none; opacity: 0; transition: width .55s var(--ease-out), opacity .4s; }
.reader-corner--next { right: 0; border-radius: .55rem 0 .3rem 0; background: linear-gradient(315deg, #2b1a33 0 47%, #12061c80 49%, #d9c7b4 51%, #fff6ea 72%, #e8d8c6); }
.reader-corner--prev { left: 0; border-radius: 0 .55rem 0 .3rem; background: linear-gradient(45deg, #2b1a33 0 47%, #12061c80 49%, #d9c7b4 51%, #fff6ea 72%, #e8d8c6); }
.reader-book:not(.at-end) .reader-corner--next { opacity: 1; }
.reader-book:not(.at-end).on-right .reader-corner--next, .reader-book:not(.at-start).on-left .reader-corner--prev { width: 10%; opacity: 1; }
.reader-book.is-turning .reader-corner { opacity: 0; transition: none; }
.reader-zoom { position: absolute; z-index: 4; top: .55rem; right: .55rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 0; border-radius: 50%; background: #1d102bb8; color: var(--ivory); box-shadow: inset 0 0 0 1px #fff1db40; cursor: zoom-in; opacity: 0; transition: opacity .35s, background .3s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.reader-zoom svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.purchase-spread:hover .reader-zoom, .reader-zoom:focus-visible { opacity: 1; }
.reader-zoom:hover { background: #3a2450e6; }
@media (hover: none) { .reader-zoom { opacity: .9; } }
/* The last spread: the story carries on in their own book */
.reader-end { position: relative; display: grid; align-content: center; justify-items: center; aspect-ratio: 1; padding: 11%; container-type: inline-size; overflow: hidden; text-align: center; color: #fdf0e2; background: radial-gradient(120% 85% at 50% 28%, #46305f, #24152f 72%); }
.reader-end-star { width: 10cqw; aspect-ratio: 1; margin-bottom: 4.5cqw; background: radial-gradient(#fff6e4, #ffd38e 55%, #e2915a); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); filter: drop-shadow(0 0 2cqw #f6bf78); }
html[data-motion="on"] .reader-end-star { animation: star-spin 9s linear infinite; }
.reader-end-title { margin: 0; color: var(--lamp-hot); font: 400 10cqw/1.1 Baskerville, "Libre Baskerville", "Baskerville Old Face", Georgia, serif; }
.reader-end-text { margin: 3.5cqw 0 0; font: 400 6.2cqw/1.45 Baskerville, "Libre Baskerville", "Baskerville Old Face", Georgia, serif; }
.reader-end-link { margin-top: 6cqw; padding: 3.4cqw 6.5cqw; border-radius: 999px; background: linear-gradient(#ffe5b5, #f1b25c); color: #2a1530; font: 650 5.2cqw/1 var(--sans); text-decoration: none; box-shadow: 0 1cqw 3cqw #0007; }
.reader-end-link:hover { background: linear-gradient(#fff0cf, #f6c071); }

/* Under the book: whose book it is (under the cover), and turning the pages (under the open book) */
.preview-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 1rem; }
.edition-picker, .reader-nav { position: relative; z-index: 3; display: flex; align-items: center; border-radius: 999px; background: #1d102bc4; box-shadow: inset 0 0 0 1px #fff1db1f, 0 1rem 2rem -1.2rem #000; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.reader-nav { gap: .45rem; padding: .4rem .45rem .4rem 1.1rem; }
.reader-nav[hidden] { display: none; }
.reader-label, .edition-picker h2 { margin: 0; color: var(--lamplight); font: 600 .7rem/1.1 var(--sans); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }
.reader-label { margin-right: .3rem; }
.reader-arrow { position: relative; display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 50%; background: #fff1db12; color: var(--lamp-hot); box-shadow: inset 0 0 0 1.5px #ffd99c5c; cursor: pointer; transition: background .3s, box-shadow .3s, opacity .3s, transform .25s var(--ease-out); -webkit-tap-highlight-color: transparent; }
.reader-arrow svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease-out); }
@media (hover: hover) {
  .reader-arrow:not(:disabled):hover { background: #ffd99c26; box-shadow: inset 0 0 0 1.5px var(--lamp-hot), 0 0 1.1rem #f6bf7870; }
  .reader-arrow--next:not(:disabled):hover svg { transform: translateX(2px); }
  .reader-arrow--prev:not(:disabled):hover svg { transform: translateX(-2px); }
}
.reader-arrow:not(:disabled):active { transform: scale(.9); }
.reader-arrow:disabled { opacity: .28; cursor: default; }
/* Until the first page is turned, the forward arrow glows now and then, asking to be pressed */
.reader-arrow.is-inviting::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; animation: arrow-invite 3.2s ease-out 1.2s infinite; }
@keyframes arrow-invite { 0% { box-shadow: 0 0 0 0 #ffd99cb0; } 45%, 100% { box-shadow: 0 0 0 .65rem #ffd99c00; } }
.reader-dots { display: flex; align-items: center; gap: .36rem; padding: 0 .15rem; }
.reader-dots i { display: block; width: .42rem; height: .42rem; border-radius: 999px; background: #fff1db45; transition: width .55s var(--ease-out), background .45s, box-shadow .45s; }
.reader-dots i.is-on { width: 1.25rem; background: var(--lamp-hot); box-shadow: 0 0 .6rem #f6bf7899; }
.reader-nav.is-loading .reader-arrow:not(:disabled) { animation: pending 1s ease-in-out infinite; }

/* The child's name, written onto the make-your-own cover in the book's own typeface */
@font-face {
  font-family: "Libre Baskerville"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/libre-baskerville-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
.cover-name { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cover-name[hidden] { display: none; }
.cover-name text { fill: #fdf0e2; font-family: Baskerville, "Libre Baskerville", "Baskerville Old Face", Georgia, serif; font-size: 86px; font-weight: 400; text-anchor: middle; }
.cover-name.is-writing { animation: name-glow 1.3s var(--ease-out); }
@keyframes name-glow { from { filter: drop-shadow(0 0 7px #ffe2b0) drop-shadow(0 0 22px #f6bf78b0); } to { filter: drop-shadow(0 0 0 #ffe2b000) drop-shadow(0 0 0 #f6bf7800); } }

/* Changing the book: a comet of stars flies to it, the new cover opens inside a circle of light, a page turns */
.edition-layer { position: absolute; inset: 0; z-index: 2; display: block; }
.edition-layer img, .edition-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.edition-bloom { position: absolute; z-index: 2; left: var(--x, 62%); top: var(--y, 56%); width: 290%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, transparent 80%, #fff4dbd0 91%, #ffd99c5c 96%, transparent); }
.edition-shine { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.edition-shine > span { position: absolute; top: -10%; bottom: -10%; left: 0; width: 42%; background: linear-gradient(100deg, transparent, #fff6e04d 38%, #fffdf6b3 50%, #fff6e04d 62%, transparent); transform: translateX(-110%) skewX(-14deg); }
.edition-turn { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.edition-leaf { position: absolute; top: 0; width: 50%; height: 100%; transform-style: preserve-3d; }
.edition-leaf--next { left: 50%; transform-origin: 0 50%; }
.edition-leaf--prev { left: 0; transform-origin: 100% 50%; }
.edition-face { position: absolute; inset: 0; overflow: hidden; background: #5a4250; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.edition-face--back { transform: rotateY(180deg); }
.edition-face > .reader-end { width: 100%; height: 100%; }
.edition-face::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.edition-face.is-right { border-radius: 0 .3rem .3rem 0; }
.edition-face.is-left { border-radius: .3rem 0 0 .3rem; }
.edition-face.is-right::after { background: linear-gradient(90deg, #1a0a2288, #1a0a2255 .8%, transparent 12%); }
.edition-face.is-left::after { background: linear-gradient(270deg, #1a0a2288, #1a0a2255 .8%, transparent 12%); }
.edition-shade { position: absolute; inset: 0; z-index: 1; opacity: 0; }
.edition-face.is-right .edition-shade { background: linear-gradient(90deg, #14061ed0, #14061e40 45%, transparent 80%); }
.edition-face.is-left .edition-shade { background: linear-gradient(270deg, #14061ed0, #14061e40 45%, transparent 80%); }
.edition-cast { position: absolute; top: 0; width: 50%; height: 100%; opacity: 0; }
.edition-cast--next { left: 50%; background: linear-gradient(90deg, #12061cd9, #12061c38 50%, transparent 88%); }
.edition-cast--prev { left: 0; background: linear-gradient(270deg, #12061cd9, #12061c38 50%, transparent 88%); }
/* Stars, glitter and flares are drawn on one canvas over the page, only while they are flying */
.magic-layer { position: fixed; inset: 0; z-index: 95; width: 100%; height: 100%; pointer-events: none; }

/* Three faces, and a ring of lamplight that glides to the one you choose */
.edition-picker { gap: .75rem; padding: .34rem .5rem .34rem 1.1rem; }
.edition-picker[hidden] { display: none; }
.edition-options { position: relative; display: flex; gap: .35rem; }
.edition-ring { position: absolute; left: 0; top: 0; z-index: 0; width: 3.4rem; height: 3.4rem; border-radius: 50%; pointer-events: none; opacity: 0; box-shadow: 0 0 0 2px var(--lamp-hot), 0 0 1.2rem #f6bf78a6, inset 0 0 .6rem #ffd99c55; transition: opacity .4s; }
.edition-picker.is-ready .edition-ring { opacity: 1; }
.edition-choice {
  position: relative; display: grid; justify-items: center; gap: .22rem; width: 4.6rem; padding: .22rem .15rem .28rem;
  border: 0; border-radius: .9rem; background: none; color: #d9c6e4; font-size: .8rem; font-weight: 650; cursor: pointer;
  transition: color .3s, background .3s; -webkit-tap-highlight-color: transparent;
}
.edition-portrait { position: relative; display: block; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: linear-gradient(#5b3a74, #2f1b42); box-shadow: inset 0 0 0 1.5px #fff1db33; }
.edition-portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transition: filter .3s; }
.edition-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edition-plus { position: absolute; right: -.12rem; bottom: -.06rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: linear-gradient(#ffe5b5, #f1b25c); box-shadow: 0 0 0 2px #24132f, 0 0 .6rem #f6bf7880; }
.edition-plus::before, .edition-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: .56rem; height: 2px; margin: -1px 0 0 -.28rem; border-radius: 2px; background: #2a1530; }
.edition-plus::after { transform: rotate(90deg); }
.edition-choice--yours.has-photo .edition-plus { display: none; }
/* The plus on "Your child" breathes softly until it is chosen */
.edition-choice--yours[aria-pressed="false"] .edition-plus { animation: plus-breathe 3.4s ease-in-out 2.5s infinite; }
@keyframes plus-breathe { 0%, 70%, 100% { transform: none; } 82% { transform: scale(1.18); box-shadow: 0 0 0 2px #24132f, 0 0 1.1rem #ffd99c; } }
@media (hover: hover) {
  .edition-choice:hover { color: #fff; background: #ffffff0d; }
  .edition-choice:hover .edition-portrait img { filter: brightness(1.1) saturate(1.08); }
}
.edition-choice[aria-pressed="true"] { color: var(--lamp-hot); }
.edition-picker:not(.is-ready) .edition-choice[aria-pressed="true"] .edition-portrait { box-shadow: 0 0 0 2px var(--lamp-hot), 0 0 1.1rem #f6bf7899; }
.edition-choice[data-edition-pending] .edition-portrait { animation: pending 1s ease-in-out infinite; }
@keyframes pending { 50% { box-shadow: inset 0 0 0 1.5px #fff1db33, 0 0 1.4rem #f6bf78; } }

/* Enlarged pages */
.product-photo-dialog { width: min(94vw, 70rem); max-height: 94svh; padding: 1rem; border: 0; border-radius: 1.2rem; background: #22142f; color: var(--ivory); box-shadow: inset 0 0 0 1px #f6bf7840, 0 2rem 5rem #000c; }
.product-photo-dialog[open] { animation: dialog-in .5s var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.product-photo-dialog::backdrop { background: #0d0616e6; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.product-photo-dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 .2rem .8rem; }
.product-photo-dialog h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.book-dialog-media > .pdf-cover { width: min(100%, 76svh); margin-inline: auto; }
.book-dialog-media > .pdf-spread { width: min(100%, 150svh); margin-inline: auto; border-radius: .3rem; overflow: hidden; position: relative; }
.book-dialog-media img { border-radius: 0; }

/* =========================================================
   2. What makes it theirs
   ========================================================= */
.theirs { padding: clamp(4rem, 10svh, 6.5rem) 0; }
.theirs-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.2rem, 3vw, 2.4rem); }
.theirs-card { padding: 1.1rem 1.1rem 1.6rem; border-radius: 1.3rem; background: linear-gradient(170deg, #ffffff0f, #ffffff05); box-shadow: inset 0 0 0 1px #ffffff12; text-align: center; transition: transform .6s var(--ease-out), box-shadow .6s; }
/* (GSAP only fades the card itself in and slides its contents, so this hover lift never fights the reveal) */
@media (hover: hover) { .theirs-card:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px #f6bf7855, 0 1.6rem 2.6rem -1.4rem #000; } }
.theirs-art { position: relative; aspect-ratio: 4 / 3; border-radius: .9rem; overflow: hidden; margin-bottom: 1.2rem; background: #2c1a3f; }
.theirs-art img { width: 100%; height: 100%; object-fit: cover; }
.theirs-art--name img { object-position: 50% 0; transform: scale(1.25); transform-origin: 50% 0; }
.theirs-art--face .ta-photo { position: absolute; left: 6%; top: 12%; width: 44%; height: auto; aspect-ratio: 1; border-radius: .3rem; rotate: -6deg; box-shadow: 0 0 0 .35rem #fbf3e6, 0 .8rem 1.4rem #0009; }
.theirs-art--face .ta-char { position: absolute; right: 4%; bottom: -30%; width: 52%; height: auto; object-fit: contain; filter: drop-shadow(0 .5rem .8rem #0009); }
.theirs-art--face::before { content: ""; position: absolute; left: 47%; top: 40%; width: 2.2rem; height: 2.2rem; background: var(--lamp-hot); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); filter: drop-shadow(0 0 .5rem #f6bf78); animation: star-spin 8s linear infinite; z-index: 2; }
.theirs-card h3 { font-size: clamp(1.35rem, 1.9vw, 1.7rem); }
.theirs-step { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .55rem; border-radius: 50%; vertical-align: .12em; background: linear-gradient(#ffe5b5, #f1b25c); color: #2a1530; font: 700 .78rem/1 var(--sans); box-shadow: 0 0 .9rem #f6bf7850; }
.theirs-card p { margin: .6rem auto 0; max-width: 18rem; color: #e2d3ea; }

/* =========================================================
   3-4. Questions and finale
   ========================================================= */
.santa .grownups { padding: clamp(3.5rem, 9svh, 6rem) 0; }
.santa .grownups .title { font-size: clamp(2.1rem, 3.8vw, 3.4rem); }
.finale { padding: clamp(4rem, 10svh, 6.5rem) 0 clamp(4.5rem, 11svh, 7rem); text-align: center; }
.finale-sky { position: absolute; inset: -12svh 0 0; z-index: -1; pointer-events: none; }
.finale-glow { position: absolute; inset: 0; background: radial-gradient(min(60%, 40rem) 44% at 50% 47%, #f6bf7826, #c0709a10 55%, transparent); }
.finale-sky .snow { -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 72%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 72%, transparent); }
.f-sleigh { position: absolute; z-index: 2; left: 0; top: 0; width: clamp(6rem, 9vw, 9rem); opacity: 0; visibility: hidden; }
.finale-art { position: relative; width: clamp(13rem, 24vw, 19rem); aspect-ratio: 3 / 3.6; margin: 0 auto 2.4rem; border-radius: 50% 50% 1.2rem 1.2rem / 42% 42% 1.2rem 1.2rem; overflow: hidden; box-shadow: 0 0 0 .7rem #3a2450, 0 0 0 .95rem #f6bf7844, 0 0 5rem 1rem #f6bf7826, 0 2rem 3rem -1rem #000; }
.finale-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.finale-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 48.6%, #3a2450 48.6%, #3a2450 51.4%, transparent 51.4%), linear-gradient(transparent 46.2%, #3a2450 46.2%, #3a2450 48.8%, transparent 48.8%); }
.finale .title { max-width: 13em; margin-inline: auto; }
.finale .lede { margin-inline: auto; }

/* =========================================================
   Phones: a "Create their book" button that is always to hand
   ========================================================= */
.sticky-buy { display: none; }
/* No "Create their book" bar while orders are full or closed */
body:has(.santa-order[data-booked], .santa-order[data-mode="closed"]) .sticky-buy { display: none !important; }
@media (max-width: 900px) {
  .sticky-buy {
    position: fixed; z-index: 90; inset: auto 0 0; display: block;
    padding: 1.6rem max(1rem, env(safe-area-inset-left)) calc(.8rem + env(safe-area-inset-bottom));
    background: linear-gradient(#150b2200, #150b22d9 58%);
    transform: translateY(110%); visibility: hidden; pointer-events: none;
    transition: transform .55s var(--ease-out), visibility 0s .55s;
  }
  .sticky-buy.is-on { transform: none; visibility: visible; pointer-events: auto; transition: transform .55s var(--ease-out); }
  .sticky-buy-btn { display: flex; width: 100%; max-width: 26rem; margin-inline: auto; gap: .55rem; }
  .sticky-buy-price:not(:empty)::before { content: "·"; margin-right: .55rem; opacity: .55; }
  html[data-motion="off"] .sticky-buy { transition: none; }
}

/* =========================================================
   Responsive
   ========================================================= */
/* Short laptop screens: everything still fits on one screen */
@media (min-width: 901px) and (max-height: 820px) {
  .buy-title { font-size: clamp(2.4rem, 3.9vw, 3.6rem); }
  .buy-intro { font-size: 1rem; }
  .santa-order { padding-block: 1rem; }
  .santa-order-form { gap: .6rem; }
  .santa-order .name-form input { min-height: 2.75rem; padding-block: .45rem; }
  .order-field > label { margin-bottom: .35rem; }
  .order-photo-picker { min-height: 2.85rem; }
  .order-photo-face { width: 2.3rem; height: 2.3rem; }
  .order-pay { min-height: 3.1rem; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .buy-intro { display: none; }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .buy-grid { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); }
  .moon { right: 2.2rem; top: calc(var(--header-h) + .6rem); }
  .reader-label { display: none; }
  .edition-picker h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .edition-picker { padding-left: .5rem; }
}
@media (max-width: 900px) {
  .buy { display: block; min-height: 0; padding: calc(var(--header-h) + 1rem) 0 2.5rem; }
  .buy-art { inset: 0 0 auto; height: 92svh; -webkit-mask-image: linear-gradient(#000 52%, transparent 94%); mask-image: linear-gradient(#000 52%, transparent 94%); }
  .village-wrap { -webkit-mask-image: none; mask-image: none; }
  .v-village { object-position: 50% 100%; filter: saturate(.75) brightness(.44) blur(1.2px); -webkit-mask-image: linear-gradient(transparent 30%, #000 62%); mask-image: linear-gradient(transparent 30%, #000 62%); }
  .moon, .v-sleigh { display: none; }
  .sky-halo { right: -40%; top: -30%; width: 140vw; }
  .buy-head { margin-bottom: 1.1rem; text-align: center; }
  .buy-head .kicker { justify-content: center; }
  .buy-grid { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .purchase-preview { order: -1; width: min(100%, 34rem); margin-inline: auto; gap: .9rem; }
  .preview-controls { flex-direction: column; gap: .75rem; }
  .reader-nav { order: -1; }
  .buy-copy { width: 100%; max-width: 34rem; margin-inline: auto; }
  .santa-order-form { justify-content: flex-start; gap: .9rem; }
  .theirs-cards {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(80%, 21rem); gap: 1rem;
    margin-inline: calc((100vw - 100%) / -2); padding: .4rem calc((100vw - 100%) / 2) 1.2rem;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: calc((100vw - 100%) / 2);
    scrollbar-width: none;
  }
  .theirs-cards::-webkit-scrollbar { display: none; }
  .theirs-card { scroll-snap-align: start; }
  .theirs .small-print.center { margin-top: 1rem; }
  .section-head { margin-bottom: 2.4rem; }
  .finale { padding-bottom: 5rem; }
}
/* Phones: the open book comes forward and gets bigger, so the pages are worth turning */
@media (max-width: 560px) {
  .buy-head .kicker { font-size: .68rem; letter-spacing: .18em; }
  .buy-title { font-size: min(8.4vw, 2.6rem); }
  .buy-intro { font-size: .98rem; }
  .product-display { width: calc(100% + 1rem); margin-inline: -.5rem; aspect-ratio: 100 / 79; }
  .purchase-cover { width: 47%; left: 1%; }
  .purchase-spread { top: 37%; width: 92%; right: 0; --srx: 7deg; }
  .reader-zoom { width: 1.9rem; height: 1.9rem; top: .4rem; right: .4rem; }
  .reader-corner--next, .reader-corner--prev { width: 7%; }
  .edition-picker { gap: .5rem; padding: .34rem .42rem .34rem .85rem; }
  .edition-picker h2, .reader-label { font-size: .62rem; letter-spacing: .16em; }
  .edition-choice { width: 4.5rem; font-size: .74rem; }
  .edition-portrait, .edition-ring { width: 2.9rem; height: 2.9rem; }
  .reader-nav { padding-left: .9rem; }
  .order-format-option { padding-left: 2.15rem; }
  .order-format-option::before { left: .75rem; }
  .order-format-price { font-size: 1.35rem; }
  .santa-jacket .book-jacket { box-shadow: .25rem .25rem 0 -.04rem #efe2d4, .4rem .4rem 0 -.04rem #cdb4a8, 0 1.4rem 2rem -.8rem #0b0414f2; }
}
