/* The Book of the Soul 2027 — landing & quiz.
   Two themes: .night (cards, reveals: same world as the Instagram posts) and .day (questions: same as the book pages).
   All colours live here, so an A/B test of a different palette only touches these variables. */
:root {
  --night: #1d1630; --night-2: #2c2148; --gold: #b08d57; --gold-hi: #e2c07a; --cream: #fbf7ef; --paper: #fffdf8;
  --ink: #2b2335; --muted: #6d6177; --line: #e3d6bf; --error: #a3341f;
  --serif: "Cormorant Garamond", Georgia, serif; --caps: Cinzel, "Times New Roman", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--ink); background: var(--cream); transition: background-color .5s, color .5s; }
body.night { background: var(--night); color: #f3e9d6; }
body.night::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .9;
  background: radial-gradient(ellipse at 50% 20%, #3a2b5c 0%, transparent 65%),
    radial-gradient(1px 1px at 12% 18%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 82% 12%, #fffa 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 68% 64%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 26% 78%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 46%, #fff8 50%, transparent 51%), radial-gradient(1.2px 1.2px at 8% 52%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 34%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 58% 90%, #fff7 50%, transparent 51%); }
main { position: relative; max-width: 520px; margin: 0 auto; padding: 22px 20px 40px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { display: none; flex-direction: column; flex: 1; animation: in .45s ease both; }
.screen.on { display: flex; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* type */
.brand { font-family: var(--caps); font-size: 11px; letter-spacing: .32em; text-align: center; color: var(--gold); text-transform: uppercase; margin: 6px 0 22px; }
.night .brand { color: var(--gold-hi); }
h1 { font-family: var(--caps); font-weight: 400; font-size: 29px; line-height: 1.18; text-align: center; margin: 0 0 12px; letter-spacing: .01em; }
h1 em { font-style: normal; color: var(--gold-hi); }
h2 { font-family: var(--caps); font-weight: 400; font-size: 23px; line-height: 1.25; margin: 6px 0 10px; color: var(--night); }
.night h2 { color: #f3e9d6; text-align: center; }
.sub { text-align: center; font-size: 20px; font-style: italic; opacity: .9; margin: 0 0 20px; }
.why { font-size: 16px; color: var(--muted); font-style: italic; margin: 0 0 20px; padding-left: 14px; border-left: 1.5px solid var(--gold); }
.why b { font-style: normal; font-family: var(--caps); font-size: 10.5px; letter-spacing: .18em; color: var(--gold); display: block; font-weight: 400; margin-bottom: 2px; }
.small { font-size: 14px; text-align: center; opacity: .75; }
.night a { color: var(--gold-hi); }
a { color: var(--night); }

/* options & buttons */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { font: inherit; font-size: 19px; text-align: left; padding: 14px 18px; border-radius: 12px; cursor: pointer; width: 100%;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); transition: transform .12s, border-color .2s, background .2s; }
.opt:active { transform: scale(.98); }
.opt.sel { border-color: var(--gold); background: #f4ecdd; box-shadow: inset 0 0 0 1px var(--gold); }
.night .opt { background: rgba(255,255,255,.05); border-color: rgba(226,192,122,.35); color: #f3e9d6; }
.night .opt.sel { background: rgba(226,192,122,.16); border-color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold-hi); }
.btn { font-family: var(--caps); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; border: 0; border-radius: 40px; cursor: pointer;
  padding: 17px 26px; width: 100%; margin-top: 22px; color: var(--night); background: linear-gradient(180deg, #ecd08f, #c9a35f);
  box-shadow: 0 6px 22px rgba(176,141,87,.35); transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: default; }
.day .btn { background: var(--night); color: #f3e9d6; box-shadow: 0 6px 20px rgba(29,22,48,.25); }
.link { background: none; border: 0; font: inherit; font-size: 16px; color: var(--muted); cursor: pointer; padding: 8px 0; text-decoration: underline; }

/* top bar on question screens */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.back { background: none; border: 0; font-size: 24px; color: var(--muted); cursor: pointer; padding: 0 6px 0 0; line-height: 1; }
.bar { flex: 1; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); transition: width .4s; }
.count { font-family: var(--caps); font-size: 11px; letter-spacing: .12em; color: var(--muted); }

/* fields */
label.f { display: block; font-family: var(--caps); font-size: 11px; letter-spacing: .16em; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; }
input[type=text], input[type=email], select { font: inherit; font-size: 19px; width: 100%; padding: 13px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); appearance: none; -webkit-appearance: none; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,87,.18); }
.row3 { display: grid; grid-template-columns: 1fr 1.5fr 1.2fr; gap: 8px; }
.err { color: var(--error); font-size: 16px; margin-top: 10px; min-height: 1px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; margin-top: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--night); flex: none; }

/* city autocomplete */
.ac { position: relative; }
.ac ul { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; z-index: 5; left: 0; right: 0; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(29,22,48,.15); max-height: 300px; overflow: auto; }
.ac li { padding: 11px 12px; border-radius: 8px; cursor: pointer; font-size: 17.5px; }
.ac li span { color: var(--muted); font-size: 15px; }
.ac li:hover, .ac li.hi { background: #f4ecdd; }
.chosen { margin-top: 10px; font-size: 16px; color: var(--muted); }
.chosen b { color: var(--ink); font-weight: 600; }

/* cards */
.icon { width: 46px; margin: 0 auto 14px; display: block; border-radius: 6px; box-shadow: 0 0 24px rgba(226,192,122,.35); }
.deck { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 10px 0 18px; }
.pick { width: calc(25% - 10px); max-width: 100px; aspect-ratio: 338/520; border-radius: 9px; cursor: pointer; position: relative;
  background: url(/static/img/card-back.jpg) center/cover; border: 1px solid rgba(226,192,122,.5);
  box-shadow: 0 6px 18px rgba(0,0,0,.45); transition: transform .25s, box-shadow .25s, opacity .3s; animation: deal .5s ease both; }
.pick:nth-child(2) { animation-delay: .05s } .pick:nth-child(3) { animation-delay: .1s } .pick:nth-child(4) { animation-delay: .15s }
.pick:nth-child(5) { animation-delay: .2s } .pick:nth-child(6) { animation-delay: .25s } .pick:nth-child(7) { animation-delay: .3s }
@keyframes deal { from { opacity: 0; transform: translateY(-30px) rotate(-6deg); } to { opacity: 1; transform: none; } }
.pick:hover { transform: translateY(-4px); }
.pick.sel { transform: translateY(-10px); box-shadow: 0 0 0 2px var(--gold-hi), 0 0 28px rgba(226,192,122,.65); }
.pick.sel::after { content: attr(data-n); position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold-hi); color: var(--night); font-family: var(--caps); font-size: 14px; display: grid; place-items: center; }
.deck.done .pick:not(.sel) { opacity: .25; }
.dots { text-align: center; font-family: var(--caps); font-size: 12px; letter-spacing: .14em; color: var(--gold-hi); }
.dots i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--gold-hi); margin: 0 3px; }
.dots i.on { background: var(--gold-hi); }

.spread { display: flex; gap: 10px; justify-content: center; margin: 8px 0 8px; }
.flip { width: 31%; max-width: 140px; perspective: 900px; text-align: center; }
.flip .in { position: relative; aspect-ratio: 338/520; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,.7,.3,1); }
.flip.open .in { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; border-radius: 8px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  border: 1px solid rgba(226,192,122,.6); box-shadow: 0 8px 22px rgba(0,0,0,.5); background: url(/static/img/card-back.jpg) center/cover; }
.flip .face.front { transform: rotateY(180deg); background: #1d1630; }
.flip .face.front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flip .pos { font-family: var(--caps); font-size: 9.5px; letter-spacing: .12em; color: var(--gold-hi); text-transform: uppercase; margin-top: 10px; min-height: 2.4em; }
.flip .nm { font-family: var(--caps); font-size: 13px; margin-top: 2px; }
.flip .kw { font-style: italic; font-size: 14.5px; opacity: .85; margin-top: 2px; line-height: 1.25; }
.flip .pos, .flip .nm, .flip .kw { opacity: 0; transition: opacity .6s .7s; }
.flip.open .pos, .flip.open .nm { opacity: 1; } .flip.open .kw { opacity: .85; }

.teaser { margin-top: 18px; border: 1px solid rgba(226,192,122,.45); border-radius: 14px; padding: 18px 18px 6px; background: rgba(255,255,255,.04); }
.teaser p { margin: 0 0 12px; font-size: 18px; }
.teaser ul { margin: 0 0 12px; padding-left: 0; list-style: none; font-size: 17px; }
.teaser li { padding: 3px 0 3px 22px; position: relative; } .teaser li::before { content: "✦"; position: absolute; left: 0; color: var(--gold-hi); font-size: 13px; top: 6px; }

/* interstitials */
.big-card { width: 58%; max-width: 230px; margin: 4px auto 14px; perspective: 900px; }
.big-card .flip { width: 100%; max-width: none; }
.sign { text-align: center; margin: 10px 0 18px; }
.sign .gl { font-size: 46px; color: var(--gold-hi); line-height: 1; }
.sign .t { font-family: var(--caps); font-size: 21px; margin-top: 6px; }
.sign .tl { font-style: italic; opacity: .85; }
.note { font-size: 16.5px; text-align: center; font-style: italic; opacity: .85; margin-top: 4px; }

/* book cover mock (same as the PDF cover) */
.cover { width: 62%; max-width: 230px; margin: 6px auto 8px; aspect-ratio: 148/210; border-radius: 4px 10px 10px 4px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #3a2b5c 0%, var(--night) 70%); color: #f3e9d6; text-align: center; padding-top: 16%;
  box-shadow: -6px 0 0 #120d20 inset, 0 14px 34px rgba(0,0,0,.55); border: 1px solid rgba(226,192,122,.35); }
.cover .t1 { font-family: var(--caps); font-size: 7px; letter-spacing: .3em; color: var(--gold-hi); }
.cover .t2 { font-family: var(--caps); font-size: 19px; line-height: 1.12; margin: 8% 0 2%; }
.cover .t3 { font-family: var(--caps); font-size: 26px; color: var(--gold-hi); }
.cover .sun { width: 20%; aspect-ratio: 1; margin: 8% auto; border: 1px solid var(--gold-hi); border-radius: 50%; }
.cover .for { font-style: italic; font-size: 11px; opacity: .85; }
.cover .nm { font-family: var(--caps); font-size: 12px; letter-spacing: .1em; margin-top: 2px; padding: 0 8px; }

.devbox { margin-top: 24px; padding: 12px 14px; border: 1px dashed #e88; border-radius: 10px; font-size: 14px; color: #fbb; word-break: break-all; }
.spinner { width: 64px; height: 64px; margin: 30px auto; border-radius: 50%; border: 2px solid rgba(226,192,122,.25); border-top-color: var(--gold-hi); animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { margin-top: auto; padding-top: 26px; }
.night a.btn { color: var(--night); }
.gift { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.gift span { font-family: var(--caps); font-size: 10.5px; letter-spacing: .12em; color: var(--gold-hi); border: 1px solid rgba(226,192,122,.45); border-radius: 20px; padding: 5px 10px; }
.mini { display: flex; justify-content: center; gap: 8px; margin: 0 0 14px; }
.mini i { width: 44px; aspect-ratio: 338/520; border-radius: 5px; background: url(/static/img/card-back.jpg) center/cover; box-shadow: 0 0 0 1px var(--gold-hi), 0 0 18px rgba(226,192,122,.5); }
/* compact options: 7 buttons + the small link fit one phone screen */
.opts { gap: 8px; }
.opt { padding: 11px 16px; font-size: 18px; line-height: 1.25; }
.opt.extra { background: none; border: 0; text-align: center; color: var(--muted); text-decoration: underline; font-size: 16px; padding: 8px; }
.opt.extra.sel { box-shadow: none; color: var(--ink); }
.night .opt.extra { color: #bfb2cf; }
.day h2 { margin-bottom: 8px; }
.why { margin-bottom: 16px; }
.top { margin-bottom: 18px; }
main { padding: 14px 18px 14px; }
.mini { margin-bottom: 8px; } [data-s="focus"] .sub { margin-bottom: 14px; }
