/* Tower Healing Tarot. Mobile first: everything is sized for a phone held upright, then widened. Tap and click both work; nothing depends on hover. */
:root {
  --bg: #f7f4ed; --paper: #fdfbf7; --btn: #777f6c; --sage: #8c9c7c; --sage-d: #56664c; --clay: #b57c5e; --sand: #d8c6a6; --head: #33382e;
  --text: #45473d; --dim: #857f70; --card-r: 4.2%;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif; --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; overflow-x: hidden; }
body { min-height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; margin: 0; line-height: 1.1; }
p { margin: 0 0 .8em; }

/* ---------- sky ---------- */
#sky, #fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#sky { z-index: 0; }
#fx { z-index: 60; }
.wash { position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(60px); opacity: .55;
  background: radial-gradient(40% 35% at 20% 25%, rgba(140, 156, 124, .5), transparent 70%), radial-gradient(38% 32% at 82% 18%, rgba(214, 170, 150, .38), transparent 70%),
    radial-gradient(45% 40% at 70% 85%, rgba(222, 200, 160, .45), transparent 70%), radial-gradient(50% 45% at 25% 80%, rgba(186, 198, 172, .55), transparent 70%);
  animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.12); } }
.flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: #4a4f43; opacity: 0; }
.flash.go { animation: flash .9s ease-out; }
@keyframes flash { 0% { opacity: 0; } 6% { opacity: .4; } 14% { opacity: .08; } 22% { opacity: .3; } 100% { opacity: 0; } }
.fog { position: fixed; inset: -10%; z-index: 65; pointer-events: none; filter: blur(30px); opacity: 0; animation: fog 5s ease-in-out;
  background: radial-gradient(50% 30% at 20% 60%, rgba(150, 160, 140, .4), transparent 70%), radial-gradient(55% 30% at 75% 45%, rgba(160, 168, 150, .38), transparent 70%), radial-gradient(60% 30% at 50% 85%, rgba(170, 176, 160, .38), transparent 70%); }
@keyframes fog { 0% { opacity: 0; transform: translateX(-6%); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateX(8%); } }
body.shake #app { animation: shake .6s; }
@keyframes shake { 10%, 50%, 90% { transform: translate(-5px, 2px); } 30%, 70% { transform: translate(5px, -2px); } }

/* ---------- frame ---------- */
#app { position: relative; z-index: 2; min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.brand { background: none; border: 0; padding: 4px 0; min-height: 44px; display: flex; align-items: center; min-width: 0; }
.brand img { display: block; height: clamp(26px, 8vw, 38px); width: auto; max-width: 100%; }
.brand small { display: block; font-family: var(--sans); font-size: 9px; letter-spacing: .42em; color: var(--dim); }
.top-btns { display: flex; gap: 8px; }
.chip { min-height: 44px; padding: 8px 12px; white-space: nowrap; border-radius: 999px; border: 1px solid rgba(86, 102, 76, .35); background: rgba(255, 253, 247, .72); color: var(--text); font-size: 13px; backdrop-filter: blur(6px); }
.chip[aria-pressed="true"] { background: rgba(140, 156, 124, .22); border-color: var(--sage-d); color: var(--sage-d); }
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 8px 16px 56px; }
.view { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }

.eyebrow { font-size: 11px; letter-spacing: .4em; text-transform: uppercase; color: var(--sage-d); }
.title { font-size: clamp(34px, 9vw, 64px); color: var(--head);  }
.lede { font-family: var(--serif); font-size: clamp(19px, 4.6vw, 24px); color: var(--text); font-style: italic; max-width: 34em; }
.gold-rule { height: 1px; border: 0; margin: 20px 0; background: linear-gradient(90deg, transparent, var(--sage-d), transparent); opacity: .6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 26px; border-radius: 999px; border: 1px solid var(--sage-d);
  background: linear-gradient(180deg, rgba(86, 102, 76, .22), rgba(86, 102, 76, .06)); color: var(--head); font-family: var(--serif); font-size: 20px; letter-spacing: .06em;
  box-shadow: 0 0 24px rgba(86, 102, 76, .18), inset 0 0 12px rgba(86, 102, 76, .12); transition: transform .15s, box-shadow .2s; }
.btn:active { transform: scale(.97); box-shadow: 0 0 40px rgba(86, 102, 76, .45); }
.btn.ghost { border-color: rgba(69, 71, 61, .22); background: none; box-shadow: none; font-size: 17px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }

