/* Website UI (landing flow, preview, waitlist). Mobile first; desktop layout from 960px.
   The printed pages use src/render/book.css instead. */
@font-face { font-family: Bricolage; font-weight: 600; font-display: swap; src: url(/fonts/bricolage-grotesque/files/bricolage-grotesque-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Bricolage; font-weight: 800; font-display: swap; src: url(/fonts/bricolage-grotesque/files/bricolage-grotesque-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/inter/files/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter/files/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 800; font-display: swap; src: url(/fonts/inter/files/inter-latin-800-normal.woff2) format('woff2'); }

:root {
  --bg: #ffffff; --ink: #0f0e17; --soft: #6b6880; --line: #e9e8f0; --tint: #f6f5fb;
  --violet: #6c47ff; --violet-tint: #f0ecff; --coral: #ff6b5b; --sun: #ffd166; --mint: #3fd8b0;
  --r: 20px; --ease: cubic-bezier(.2,.8,.2,1);
  --pad: max(20px, env(safe-area-inset-left));
  --shadow: 0 1px 2px rgba(15,14,23,.04), 0 8px 28px rgba(15,14,23,.07);
  --display: Bricolage, Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.5 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.kicker { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); }

/* ---------- soft colour blobs ---------- */
.blobs { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 18s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { width: 60vmax; height: 60vmax; top: -30vmax; right: -25vmax; background: #c9b8ff; }
.blobs i:nth-child(2) { width: 45vmax; height: 45vmax; bottom: -25vmax; left: -20vmax; background: #ffd0c4; animation-delay: -6s; }
.blobs i:nth-child(3) { width: 30vmax; height: 30vmax; top: 40%; left: 55%; background: #bff3e3; opacity: .35; animation-delay: -12s; }
@keyframes drift { to { transform: translate(-4vmax, 3vmax) scale(1.08); } }

/* ---------- top bar ---------- */
.bar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: calc(12px + env(safe-area-inset-top)) var(--pad) 12px; background: rgba(255,255,255,.72); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.logo { font: 800 17px/1 var(--display); text-decoration: none; letter-spacing: -.02em; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.logo .mark { color: var(--violet); font-size: 18px; }
.nav { flex: 1; display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.back { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.back:hover { background: var(--tint); }
.progress { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; max-width: 220px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--coral)); border-radius: 99px; transition: width .5s var(--ease); }

/* ---------- stage + steps ---------- */
.stage { position: relative; z-index: 1; }
.showcase { display: none; }
#flow { position: relative; min-height: 100dvh; max-width: 480px; margin: 0 auto; overflow-x: clip; }
.step { position: absolute; inset: 0; padding: calc(84px + env(safe-area-inset-top)) var(--pad) calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; opacity: 0; visibility: hidden; transform: translateX(36px); transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s .45s; }
.step.is-active { position: relative; opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--ease) .05s, transform .45s var(--ease) .05s, visibility 0s; }
.step.is-left { transform: translateX(-36px); }
.q { font: 800 clamp(32px, 8.6vw, 44px)/1.04 var(--display); letter-spacing: -.035em; margin: 8px 0 2px; }
.center { text-align: center; }
.sub { margin: -4px 0 4px; color: var(--soft); }

.field { width: 100%; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; padding: 17px 18px; font: 600 21px/1.2 Inter, sans-serif; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; box-shadow: var(--shadow); }
.field::placeholder { color: #b9b7c6; font-weight: 600; }
.field:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(108,71,255,.15); }
textarea.field { font-size: 18px; resize: none; font-weight: 400; }
.field.time { font-size: 24px; text-align: center; min-height: 62px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.go { display: block; width: 100%; margin-top: 4px; border: 0; border-radius: 99px; padding: 18px 24px; background: var(--ink); color: #fff; font: 600 18px/1 Inter, sans-serif; cursor: pointer; text-align: center; text-decoration: none; transition: transform .15s var(--ease), box-shadow .2s, background .2s; box-shadow: 0 8px 20px rgba(15,14,23,.18); }
.go:hover { background: #26243a; transform: translateY(-1px); }
.go:active { transform: scale(.98); }
.go[disabled] { opacity: .5; }
.skip { align-self: center; border: 0; background: none; color: var(--soft); font-weight: 600; padding: 10px; cursor: pointer; }
.skip:hover { color: var(--ink); }
.hint { margin: 0; font-size: 15px; color: var(--soft); }
.err { color: #d6336c; font-weight: 600; }
.tiny { margin: 0; text-align: center; font-size: 13px; color: var(--soft); }

/* hello */
[data-step=hello] { padding-top: calc(76px + env(safe-area-inset-top)); }
.big { font: 800 clamp(32px, 11.2vw, 64px)/.98 var(--display); letter-spacing: -.045em; margin: 0; }
/* rotating word: always last on its own line ("the day ___"), so swapping it never reflows the headline; words cross-fade on top of each other */
.big .line { display: block; white-space: nowrap; }
.big .rot { position: relative; display: inline-block; vertical-align: bottom; width: 4.4em; height: 1em; line-height: inherit; transition: width .65s cubic-bezier(.65, 0, .35, 1); }
.big .rot .w { position: absolute; left: 0; top: 0; line-height: inherit; white-space: nowrap; padding-right: .08em;
  background: linear-gradient(90deg, var(--violet), var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(.38em); filter: blur(8px);
  transition: opacity .55s ease, transform .75s cubic-bezier(.22, 1, .36, 1), filter .55s ease; will-change: opacity, transform, filter; }
.big .rot .w.is-in { opacity: 1; transform: none; filter: none; }
.big .rot .w.is-out { opacity: 0; transform: translateY(-.38em); filter: blur(8px); }

@keyframes pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.lede { margin: 0; font-size: 18px; color: var(--soft); max-width: 34ch; }
.fan { position: relative; height: 200px; margin: 4px 0 6px; }
.fan img { position: absolute; top: 14px; left: 50%; width: 140px; height: 140px; border-radius: 12px; box-shadow: 0 14px 30px rgba(15,14,23,.18); animation: float 6s ease-in-out infinite; }
.fan img:nth-child(1) { transform: translateX(-112%) rotate(-9deg); top: 32px; animation-delay: -2s; }
.fan img:nth-child(2) { transform: translateX(-50%) rotate(2deg); z-index: 2; width: 164px; height: 164px; }
.fan img:nth-child(3) { transform: translateX(14%) rotate(9deg); top: 34px; animation-delay: -4s; }
@keyframes float { 50% { translate: 0 -8px; } }

/* mode choices */
.choices { display: grid; gap: 12px; }
.choice { position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: 14px; align-items: center; padding: 18px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s var(--ease), border-color .2s, background .2s; }
.choice:hover { border-color: #cfc6ff; }
.choice:active { transform: scale(.985); }
.choice input { position: absolute; opacity: 0; }
.choice .emo { grid-row: span 2; width: 56px; height: 56px; border-radius: 16px; background: var(--tint); display: grid; place-items: center; font-size: 30px; transition: transform .3s var(--ease); }
.choice b { font: 800 21px/1.15 var(--display); letter-spacing: -.02em; }
.choice small { color: var(--soft); font-size: 15px; }
.choice:has(input:checked) { border-color: var(--violet); background: var(--violet-tint); }
.choice:has(input:checked) .emo { transform: scale(1.1) rotate(-6deg); background: #fff; }

/* date */
.dmy { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 10px; }
.dmy label span { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px 4px; color: var(--soft); }
.dmy .field { text-align: center; padding: 17px 6px; }
.tease { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--violet-tint); color: #3b2a99; font-weight: 600; animation: pop .45s var(--ease); }

/* towns */
.towns { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.towns li button { width: 100%; text-align: left; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; padding: 15px 18px; font-size: 18px; cursor: pointer; animation: pop .3s var(--ease) both; transition: border-color .2s, background .2s; }
.towns li:nth-child(2) button { animation-delay: .03s; } .towns li:nth-child(3) button { animation-delay: .06s; } .towns li:nth-child(4) button { animation-delay: .09s; } .towns li:nth-child(5) button { animation-delay: .12s; }
.towns li button:hover, .towns li button:active { border-color: var(--violet); background: var(--violet-tint); }
.towns li button b { font-weight: 600; }
.towns li button small { color: var(--soft); margin-left: 6px; }

/* making */
[data-step=making] { justify-content: center; text-align: center; min-height: 100dvh; padding-top: 40px; }
.orbit { position: relative; width: 140px; height: 140px; margin: 0 auto 12px; border-radius: 50%; border: 1.5px dashed #cfc6ff; animation: spin 7s linear infinite; }
.orbit span { position: absolute; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 800 20px var(--display); color: #fff; box-shadow: 0 8px 18px rgba(15,14,23,.15); }
.orbit span:nth-child(1) { top: -22px; left: 48px; background: var(--violet); }
.orbit span:nth-child(2) { bottom: 6px; left: -12px; background: var(--mint); }
.orbit span:nth-child(3) { bottom: 6px; right: -12px; background: var(--coral); }
@keyframes spin { to { transform: rotate(360deg); } }
.ticker { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-weight: 600; }
.ticker li { opacity: .25; transition: opacity .3s; }
.ticker li.on { opacity: 1; }
.ticker li.on::after { content: ' ✓'; color: var(--violet); }

/* ---------- preview ---------- */
body.previewing { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.pv { position: relative; z-index: 1; }
.pv-head { padding: calc(78px + env(safe-area-inset-top)) var(--pad) 4px; }
.pv-head h1 { font: 800 clamp(34px, 9vw, 48px)/1.02 var(--display); letter-spacing: -.04em; margin: 4px 0 6px; }
.pv-head p { margin: 0; color: var(--soft); }
.viewer { position: relative; }
.previewing .book { display: flex !important; flex-direction: row !important; gap: 16px !important; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px var(--pad) 10px !important; scrollbar-width: none; align-items: flex-start !important; background: none; }
.previewing .book::-webkit-scrollbar { display: none; }
.previewing .sheet { flex: none; scroll-snap-align: center; border-radius: 14px !important; box-shadow: 0 2px 6px rgba(15,14,23,.06), 0 20px 50px rgba(15,14,23,.16) !important; }
.arrow { display: none; }
.dots { display: flex; justify-content: center; gap: 7px; padding: 8px 0 4px; }
.dots i { width: 7px; height: 7px; border-radius: 99px; background: #d9d7e3; transition: width .3s var(--ease), background .3s; }
.dots i.on { width: 22px; background: var(--violet); }
.dock { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.dock .go { margin: 0; flex: 1; }
.dock .share { flex: none; width: 58px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.dock .share span { display: none; }
.dock .share:hover { background: var(--tint); }
.pv-side { padding: 20px var(--pad) 24px; display: grid; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px 20px; box-shadow: var(--shadow); }
.card.glow { background: linear-gradient(160deg, #f3efff 0%, #fff 55%, #fff4ef 100%); }
.card h2 { font: 800 28px/1.05 var(--display); letter-spacing: -.035em; margin: 6px 0 8px; }
.card p { margin: 0 0 16px; color: #46435a; }
.card .field { font-size: 17px; padding: 15px 16px; margin-bottom: 10px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--soft); margin-top: 12px; }
.consent input { width: 18px; height: 18px; accent-color: var(--violet); flex: none; margin-top: 2px; }
.ok { font-weight: 800; font-size: 18px; margin: 0; color: var(--ink) !important; }
details.fix summary { cursor: pointer; font-weight: 600; color: var(--soft); list-style: none; text-align: center; padding: 8px; }
details.fix summary::-webkit-details-marker { display: none; }
details.fix form { display: grid; gap: 10px; margin-top: 8px; }
details.fix .field { font-size: 16px; font-weight: 400; padding: 14px 16px; margin: 0; }
.again { text-align: center; margin: 0; font-weight: 600; }
.narrow { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: calc(84px + env(safe-area-inset-top)) var(--pad) 40px; display: grid; gap: 16px; }

/* ---------- desktop ---------- */
/* ---------- mobile: centre everything ---------- */
@media (max-width: 959px) {
  .bar:has(.progress[hidden]) .nav { display: none; }
  .bar:has(.progress[hidden]) .logo, .bar:not(:has(.nav)) .logo { margin: 0 auto; }
  .step { text-align: center; }
  .kicker, .big, .lede, .q, .sub, .tiny, .hint, .tease { text-align: center; }
  .lede { margin: 0 auto; }
  .field { text-align: center; }
  textarea.field { text-align: center; }
  .choice { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 20px 16px; }
  .choice .emo { margin-bottom: 4px; }
  .dmy label span { text-align: center; margin-left: 0; }
  .towns li button { text-align: center; }
  .towns li button small { display: block; margin: 2px 0 0; }
  .pv-head { text-align: center; }
  .pv-side .card { text-align: center; }
  .consent { justify-content: center; text-align: left; }
  .narrow { text-align: center; }
}

@media (min-width: 960px) {
  html, body { font-size: 17px; }
  .bar { padding: 18px 40px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .logo { font-size: 20px; }
  .nav { justify-content: flex-start; margin-left: 48px; max-width: 360px; }

  .stage { max-width: 1200px; margin: 0 auto; padding: 0 40px; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 64px; align-items: center; }
  #flow { min-height: 0; margin: 0; max-width: none; padding: 110px 0 60px; }
  .step { padding: 0; }
  [data-step=hello] { padding-top: 0; }
  [data-step=making] { min-height: 0; padding-top: 0; }
  .fan { display: none; }
  .big { font-size: 68px; }
  .lede { font-size: 20px; }
  .go, .choices, .dmy, .field, .towns, .tease { max-width: 460px; }
  [data-step=hello] .go { max-width: 300px; }
  .tiny { text-align: left; }
  .q { font-size: 48px; }

  .showcase { display: flex; flex-direction: column; align-items: center; gap: 28px; padding-top: 60px; }
  .stack { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1.15; }
  .stack img { position: absolute; width: 58%; height: auto; aspect-ratio: 1; border-radius: 16px; box-shadow: 0 4px 10px rgba(15,14,23,.06), 0 30px 60px rgba(15,14,23,.18); animation: float 7s ease-in-out infinite; transition: transform .6s var(--ease); }
  .stack img:nth-child(1) { left: 0; top: 30%; transform: rotate(-12deg); animation-delay: -1s; }
  .stack img:nth-child(2) { right: 0; top: 2%; transform: rotate(9deg); animation-delay: -3s; }
  .stack img:nth-child(3) { right: 4%; bottom: 0; transform: rotate(4deg); animation-delay: -5s; }
  .stack img:nth-child(4) { left: 20%; top: 12%; transform: rotate(-3deg); z-index: 2; width: 62%; }
  .stack:hover img:nth-child(1) { transform: rotate(-16deg) translateX(-14px); }
  .stack:hover img:nth-child(2) { transform: rotate(13deg) translateX(14px); }
  .perks { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .perks li { padding: 10px 16px; border-radius: 99px; background: rgba(255,255,255,.8); border: 1px solid var(--line); font-weight: 600; font-size: 15px; box-shadow: var(--shadow); }
  .perks span { color: var(--violet); font-weight: 800; margin-right: 4px; }

  /* preview: big viewer on the left, sticky actions on the right */
  body.previewing { padding-bottom: 0; }
  .pv { max-width: 1200px; margin: 0 auto; padding: 96px 40px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; }
  .pv-head { padding: 0 0 8px; }
  .pv-head h1 { font-size: 56px; }
  .viewer { max-width: 640px; }
  .previewing .book { padding: 16px 0 10px !important; }
  .arrow { display: grid; place-items: center; position: absolute; top: 50%; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); cursor: pointer; z-index: 3; transition: opacity .2s, transform .2s; }
  .arrow:hover { transform: scale(1.06); }
  .arrow[disabled] { opacity: 0; pointer-events: none; }
  .arrow.prev { left: -24px; }
  .arrow.next { right: -24px; }
  .dots { justify-content: flex-start; max-width: 640px; justify-content: center; }
  .pv-side { position: sticky; top: 96px; padding: 112px 0 0; }
  .dock { position: static; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; flex-direction: column; }
  .dock .share { width: 100%; height: 54px; display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 600; }
  .dock .share span { display: inline; }
  .narrow { padding-top: 120px; }
}
@media (min-width: 960px) and (max-height: 760px) {
  .big { font-size: 56px; }
  .stack { max-width: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* the print stylesheet sizes every svg to 100%; keep UI icons at their own size */
.bar svg, .dock svg, .arrow svg { width: 22px !important; height: 22px !important; flex: none; display: block; }
