/* החלום של ינון · demo. Night navy (the mantle), warm gold light, parchment, wood. */
/* The scroll's script: Stam Ashkenaz CLM (Culmus, GPL-2 with the font exception; see ../SOURCES.md) */
@font-face { font-family: 'Stam'; src: url(../fonts/StamAshkenazCLM.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Stam Sefarad'; src: url(../fonts/StamSefaradCLM.ttf) format('truetype'); font-display: swap; }
:root {
  --night: #0b1426; --navy: #13244a; --mantle: #1f3a6b;
  --gold: #e8c06a; --gold-2: #f6dc9a; --gold-deep: #a8792a;
  --parch: #f1e6cc; --parch-2: #e7d6b0; --ink: #1d140c; --ink-soft: #4a3b2a;
  --wood: #5a3519; --wood-2: #8b5a2f; --silver: #d9dde3;
  --cream: #faf6ec; --text: #1b2333; --muted: #6b6f7a;
  --serif: 'Frank Ruhl Libre', 'David', serif; --sans: 'Heebo', system-ui, sans-serif; --stam: 'Stam', 'Frank Ruhl Libre', serif; --rashi: 'Noto Rashi Hebrew', 'Frank Ruhl Libre', serif;
  --colW: 300px; --fs: 15px; --lh: 20px; --gap: 36px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--cream); color: var(--text); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
.muted { color: var(--muted); font-size: .85em; }
.center { text-align: center; }
[hidden] { display: none !important; }

.preview-pill { position: fixed; z-index: 90; left: 12px; top: calc(10px + env(safe-area-inset-top)); border: 1px solid #e8c06a66; background: #0b1426e6; color: var(--gold-2);
  font-size: 12px; padding: 6px 12px; border-radius: 999px; box-shadow: 0 6px 18px #0006; }
body.reading .preview-pill { display: none; }

/* ---------------------------------------------------------------- story */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden;
  color: #fff; background: radial-gradient(120% 90% at 50% 10%, #22386a 0%, var(--night) 62%); padding: 64px 16px 40px; }
.hero-bg { position: absolute; inset: 0; background: url(../img/bg-tall.webp) center / cover; }
@media (min-aspect-ratio: 1/1) { .hero-bg { background-image: url(../img/bg-wide.webp); } }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 48%, rgba(11, 20, 38, .15), rgba(7, 12, 26, .82) 70%, #070c1a 100%); }
.motes { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-in { position: relative; text-align: center; max-width: 560px; }
.eyebrow { font-size: 14px; letter-spacing: .3em; color: var(--gold); margin: 0 0 6px; }
.hero h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(44px, 11vw, 84px); margin: 0 0 22px; line-height: 1;
  background: linear-gradient(180deg, #fff6dc, var(--gold) 70%, var(--gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(232, 192, 106, .35)); }
.avatar-ring { width: 132px; height: 132px; margin: 0 auto 22px; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 200deg, var(--gold-deep), var(--gold-2), var(--gold), var(--gold-deep));
  box-shadow: 0 0 50px rgba(232, 192, 106, .45); }
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--night); }
.lead { font-size: 19px; line-height: 1.6; color: #e6e9f2; margin: 0 0 28px; }
.hero-note { margin: 18px 0 0; font-size: 13px; color: #aab3c9; }
.cta { border: 0; border-radius: 999px; padding: 15px 30px; font-weight: 700; font-size: 17px; color: #2a1a02;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #c99a45); box-shadow: 0 8px 30px rgba(232, 192, 106, .35), inset 0 1px 0 #fff6; }
.cta:active { transform: translateY(1px); }
.cta.small { padding: 10px 18px; font-size: 15px; }
.cta.wide { width: 100%; margin-top: 14px; }
.cta.ghost { background: transparent; color: var(--mantle); border: 2px solid var(--gold); box-shadow: none; }
.cta[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { border: 0; background: none; color: var(--mantle); font-weight: 700; padding: 8px 0; text-decoration: underline; text-underline-offset: 4px; }
.link-btn.center { display: block; margin: 8px auto 0; }

section h2 { font-family: var(--serif); font-size: 30px; margin: 0 0 14px; color: var(--navy); }
section h2 small { font-family: var(--sans); font-size: 13px; color: var(--gold-deep); font-weight: 500; margin-inline-start: 8px; }
main > section:not(.hero) { padding: 34px 16px; max-width: 980px; margin: 0 auto; }
@media (min-width: 760px) { main > section:not(.hero) { padding: 56px 16px; } }

.dream { display: grid; gap: 28px; align-items: center; }
@media (min-width: 760px) { .dream { grid-template-columns: 340px 1fr; } }
.arch { margin: 0; border-radius: 170px 170px 18px 18px; overflow: hidden; box-shadow: 0 20px 50px #13244a33; border: 6px solid #fff; max-width: 340px; justify-self: center; }
.arch img { aspect-ratio: 3/4; object-fit: cover; width: 100%; transform: scale(1.12); transform-origin: 88% 34%; } /* trims the edge where someone else's foot shows */
.dream-text p { font-size: 17px; line-height: 1.75; }
blockquote { font-family: var(--serif); font-weight: 700; font-size: 26px; margin: 10px 0; padding: 16px 20px; color: var(--navy);
  background: linear-gradient(90deg, #f7ecd0, #fbf5e5); border-inline-start: 4px solid var(--gold); border-radius: 8px; }

.progress-sec { text-align: center; }
.progress-num { font-size: 18px; } .progress-num b { font-family: var(--serif); font-size: 40px; color: var(--navy); }
.bar { height: 10px; background: #e7e1d1; border-radius: 99px; overflow: hidden; margin: 12px auto; max-width: 560px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: 99px; transition: width 1.6s ease; }
.progress-sub { color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; counter-reset: s; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 4px 18px #13244a12; counter-increment: s; position: relative; }
.steps li::before { content: counter(s); position: absolute; top: 14px; left: 16px; font-family: var(--serif); font-size: 34px; color: var(--gold); opacity: .6; }
.steps b { display: block; font-size: 19px; color: var(--navy); margin-bottom: 4px; }

.ladder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ladder-grid div { background: #fff; border-radius: 14px; padding: 14px; text-align: center; box-shadow: 0 3px 14px #13244a10; }
.ladder-grid b { display: block; font-family: var(--serif); font-size: 21px; color: var(--navy); }
.ladder-grid span { color: var(--gold-deep); font-weight: 700; }

.keter { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: center; background: linear-gradient(135deg, var(--navy), var(--mantle)) !important;
  color: #fff; border-radius: 22px; margin: 20px auto !important; max-width: 940px !important; }
.keter img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; }
.keter h2 { color: var(--gold-2); } .keter p { color: #d6dcec; }
.keter-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .keter-row b { font-family: var(--serif); font-size: 26px; color: var(--gold); }

.name-form { display: flex; gap: 8px; } .name-form input { flex: 1; }
input:not([type=checkbox]):not([type=file]) { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #d8d1bf; background: #fff; min-width: 0; }
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.wall ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.wall li { background: #fff; border-radius: 12px; padding: 10px 14px; font-size: 14px; border-inline-start: 3px solid var(--gold); }
.wall li b { display: block; font-family: var(--serif); font-size: 16px; color: var(--navy); }

.faq details { background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 700; color: var(--navy); cursor: pointer; }
.foot { text-align: center; padding: 40px 16px 80px; color: var(--navy); }

/* ---------------------------------------------------------------- 3D hero */
#three { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: none; }
body.has-three #three { display: block; }
body.has-three .motes { display: none; }
body.reading #three { position: fixed; z-index: 45; }
.hero-in { z-index: 2; }
body.has-three .hero { place-items: stretch; padding: 44px 16px 28px; }
body.has-three .hero-in { max-width: none; height: calc(100svh - 72px); display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
body.has-three .hero-in button { pointer-events: auto; }
body.has-three .avatar-ring { width: 74px; height: 74px; margin-bottom: 0; }
body.has-three .hero h1 { margin-bottom: 12px; }
.hero-bottom .lead { margin-bottom: 18px; text-shadow: 0 2px 12px #000c; }
.cta.big { font-size: 18px; padding: 17px 34px; animation: callout 2.6s ease-in-out infinite; }
@keyframes callout { 0%, 100% { box-shadow: 0 8px 30px rgba(232, 192, 106, .35), inset 0 1px 0 #fff6; } 50% { box-shadow: 0 8px 50px rgba(232, 192, 106, .75), inset 0 1px 0 #fff6; } }
.hero-in { transition: opacity .6s ease; }
body.reading .hero-in { opacity: 0; }

/* ---------------------------------------------------------------- the stage */
.stage { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr auto; padding-top: env(safe-area-inset-top);
  background: radial-gradient(90% 70% at 50% 45%, #2a2112 0%, #120d07 55%, #07050a 100%); color: #f3ead6;
  opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.stage.on { opacity: 1; pointer-events: auto; }
.stage-top { padding: 10px 12px 6px; display: grid; grid-template-columns: auto 1fr; gap: 10px; position: relative; z-index: 5; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #ffffff2a; background: #ffffff10; color: #f3ead6; font-size: 18px; }
.search { display: flex; background: #ffffff14; border: 1px solid #ffffff30; border-radius: 999px; overflow: hidden; }
.search input { flex: 1; background: transparent !important; border: 0 !important; color: #fff; padding: 10px 16px !important; }
.search input::placeholder { color: #cbbf9f; }
.search button { border: 0; background: transparent; color: var(--gold); font-size: 22px; padding: 0 16px; }
.results { position: absolute; top: calc(100% - 4px); left: 12px; right: 12px; z-index: 12; background: #1c150c; border: 1px solid #e8c06a44; border-radius: 14px; max-height: 46vh; overflow: auto; box-shadow: 0 18px 40px #000a; }
.results button { display: block; width: 100%; text-align: start; border: 0; border-bottom: 1px solid #ffffff12; background: none; color: #f3ead6; padding: 11px 14px; }
.results button small { display: block; color: #bfae86; font-size: 12px; margin-top: 2px; }
.results button:hover, .results button:focus { background: #e8c06a1c; }
.results .r-head { padding: 9px 14px; color: var(--gold); font-size: 13px; }
.chips { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; border: 1px solid #e8c06a55; background: #e8c06a12; color: #f6e7c2; border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.chips button.book { background: var(--gold); color: #2a1a02; border-color: var(--gold); font-weight: 700; }
.chips button.cur { outline: 2px solid var(--gold-2); }

.scroll { position: relative; display: flex; align-items: stretch; justify-content: center; padding: 18px 0; min-height: 0; }
.parchment { position: relative; flex: 1; max-width: 1100px; overflow: hidden; touch-action: none; cursor: grab;
  background:
    linear-gradient(90deg, #00000055 0, transparent 7%, transparent 93%, #00000055 100%),
    linear-gradient(180deg, rgba(120, 85, 40, .16), transparent 9%, transparent 91%, rgba(120, 85, 40, .2)),
    url(../img/klaf.webp) 0 0 / 520px,
    var(--parch);
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
  box-shadow: inset 0 0 60px #6b4a1f40, 0 0 80px #e8c06a22; }
.parchment:active { cursor: grabbing; }
.track { position: absolute; inset: 0; will-change: transform; }
.col { position: absolute; top: 0; left: 0; width: var(--colW); padding: calc(var(--lh) * 1.1) 0; will-change: transform; transform-origin: center; }
/* sheets of parchment are sewn together with sinew (גידים): a seam and its stitches in the gap */
.col.seam::after { content: ''; position: absolute; top: 1%; bottom: 1%; left: calc(var(--gap) / -2 - 3px); width: 6px;
  background: repeating-linear-gradient(180deg, rgba(92, 62, 28, .75) 0 5px, transparent 5px 26px) center / 6px 100% no-repeat,
    linear-gradient(90deg, transparent 2px, rgba(90, 60, 30, .28) 2px 3px, transparent 3px); }
.ln { position: relative; height: var(--lh); line-height: var(--lh); font-family: var(--stam); font-weight: normal; font-size: var(--fs); color: #160f08;
  display: flex; white-space: nowrap; column-gap: .3em; text-shadow: 0 0 .5px rgba(20, 12, 4, .55); }
/* שרטוט: the letters hang from a faint scored line */
.ln::before { content: ''; position: absolute; left: -3px; right: -3px; top: 21%; height: 1px; background: rgba(110, 78, 40, .13); pointer-events: none; }
.col { box-shadow: inset 1px 0 0 rgba(110, 78, 40, .1), inset -1px 0 0 rgba(110, 78, 40, .1); }
.ln.full { justify-content: space-between; column-gap: 0; }
.ln .gap { flex: none; width: calc(var(--fs) * 5.2); }
.w { border-radius: 3px; transition: color .4s, text-shadow .4s, background-color .3s; cursor: pointer; }
.w:hover { background: #e8c06a33; }
.w.sold { color: #8b6a33; text-decoration: underline dotted #b8892f; text-underline-offset: 3px; }
.w.part { text-decoration: underline dotted #b8892f88; text-underline-offset: 3px; }
.w.holy { cursor: default; } .w.holy:hover { background: none; }
.w.mine { color: #7a4d00; background: #f6d67a66; }
.w.mk { background: linear-gradient(180deg, transparent 4%, rgba(246, 205, 110, .62) 4%, rgba(246, 205, 110, .62) 98%, transparent 98%);
  box-shadow: 0 0 14px rgba(255, 214, 120, .75), inset 0 -2px 0 #c9962e; opacity: 1 !important; }
@media (pointer: fine) { .stage.live .parchment, .stage:not(.three) .parchment { cursor: none; } }
.w.lit { color: #5a3300; text-shadow: 0 0 2px #fff8d8, 0 0 9px #ffd66b, 0 0 20px #f0b43c, 0 0 38px #e8a42a; }
.track.dim .w:not(.lit) { opacity: .42; transition: opacity .6s; }
.track .w { transition: opacity .6s, color .4s, text-shadow .4s; }
.col.ghost .ln { background: repeating-linear-gradient(90deg, #3a2a1666 0 6px, transparent 6px 8px) center / 100% 34% no-repeat; }
.spot { position: absolute; inset: 0; pointer-events: none; animation: fadein .8s ease both;
  background: radial-gradient(var(--rw) var(--rh) at var(--sx) var(--sy), rgba(255, 236, 170, .22) 0%, rgba(255, 236, 170, .1) 55%, rgba(40, 24, 6, .34) 100%); }
@keyframes fadein { from { opacity: 0; } }
.demo-warn { color: #a3261a; font-weight: 700; font-size: 14px; margin: 8px 0 0; }
.halo { position: absolute; pointer-events: none; border-radius: 40%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 238, 178, .95), rgba(255, 214, 110, .55) 48%, rgba(255, 200, 90, 0)); animation: breathe 2.6s ease-in-out infinite; }
.halo i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff6cf; box-shadow: 0 0 10px #ffd76a, 0 0 18px #ffcd55;
  mix-blend-mode: normal; animation: rise 3.2s linear infinite; opacity: 0; }
.halo i:nth-child(1) { left: 12%; animation-delay: 0s; } .halo i:nth-child(2) { left: 26%; animation-delay: .5s; }
.halo i:nth-child(3) { left: 40%; animation-delay: 1.1s; } .halo i:nth-child(4) { left: 55%; animation-delay: 1.7s; }
.halo i:nth-child(5) { left: 68%; animation-delay: .8s; } .halo i:nth-child(6) { left: 80%; animation-delay: 2.2s; }
.halo i:nth-child(7) { left: 33%; animation-delay: 2.6s; } .halo i:nth-child(8) { left: 90%; animation-delay: 1.4s; }
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes rise { 0% { top: 85%; opacity: 0; } 15% { opacity: 1; } 100% { top: -10%; opacity: 0; } }
.caption { position: absolute; inset: auto 12px 12px 12px; margin: auto; max-width: 520px; text-align: center; padding: 12px 16px; border-radius: 14px;
  background: #120d07e6; color: #f6e7c2; border: 1px solid #e8c06a55; box-shadow: 0 10px 30px #0008; font-size: 14px; line-height: 1.5;
  animation: fadeup .6s ease both; }
.caption b { font-family: var(--serif); font-size: 18px; color: var(--gold-2); display: block; }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } }

/* rollers: the wood pole, the parchment wound on it (its thickness follows how much is rolled) */
.roller { position: relative; flex: none; width: 64px; filter: drop-shadow(0 12px 18px #000a); z-index: 3; display: grid; place-items: center; transition: transform 1.4s cubic-bezier(.2, .8, .2, 1); }
.roller .roll { position: absolute; top: 6px; bottom: 6px; width: var(--d, 40px); border-radius: 12px / 6px;
  background:
    repeating-linear-gradient(90deg, #00000014 0 1px, transparent 1px 5px),
    linear-gradient(90deg, #b9a27a, #f3e6c8 30%, #fff7e2 45%, #e4d2ab 70%, #9d845b);
  background-position: var(--spin, 0) 0, 0 0; box-shadow: 0 0 0 1px #6b4f2a55, 0 10px 30px #0009; }
.roller .pole { position: absolute; left: 50%; width: 16px; margin-left: -8px; height: 46px; border-radius: 6px;
  background: linear-gradient(90deg, #3b200d, var(--wood-2) 40%, #c08a52 50%, var(--wood) 70%, #2e1809); }
.roller .pole.top { top: -40px; } .roller .pole.bottom { bottom: -40px; }
.roller .pole::after { content: ''; position: absolute; left: 50%; width: 30px; margin-left: -15px; height: 12px; border-radius: 50%;
  background: radial-gradient(ellipse at 40% 35%, #fff, var(--silver) 40%, #8d939c); }
.roller .pole.top::after { top: -8px; } .roller .pole.bottom::after { bottom: -8px; }
.stage.closed .roller.right { transform: translateX(calc(-50vw + 64px)); }
.stage.closed .roller.left { transform: translateX(calc(50vw - 64px)); }
.stage.closed .parchment { clip-path: inset(0 50% 0 50%); }
.parchment { transition: clip-path 1.4s cubic-bezier(.2, .8, .2, 1); clip-path: inset(0 0 0 0); }

.stage-bottom { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); text-align: center; }
.where { font-size: 14px; color: #e9dcbc; min-height: 40px; line-height: 1.45; }
.where b { font-family: var(--serif); font-size: 17px; color: var(--gold-2); }
.where small { color: #a89870; }
.where .w2 { display: block; }
.stage-actions { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 6px; }
.basket { position: absolute; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 6; border: 0; border-radius: 999px; padding: 10px 16px;
  background: #fff7e0; color: #2a1a02; box-shadow: 0 8px 24px #0009; font-size: 14px; }

/* ---------------------------------------------------------------- sheets */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: #0008; }
.sheet { position: fixed; z-index: 80; inset: auto 0 0 0; margin: 0 auto; max-width: 560px; max-height: 88svh; overflow: auto;
  background: var(--cream); color: var(--text); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 50px #0007; animation: sheet .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { font-family: var(--serif); font-size: 24px; margin: 4px 0 12px; color: var(--navy); }
.sheet-x { position: absolute; top: 12px; left: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #0000000d; }
.pick-head { text-align: center; padding: 6px 30px 10px; }
.pick-word { font-family: var(--serif); font-weight: 700; font-size: 46px; color: var(--ink); line-height: 1.2; }
.pick-where { color: var(--muted); font-size: 14px; }
.pick-letters { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.pick-letters button { width: 44px; height: 52px; border-radius: 10px; border: 1.5px solid #d8cba8; background: #fff; font-family: var(--serif); font-size: 28px; color: var(--ink); }
.pick-letters button.on { background: var(--gold); border-color: var(--gold-deep); }
.pick-letters button[disabled] { opacity: .35; text-decoration: line-through; }
.opts { display: grid; gap: 6px; }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: start; width: 100%; padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid #e2d8c0; background: #fff; color: var(--text); }
.opt .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c5b78f; }
.opt.on { border-color: var(--gold-deep); background: #fff8e4; } .opt.on .dot { background: var(--gold); border-color: var(--gold-deep); box-shadow: inset 0 0 0 3px #fff; }
.opt b { display: block; } .opt small { color: var(--muted); }
.opt .price { font-weight: 700; color: var(--navy); }
.opt[disabled] { opacity: .5; cursor: not-allowed; }
.dedic { margin-top: 14px; display: grid; gap: 8px; }
.dedic-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.dedic-kinds button { border: 1.5px solid #d8cba8; background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 14px; }
.dedic-kinds button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.check { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.cart-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cart-list li { background: #fff; border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.cart-list li b { font-family: var(--serif); font-size: 17px; } .cart-list li small { display: block; color: var(--muted); }
.cart-list li button { border: 0; background: none; color: #a33; }
.cart-total { text-align: start; margin: 12px 0; font-size: 18px; } .cart-total b { font-family: var(--serif); font-size: 26px; color: var(--navy); }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pay-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.pay-tabs button { border: 1.5px solid #d8cba8; background: #fff; border-radius: 12px; padding: 10px 4px; font-size: 14px; }
.pay-tabs button.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.pay-panel { background: #fff; border-radius: 12px; padding: 12px 14px; }
.phone-copy { display: flex; justify-content: space-between; align-items: center; background: #f4efe2; border-radius: 10px; padding: 8px 12px; font-size: 20px; }
.phone-copy button { border: 0; background: var(--navy); color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 14px; }
.upload { display: block; border: 2px dashed #cdbf98; border-radius: 12px; padding: 14px; text-align: center; color: var(--navy); cursor: pointer; }
.upload input { display: block; margin: 8px auto 0; }
.cert-sheet { background: radial-gradient(120% 80% at 50% 0%, #22386a, var(--night)); color: #fff; }
.cert { margin: 6px 0 10px; padding: 26px 18px; border-radius: 16px; text-align: center; color: var(--ink);
  background: linear-gradient(180deg, #f6ead0, var(--parch)); box-shadow: inset 0 0 40px #8a6a3a44, 0 0 60px #e8c06a44; border: 1px solid #c9a96a; }
.cert-eyebrow { margin: 0; letter-spacing: .25em; font-size: 12px; color: var(--gold-deep); }
.cert h3 { font-size: 34px; margin: 4px 0 14px; color: var(--navy); }
.cert-items div { font-family: var(--serif); font-size: 22px; margin: 6px 0; }
.cert-items small { display: block; font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }
.cert-status { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }
.cert-sheet .link-btn { color: var(--gold-2); }
.toast { position: fixed; z-index: 95; left: 50%; top: 40px; transform: translateX(-50%); text-align: center; background: #1b1307; color: #f6e7c2; border: 1px solid #e8c06a66;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 92vw; box-shadow: 0 10px 30px #0008; }

@media (min-width: 900px) {
  .roller { width: 90px; }
  .stage.closed .roller.right { transform: translateX(calc(-50vw + 90px)); }
  .stage.closed .roller.left { transform: translateX(calc(50vw - 90px)); }
  .basket { left: 24px; bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- the stage over the 3D scroll */
.stage.three { background: transparent; }
.stage.three .roller { display: none; }
.stage.three .scroll { display: block; padding: 0; }
.stage.three .parchment { position: absolute; flex: none; max-width: none; clip-path: none; opacity: 0; transition: opacity .55s ease; box-shadow: none; }
.stage.three.live .parchment { opacity: 1; }
.stage.three .stage-top, .stage.three .stage-bottom, .stage.three .basket { opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.stage.three.live .stage-top, .stage.three.live .stage-bottom, .stage.three.live .basket { opacity: 1; pointer-events: auto; }
.stage.three .stage-top { background: linear-gradient(180deg, #070d1bf5 55%, #070d1b00); padding-bottom: 14px; }
.stage.three .stage-bottom { background: linear-gradient(0deg, #070d1bf5 55%, #070d1b00); padding-top: 16px; }
.basket.away { display: none; }

/* the chooser: tap a word, pick the size, the light follows */
.chooser { position: absolute; z-index: 7; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 20px));
  background: #fbf5e6f7; color: var(--text); border-radius: 18px; padding: 12px 12px 12px; box-shadow: 0 18px 50px #000b, 0 0 0 1px #e8c06a66; animation: fadeup .28s ease both; }
.ch-x { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #0000000f; }
.ch-title { text-align: center; padding: 0 32px 8px; }
.ch-title b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.15; color: var(--ink); }
.ch-title small { color: var(--muted); font-size: 13px; } .ch-title small b { display: inline; font-family: var(--sans); font-size: 13px; color: var(--gold-deep); }
.ch-units { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.ch-units::-webkit-scrollbar { display: none; }
.ch-units button { flex: none; display: grid; gap: 1px; text-align: center; min-width: 68px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid #e0d4b4; background: #fff; }
.ch-units button b { font-size: 15px; color: var(--navy); } .ch-units button span { font-size: 12px; color: var(--gold-deep); font-weight: 700; }
.ch-units button.on { background: var(--navy); border-color: var(--navy); } .ch-units button.on b { color: #fff; } .ch-units button.on span { color: var(--gold-2); }
.ch-units button.off { opacity: .5; } .ch-units button.off span { color: var(--muted); font-weight: 500; }
.ch-desc.why { color: #8a4b10; font-family: var(--sans); font-weight: 500; }
.where .sponsor { display: block; color: var(--gold-2); font-family: var(--rashi); font-size: 13px; margin-top: 2px; }
.ch-letters { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.ch-letters button { width: 40px; height: 46px; border-radius: 10px; border: 1.5px solid #d8cba8; background: #fff; font-family: var(--serif); font-size: 26px; }
.ch-letters button.on { background: var(--gold); border-color: var(--gold-deep); }
.ch-letters button[disabled] { opacity: .3; text-decoration: line-through; }
.ch-desc { margin: 6px 4px 0; font-size: 13px; color: var(--ink-soft); text-align: center; font-family: var(--serif); min-height: 1.4em; }
.chooser .cta.wide { margin-top: 8px; padding: 12px; }

/* the silver יד: the pointer a reader follows the text with. Its fingertip sits at the translate point. */
.yad { position: fixed; left: 0; top: 0; z-index: 60; width: 58px; margin-left: -29px; margin-top: -86px; pointer-events: none;
  transform-origin: 50% 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); transition: opacity .15s; }
@media (pointer: fine) { .yad { width: 46px; margin-left: -23px; margin-top: -68px; } }
.loupe { position: fixed; left: 0; top: 0; z-index: 61; pointer-events: none; padding: 6px 14px 8px; border-radius: 14px; text-align: center;
  background: radial-gradient(120% 140% at 50% 30%, #fbf3dc, #efdcae); box-shadow: 0 12px 30px rgba(0, 0, 0, .55), 0 0 0 1.5px #c99a45; }
.loupe b { display: block; font-family: var(--stam); font-weight: normal; font-size: 34px; line-height: 1.15; color: #160f08; }
.loupe small { display: block; font-size: 12px; color: var(--gold-deep); font-weight: 700; }

/* the whole Torah in one strip */
.minimap { position: relative; height: 31px; margin: 0 auto 6px; max-width: 760px; touch-action: none; cursor: ew-resize; }
.minimap canvas { width: 100%; height: 100%; display: block; border-radius: 4px; }
#mm-win { position: absolute; top: -2px; left: 0; height: 22px; border-radius: 4px; border: 1.5px solid var(--gold-2); box-shadow: 0 0 10px rgba(246, 220, 154, .6); pointer-events: none; }

/* the light map on the story page */
.lightmap-sec canvas { width: 100%; height: 190px; display: block; border-radius: 14px; cursor: pointer; box-shadow: 0 14px 40px #13244a33; }
@media (max-width: 620px) { .lightmap-sec canvas { height: 150px; } }

/* the certificate: the quill writes the part on klaf */
.cert { background: url(../img/klaf.webp) 0 0 / 420px, var(--parch) !important; }
.ink-wrap { position: relative; min-height: 90px; display: grid; place-items: center; margin: 4px 0 6px; }
.ink { font-family: var(--stam); font-size: 54px; line-height: 1.25; color: #05050a; text-align: center; max-width: 100%; text-shadow: 0 0 1px rgba(30, 40, 90, .6); }
.ink .iw { display: inline-block; white-space: nowrap; font-weight: normal; }
.ink.long { font-size: 34px; }
.ink span { display: inline-block; opacity: 0; clip-path: inset(0 0 0 100%); transition: clip-path .24s linear, opacity .05s; }
.ink span.in { opacity: 1; clip-path: inset(-20% -10% -20% 0); }
.ink.dry { color: #160f08; text-shadow: 0 0 .6px rgba(20, 12, 4, .6); transition: color 1.6s, text-shadow 1.6s; }
.ink i { display: inline-block; width: .3em; }
.quill { position: absolute; left: 0; top: 0; width: 110px; pointer-events: none; transition: transform .14s ease-out, opacity .6s; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .35)); }
.quill.lift { opacity: 0; transform: translate(220px, -120px) rotate(18deg) !important; transition: transform .9s ease-in, opacity .9s; }
.cert-ded { font-family: var(--rashi); font-size: 19px; color: #3a2a14; margin: 0 0 10px; }
.pick-word, .ch-title b { font-family: var(--stam) !important; font-weight: normal !important; }
.pick-word.long { font-size: 30px; }

/* short screens (a phone held sideways): keep the scroll, drop what is not needed */
@media (max-height: 560px) {
  body.has-three .avatar-ring, .hero-bottom .lead, .hero-note { display: none; }
  .hero h1 { font-size: 40px !important; margin-bottom: 4px !important; }
  .stage-top { padding-top: 4px; } .stage .chips { display: none; }
  .stage-actions { display: none; }
  .where { min-height: 0; font-size: 12px; } .where b { font-size: 14px; } .where .w2 { display: inline; margin-inline-start: 6px; }
  .caption { font-size: 12px; padding: 8px 12px; max-width: 420px; } .caption b { font-size: 15px; }
  .minimap { height: 24px; margin-bottom: 2px; } #mm-win { height: 15px; }
  .chooser { bottom: 8px; max-height: calc(100% - 70px); overflow: auto; }
  .basket { bottom: 52px; }
}

.cta.loading { opacity: .85; }
.cta.loading::after { content: ' · טוען את הספר'; font-weight: 500; }
.wall li.empty { border-inline-start-color: #e2d8c0; color: var(--muted); font-family: var(--serif); font-size: 16px; }
.progress-sec .progress-sub { margin-top: 6px; }
.cert-status a { color: var(--navy); font-weight: 700; }
.hero { padding-top: calc(28px + env(safe-area-inset-top)); }

input[type=checkbox] { accent-color: var(--navy); width: 18px; height: 18px; }
.pay-panel a { color: var(--navy); font-weight: 700; }