/* ---------- a card ---------- */
.card { position: relative; aspect-ratio: 2 / 3; width: 100%; perspective: 1200px; border: 0; padding: 0; background: none; display: block; }
.card-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3, .9, .3, 1); }
.card.up .card-in { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; border-radius: var(--card-r); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; background: #e9e0cc center / cover no-repeat;
  box-shadow: 0 10px 30px rgba(84, 70, 48, .21), 0 0 0 1px rgba(86, 102, 76, .25); }
.card { transform: perspective(800px) rotateX(calc((var(--tx, 0) + var(--gx, 0)) * 1deg)) rotateY(calc((var(--ty, 0) + var(--gy, 0)) * 1deg)); transition: transform .2s ease-out; }
.card-front { transform: rotateY(180deg); background: radial-gradient(circle at 50% 40%, #fbf3df, #ecdcb6); }
.art, .foil { position: absolute; inset: 0; background: center / cover no-repeat; }
/* ink bloom: the painting soaks into the paper from the middle outward */
@property --bloom { syntax: "<percentage>"; inherits: false; initial-value: 150%; }
.art { -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 calc(var(--bloom) - 38%), transparent var(--bloom)); mask-image: radial-gradient(circle at 50% 45%, #000 calc(var(--bloom) - 38%), transparent var(--bloom)); }
.card.bloom .art { animation: bloom 2s .45s cubic-bezier(.3, .6, .3, 1) both; }
@keyframes bloom { from { --bloom: 0%; filter: saturate(1.9) blur(5px); } 60% { filter: saturate(1.3) blur(0); } to { --bloom: 150%; filter: none; } }
/* gold foil that slides with the tilt */
.foil { mix-blend-mode: soft-light; opacity: .75; background-image: linear-gradient(115deg, transparent 32%, rgba(255, 232, 160, .9) 47%, rgba(255, 255, 255, .7) 52%, transparent 68%); background-size: 260% 260%;
  background-position: calc(50% + (var(--ty, 0) + var(--gy, 0)) * 3.2%) calc(50% + (var(--tx, 0) + var(--gx, 0)) * 3.2%); }
#tint { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.6s, background 1.6s; background: radial-gradient(75% 55% at 50% 38%, var(--tint, transparent), transparent 72%); }
#tint.on { opacity: .2; }
.card.rev .card-front { transform: rotateY(180deg) rotate(180deg); }
.card-missing .art, .card-missing .foil { display: none; }
.card.glow .card-face { box-shadow: 0 0 46px rgba(86, 102, 76, .65), 0 10px 30px rgba(84, 70, 48, .21), 0 0 0 1px var(--sage-d); }
.card-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%); transform: translateX(-120%); }
.card.up .card-front::after { animation: sheen 1.3s .5s ease-out; }
@keyframes sheen { to { transform: translateX(120%); } }
.card-missing { display: flex; align-items: center; justify-content: center; text-align: center; padding: 10%; font-family: var(--serif); font-size: 18px; color: #5a4a22;
  background: radial-gradient(circle at 50% 40%, #fbf8f0, #ece3cd); }

/* ---------- home ---------- */
.home { min-height: calc(100dvh - 120px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.box-wrap { position: relative; width: min(62vw, 300px); aspect-ratio: 2 / 3; margin: 6px auto 10px; border: 0; background: none; padding: 0; }
.box-wrap img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 24px 40px rgba(84, 70, 48, .27)) drop-shadow(0 0 40px rgba(86, 102, 76, .25)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-1.2deg); } }
.box-wrap.opening img { animation: boxopen 1.5s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes boxopen { 30% { transform: scale(1.08) rotate(-3deg); } 45% { transform: scale(1.08) rotate(3deg); } 100% { transform: scale(.2) translateY(-40%); opacity: 0; filter: brightness(3) blur(8px); } }
.halo { position: absolute; inset: -35%; border-radius: 50%; background: radial-gradient(circle, rgba(86, 102, 76, .28), transparent 62%); animation: pulse 4s ease-in-out infinite; pointer-events: none; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .6; } }
.doors { display: grid; gap: 14px; width: 100%; max-width: 760px; margin-top: 8px; }
.door { position: relative; text-align: left; padding: 22px 20px; min-height: 150px; border-radius: 18px; border: 1px solid rgba(86, 102, 76, .4); overflow: hidden;
  background: linear-gradient(160deg, rgba(251, 248, 240, .92), rgba(240, 233, 218, .9)); backdrop-filter: blur(6px); box-shadow: 0 14px 40px rgba(84, 70, 48, .17); transition: transform .2s; }
.door:active { transform: scale(.98); }
.door::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 85% 10%, var(--tint, rgba(140, 156, 124, .45)), transparent 70%); opacity: .8; }
.door > * { position: relative; }
.door h2 { font-size: 30px; color: var(--head); margin: 6px 0 8px; }
.door p { color: var(--text); font-size: 15px; margin: 0; max-width: 30em; }
.door.read { --tint: rgba(196, 150, 124, .42); }

/* ---------- learn ---------- */
.path { display: grid; gap: 12px; margin-top: 18px; }
.step { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; min-height: 76px; border-radius: 16px; border: 1px solid rgba(86, 102, 76, .25); background: rgba(251, 248, 240, .82); backdrop-filter: blur(6px); }
.step b { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; color: var(--sage-d); border: 1px solid var(--sage-d); }
.step.done b { background: var(--btn); border-color: var(--btn); color: #fff; }
.step span { flex: 1; } .step strong { display: block; font-family: var(--serif); font-size: 21px; color: var(--head); font-weight: 600; } .step small { color: var(--dim); font-size: 13px; }
.lesson { max-width: 680px; margin: 0 auto; }
.lesson h1 { font-size: clamp(30px, 8vw, 46px); color: var(--head); margin: 6px 0 12px; }
.lesson .say { font-family: var(--serif); font-size: clamp(19px, 4.8vw, 23px); line-height: 1.45; color: var(--text); }
.panel { margin: 16px 0; padding: 16px; border-radius: 16px; border: 1px solid rgba(86, 102, 76, .22); background: rgba(251, 248, 240, .82); backdrop-filter: blur(6px); }
.panel h3 { font-size: 22px; color: var(--sage-d); margin-bottom: 8px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0; } .dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(69, 71, 61, .22); } .dots i.on { background: var(--sage-d); box-shadow: 0 0 10px var(--sage-d); }
.suits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suit { text-align: left; padding: 14px; min-height: 96px; border-radius: 14px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 16%, #fbf8f0); }
.suit strong { display: block; font-family: var(--serif); font-size: 22px; color: var(--head); } .suit small { color: var(--text); font-size: 13px; }
.suit.on { box-shadow: 0 0 26px var(--c); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.trio figure { margin: 0; text-align: center; } .trio figcaption { margin-top: 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-d); }
.choices { display: grid; gap: 10px; margin-top: 14px; }
.choice { text-align: left; min-height: 56px; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(69, 71, 61, .22); background: rgba(255, 253, 247, .72); font-size: 15px; }
.choice.right { border-color: #6f9a6a; background: rgba(120, 160, 110, .28); } .choice.wrong { border-color: #c98a78; background: rgba(190, 120, 100, .22); animation: shake .4s; }
.score { display: flex; justify-content: space-between; align-items: center; font-family: var(--serif); font-size: 20px; color: var(--sage-d); }
.streak { font-size: 15px; color: var(--clay); }
.quiz-card { width: min(48vw, 220px); margin: 12px auto; }
.note { color: var(--dim); font-size: 13px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 14px; }
.gallery button { border: 0; padding: 0; background: none; } .gallery img, .gallery .card-missing { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 6px 16px rgba(84, 70, 48, .19); font-size: 12px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin: 12px -16px 0; padding-inline: 16px; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs .chip { flex: none; }

/* ---------- reading ---------- */
.stage { position: relative; min-height: 60dvh; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.whisper { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 5.2vw, 28px); color: var(--head); max-width: 26em; min-height: 2.6em; }
.whisper span { opacity: 0; animation: word .6s forwards; display: inline-block; white-space: pre; }
@keyframes word { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } to { opacity: 1; } }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 520px; }
.theme { min-height: 64px; padding: 10px; border-radius: 14px; border: 1px solid rgba(86, 102, 76, .3); background: rgba(251, 248, 240, .82); font-family: var(--serif); font-size: 20px; color: var(--head); }
.theme.on { background: rgba(86, 102, 76, .2); border-color: var(--sage-d); box-shadow: 0 0 22px rgba(86, 102, 76, .3); }
textarea.q { width: 100%; max-width: 520px; min-height: 76px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(86, 102, 76, .3); background: rgba(255, 253, 247, .72); color: var(--text); font: inherit; resize: vertical; }
.spreads { display: grid; gap: 10px; width: 100%; max-width: 520px; }
.spread-opt { display: flex; gap: 14px; align-items: center; text-align: left; min-height: 72px; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(86, 102, 76, .3); background: rgba(251, 248, 240, .82); }
.spread-opt b { font-family: var(--serif); font-size: 30px; color: var(--sage-d); width: 34px; text-align: center; } .spread-opt strong { display: block; font-family: var(--serif); font-size: 21px; color: var(--head); } .spread-opt small { color: var(--dim); }

.deck { position: relative; width: min(46vw, 210px); aspect-ratio: 2 / 3; margin: 26px auto 10px; border: 0; background: none; padding: 0; touch-action: none; }
.deck i { position: absolute; inset: 0; border-radius: var(--card-r); background: #e9e0cc center / cover no-repeat; box-shadow: 0 4px 14px rgba(84, 70, 48, .19), 0 0 0 1px rgba(86, 102, 76, .25); transition: transform .45s cubic-bezier(.3, .8, .3, 1); will-change: transform; }
.meter { width: min(70vw, 300px); height: 6px; border-radius: 3px; background: rgba(69, 71, 61, .22); overflow: hidden; } .meter b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--sage-d)); box-shadow: 0 0 12px var(--sage-d); transition: width .2s; }

.fan { position: relative; width: 100%; height: min(58vw, 300px); margin: 8px 0 44px; touch-action: pan-y; }
.fan button { position: absolute; left: 50%; bottom: 0; width: min(21vw, 112px); aspect-ratio: 2 / 3; margin-left: calc(min(21vw, 112px) / -2); border: 0; padding: 0; border-radius: 6px; background: #e9e0cc center / cover no-repeat;
  box-shadow: -3px 4px 10px rgba(84, 70, 48, .19), 0 0 0 1px rgba(86, 102, 76, .25); transform-origin: 50% 240%; transition: transform .5s cubic-bezier(.3, .8, .3, 1), opacity .4s, box-shadow .2s; }
.fan button.sel { box-shadow: 0 0 26px var(--sage-d), 0 0 0 2px var(--sage-d); }
.fan button.gone { opacity: 0; pointer-events: none; }
.fan-nav { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }

.table { display: grid; gap: 12px; width: 100%; justify-content: center; margin-top: 8px; }
.table.n1 { grid-template-columns: min(60vw, 250px); } .table.n3 { grid-template-columns: repeat(3, min(28vw, 190px)); }
.table.n5 { grid-template-columns: repeat(3, min(28vw, 170px)); grid-template-areas: ". c2 ." "c1 c3 c5" ". c4 ."; }
.table.n5 .slot:nth-child(1) { grid-area: c1; } .table.n5 .slot:nth-child(2) { grid-area: c2; } .table.n5 .slot:nth-child(3) { grid-area: c3; } .table.n5 .slot:nth-child(4) { grid-area: c4; } .table.n5 .slot:nth-child(5) { grid-area: c5; }
.slot { text-align: center; } .slot small { display: block; margin-top: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-d); }
.slot .card { animation: deal .7s cubic-bezier(.2, .8, .3, 1) both; } @keyframes deal { from { transform: translateY(-60vh) rotate(-25deg); opacity: 0; } }
.slot.now .card { filter: drop-shadow(0 0 18px rgba(86, 102, 76, .7)); }

.reading-text { width: 100%; max-width: 620px; margin: 6px auto 0; text-align: left; }
.reading-text h3 { font-size: 26px; color: var(--head); } .reading-text h3 em { font-size: 15px; color: var(--clay); font-style: italic; margin-left: 8px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; } .keys span { padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(86, 102, 76, .4); font-size: 12px; color: var(--sage-d); }

/* ---------- journal ---------- */
.jrow { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.jcard { flex: none; width: 92px; border: 0; padding: 0; background: none; text-align: center; }
.jcard img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 6px 16px rgba(84, 70, 48, .19); }
.jcard small { display: block; margin-top: 6px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-d); }
.jcard span { display: block; font-family: var(--serif); font-size: 15px; line-height: 1.15; color: var(--text); }

/* ---------- card sheet (tap a card anywhere to study it) ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-end; justify-content: center; background: rgba(70, 68, 56, .42); backdrop-filter: blur(8px); }
.sheet.open { display: flex; animation: fade .3s; } @keyframes fade { from { opacity: 0; } }
.sheet-in { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; padding: 18px 18px max(22px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border: 1px solid rgba(86, 102, 76, .35); border-bottom: 0;
  background: linear-gradient(180deg, #fbf8f0, #f1eadb); animation: up .45s cubic-bezier(.2, .8, .3, 1); }
@keyframes up { from { transform: translateY(40%); } }
.sheet-in img { display: block; width: min(56vw, 240px); margin: 0 auto 12px; border-radius: 10px; box-shadow: 0 0 40px rgba(86, 102, 76, .35); }
.sheet-in h2 { font-size: 32px; color: var(--head); text-align: center; }
.sheet-in dt { margin-top: 12px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--sage-d); } .sheet-in dd { margin: 4px 0 0; font-family: var(--serif); font-size: 19px; }

@media (min-width: 720px) {
  .doors { grid-template-columns: 1fr 1fr; } .path { grid-template-columns: 1fr 1fr; } .suits { grid-template-columns: repeat(4, 1fr); }
  .sheet { align-items: center; } .sheet-in { border-radius: 22px; border-bottom: 1px solid rgba(86, 102, 76, .35); }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
/* reduced motion: one-off animations jump to their end, and looping ones stop (a loop that only had its duration shortened would flicker violently) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .box-wrap:not(.opening), .box-wrap:not(.opening) img, .halo, .wash, .orb.breath { animation: none !important; }
}

.candle { display: none; }

/* ---------- the box opens: the lid lifts and the cards fly out ---------- */
.box-wrap { aspect-ratio: 908 / 1488; animation: float 6s ease-in-out infinite; }
.box-wrap img { animation: none; object-fit: fill; }
.box-wrap .lid { position: absolute; left: 0; top: 0; width: 100%; height: 12.5%; background: top / 100% auto no-repeat; opacity: 0; transform-origin: 85% 100%; filter: drop-shadow(0 10px 14px rgba(84, 70, 48, .23)); }
.box-wrap.opening { animation: none; }
.box-wrap.opening img { animation: boxbody 2.6s cubic-bezier(.4, 0, .3, 1) forwards; clip-path: inset(12% 0 0 0); }
.box-wrap.opening .lid { opacity: 1; animation: lid 1.5s cubic-bezier(.3, .7, .3, 1) forwards; }
.box-wrap.opening .halo { animation: none; transform: scale(1.5); opacity: 1; transition: transform 1.4s, opacity 1.4s; }
@keyframes lid { 25% { transform: translateY(-40%) rotate(-4deg); opacity: 1; } 100% { transform: translate(34%, -330%) rotate(38deg); opacity: 0; } }
@keyframes boxbody { 0% { transform: none; } 12% { transform: scale(1.04) rotate(-1.5deg); } 24% { transform: scale(1.04) rotate(1.5deg); } 70% { transform: scale(1.02); opacity: 1; filter: drop-shadow(0 0 50px rgba(86, 102, 76, .7)); } 100% { transform: scale(.7) translateY(18%); opacity: 0; filter: brightness(2) blur(6px); } }
.fly { position: fixed; z-index: 58; border-radius: 6px; background: center / cover no-repeat; box-shadow: 0 8px 20px rgba(84, 70, 48, .19), 0 0 0 1px rgba(86, 102, 76, .3); pointer-events: none; will-change: transform, opacity; }

/* ---------- the shuffle: two piles, cards hopping between them ---------- */
.deck i { transition: transform .32s cubic-bezier(.3, .8, .3, 1); }

/* ---------- Bri's voice ---------- */
.orb { display: block; width: 46px; height: 46px; margin: 2px auto 10px; border-radius: 50%; pointer-events: none; opacity: .35; transition: opacity .6s;
  background: radial-gradient(circle, rgba(140, 156, 124, .42), rgba(140, 156, 124, .24) 50%, rgba(140, 156, 124, .07) 78%, transparent 100%);
  box-shadow: 0 0 calc(8px + var(--amp, 0) * 26px) calc(var(--amp, 0) * 5px) rgba(86, 102, 76, calc(.06 + var(--amp, 0) * .2)); transform: scale(calc(.85 + var(--amp, 0) * .45)); }
.orb.speaking { opacity: .8; }
.orb.breath { animation: breath 1.6s ease-in-out infinite; }
@keyframes breath { 50% { transform: scale(1.1); box-shadow: 0 0 22px 3px rgba(86, 102, 76, .18); } }

/* ---------- constellation ---------- */
.table { position: relative; }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible;  animation: starsettle 1.5s 3.2s forwards; }
.stars path { fill: none; stroke: #a98a5c; stroke-width: 1.6; stroke-linecap: round; transition: stroke-dashoffset 2.4s ease-in-out; }
.stars .star { fill: #a98a5c; stroke: none; opacity: 0; transform-box: fill-box; transform-origin: center; animation: starpop .7s forwards; }
@keyframes starpop { from { opacity: 0; transform: scale(0) rotate(-90deg); } to { opacity: 1; transform: scale(1); } }
@keyframes starsettle { to { opacity: .55; } }

/* ---------- a wash of watercolour between screens ---------- */
.sweep { position: fixed; inset: -10% -60%; z-index: 55; pointer-events: none; filter: blur(34px);
  background: radial-gradient(40% 60% at 30% 30%, rgba(140, 156, 124, .95), transparent 70%), radial-gradient(40% 60% at 55% 65%, rgba(206, 164, 140, .85), transparent 70%), radial-gradient(45% 70% at 72% 35%, rgba(216, 198, 166, 1), transparent 72%), linear-gradient(90deg, transparent 8%, #e6e7d8 34%, #e6e7d8 66%, transparent 92%);
  animation: sweep 1s cubic-bezier(.5, 0, .4, 1) forwards; }
@keyframes sweep { from { transform: translateX(-115%) rotate(-4deg); } to { transform: translateX(115%) rotate(4deg); } }
#view.leaving { opacity: 0; transform: translateY(-10px); filter: blur(5px); transition: opacity .34s, transform .34s, filter .34s; }

/* ---------- header: logo, booking, sound and voice ---------- */
a.chip, a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.chip.book { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 600; }
.chip.icon { width: 44px; padding: 0; display: grid; place-items: center; position: relative; flex: none; }
.chip.icon svg { width: 22px; height: 22px; fill: currentColor; } .chip.icon svg .wave { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chip.icon[aria-pressed="false"] { color: var(--dim); }
.chip.icon[aria-pressed="false"]::after { content: ""; position: absolute; left: 9px; right: 9px; top: 50%; height: 1.6px; background: currentColor; transform: rotate(-45deg); }
.menu-bar { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px 4px; }
.menu-bar[hidden] { display: none; }

/* ---------- home: logo and main menu ---------- */
.home-logo { display: block; width: min(72vw, 340px); height: auto; margin: 0 auto 2px; }
.home.menu { justify-content: flex-start; padding-top: 10px; }
.door { text-decoration: none; color: inherit; display: block; }
.door.book { min-height: 0; border-color: var(--sage-d); --tint: rgba(140, 156, 124, .55); }
@media (min-width: 720px) { .door.book { grid-column: 1 / -1; } }

/* ---------- booking with Bri ---------- */
.btn.book { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 600; box-shadow: 0 8px 22px rgba(86, 102, 76, .22); }
.book-note { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--sage); border-radius: 0 10px 10px 0; background: rgba(140, 156, 124, .14); font-size: 14px; color: var(--text); text-align: left; max-width: 520px; }
.book-note a { color: var(--sage-d); font-weight: 600; white-space: nowrap; }
.book-panel { border-color: var(--sage); background: linear-gradient(160deg, rgba(232, 236, 222, .95), rgba(251, 248, 240, .95)); text-align: center; }
.book-panel h3 { color: var(--head); } .book-panel p { max-width: 34em; margin-inline: auto; }
.book-panel .btn { margin-top: 6px; }
#end .row { margin-top: 14px; }

/* ---------- Bri's tattoos as a faint line drawing behind everything ---------- */
.ink { position: fixed; z-index: 1; pointer-events: none; right: -6%; bottom: -3%; width: min(96vw, 640px); aspect-ratio: 894 / 1400; background: url("img/ink.png?v=1") right bottom / contain no-repeat; opacity: .2; }
@media (min-width: 900px) { .ink { right: 2%; width: min(46vw, 620px); } }
