:root {
  --night: #0a0b22;
  --night2: #161a45;
  --ink: #2a2240;
  --cream: #f8f1e3;
  --gold: #e8c26a;
  --gold2: #c99a3a;
  --violet: #5b3d93;
  --wood: #2c2030;
  --ww: min(72vw, 46vh);
  --serif: "Frank Ruhl Libre", "David", serif;
  --sans: "Assistant", "Arial Hebrew", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: #f2eee6; font-family: var(--sans); overflow: hidden; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.scene { position: fixed; inset: 0; }

/* ---------- 1. החדר ---------- */
:root { --aw: min(52vw, 40vh); }
.room { position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(180deg, #0c0b26 0%, #17124a 48%, #241a5c 72%, #140f36 100%); }
.ambient { position: absolute; inset: 0; opacity: .35; transition: opacity 4s ease;
  background: radial-gradient(60vmax 45vmax at 50% 30%, rgba(150,120,255,.35), transparent 70%); }
.opened .ambient { opacity: 1; }
.layer { position: absolute; inset: 0; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); will-change: transform; }

.arch {
  position: absolute; left: 50%; top: 9vh; width: var(--aw); aspect-ratio: 3 / 4.3; translate: -50% 0;
  border-radius: 50% 50% 6px 6px / 34% 34% 6px 6px; overflow: hidden;
  background: linear-gradient(180deg, #05051c 0%, #0d0b33 55%, #2b2368 88%, #5a4a9e 100%);
  box-shadow: 0 0 0 1px rgba(232,194,106,.35), 0 0 40px 6px rgba(150,130,255,.18);
  transition: box-shadow 4s ease;
}
.opened .arch { box-shadow: 0 0 0 1px rgba(232,194,106,.55), 0 0 90px 24px rgba(160,140,255,.32), 0 0 200px 60px rgba(120,100,230,.18); }
.wings { position: absolute; inset: 0; perspective: calc(var(--aw) * 2.2); }
.wing {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background:
    radial-gradient(120% 60% at 50% 20%, rgba(255,255,255,.22), transparent 60%),
    linear-gradient(180deg, #b9a9ef 0%, #8e7ad6 45%, #6a55b8 100%);
  box-shadow: inset 0 0 40px rgba(255,240,210,.35);
  transition: transform 3.4s cubic-bezier(.65,0,.25,1), opacity 2.6s ease .4s, filter 2.6s ease;
}
.wing-r { right: 0; transform-origin: 100% 50%; border-left: 1px solid rgba(255,235,190,.6); }
.wing-l { left: 0; transform-origin: 0 50%; border-right: 1px solid rgba(255,235,190,.6); }
.opened .wing-r { transform: translateX(70%) scaleX(.6); opacity: 0; filter: brightness(1.7) blur(10px); }
.opened .wing-l { transform: translateX(-70%) scaleX(.6); opacity: 0; filter: brightness(1.7) blur(10px); }

.beam {
  position: absolute; left: 50%; top: calc(9vh + var(--aw) * 1.43 - 4px); width: calc(var(--aw) * 2.8); height: 72vh; translate: -50% 0;
  background: radial-gradient(30% 100% at 50% 0%, rgba(195,180,255,.34), rgba(195,180,255,.10) 55%, transparent 100%);
  -webkit-mask: linear-gradient(90deg, transparent 4%, #000 34%, #000 66%, transparent 96%); mask: linear-gradient(90deg, transparent 4%, #000 34%, #000 66%, transparent 96%);
  filter: blur(14px); opacity: 0; transition: opacity 4s ease 1s; mix-blend-mode: screen;
}
.opened .beam { opacity: 1; }
.motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.floor-glow { position: absolute; left: 50%; bottom: -8vh; width: 90vh; height: 24vh; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(180,160,255,.25), transparent); opacity: .3; transition: opacity 4s ease 1s; }
.opened .floor-glow { opacity: 1; }
.figure {
  position: absolute; left: 50%; bottom: -1px; height: 44vh; translate: -50% 0; transform-origin: 50% 100%;
  filter: brightness(.75); transition: filter 4s ease 1s; animation: breathe 6.5s ease-in-out infinite;
}
.opened .figure { filter: brightness(1.05) drop-shadow(0 -2px 18px rgba(200,180,255,.25)); }
@keyframes breathe { 50% { transform: scale(1.012, 1.018); } }

.target-star { position: absolute; left: 70%; top: 15%; width: 9%; aspect-ratio: 1; translate: -50% -50%; pointer-events: none; }

.quote {
  position: absolute; left: 5%; right: 5%; top: 33%; margin: 0; text-align: center;
  font-family: var(--serif); font-weight: 700; line-height: 1.4;
  font-size: clamp(17px, calc(var(--aw) * .078), 34px);
  color: #fffdf6; text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 2px 16px rgba(5,6,25,.9);
}
.quote span, .quote cite { display: block; opacity: 0; transform: translateY(8px); filter: blur(4px); transition: opacity 2s ease, transform 2s ease, filter 2s ease; }
.quote cite { font-style: normal; font-family: var(--sans); font-weight: 600; font-size: .55em; margin-top: .6em; color: #f6ecd2; }
.show-q1 .q1, .show-q2 .q2, .show-cite cite { opacity: 1; transform: none; filter: none; }

#veil { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: 0; transition: opacity 1.4s ease;
  background: radial-gradient(110% 80% at 50% 0%, #fffaf0 0%, var(--cream) 55%, #efe2c8 100%); }
#veil.on { opacity: 1; }
#soul { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 11; pointer-events: none; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
#intro, #sky { z-index: 1; }
.skip {
  position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 18px; z-index: 5;
  background: rgba(255,255,255,.08); color: #e8e3ff; border: 1px solid rgba(255,255,255,.18);
  padding: 8px 16px; border-radius: 99px; backdrop-filter: blur(6px);
}
.skip:hover { background: rgba(255,255,255,.16); }

/* ---------- 2. מכתב ---------- */
#letter { background: transparent; color: var(--ink); z-index: 12; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 50% { transform: scale(.82); opacity: .8; } }
@keyframes fadein { from { opacity: 0; } }
.letter-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.letter { max-width: 700px; margin: 0 auto; padding: 9vh 22px 60px; font-size: clamp(18.5px, 2.3vw, 21px); font-weight: 500; line-height: 1.8; color: #1d1630; }
.letter > * { animation: rise 1.4s ease both; }
.letter > *:nth-child(2) { animation-delay: .5s; } .letter > *:nth-child(3) { animation-delay: .9s; }
.letter > *:nth-child(n+4) { animation-delay: 1.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.l-quote { font-family: var(--serif); font-weight: 700; font-size: 1.4em; line-height: 1.45; text-align: center; color: #4a2c80; margin: 0 0 .9em; }
.l-quote cite { display: block; font-style: normal; font-family: var(--sans); font-weight: 600; font-size: .52em; color: #5d4f73; margin-top: .4em; }
.letter h1 { font-family: var(--serif); font-weight: 700; font-size: 1.3em; text-align: center; margin: 0 0 .4em; color: var(--ink); outline: none; }
.letter h1 .sep { color: var(--gold2); margin: 0 .3em; }
.letter h1 .dates { white-space: nowrap; }
.letter p { margin: 0 0 1em; }
.letter .privacy { border-right: 3px solid var(--gold); padding-right: 14px; color: #4b3f5f; }
.letter .sign { margin-top: 1.6em; }
.letter-actions { text-align: center; margin: 36px 0 40px; }
.logo-wide { display: block; width: min(100%, 400px); margin: 0 auto 30px; }

.btn { border: 0; border-radius: 99px; padding: 12px 26px; font-weight: 600; font-size: 1.02rem; transition: transform .15s ease, box-shadow .2s ease, background .2s; }
.btn:active { transform: scale(.97); }
.btn.gold { background: linear-gradient(180deg, #f3d488, var(--gold2)); color: #2a1d05; box-shadow: 0 6px 20px rgba(201,154,58,.35); }
.btn.gold:hover { box-shadow: 0 8px 28px rgba(201,154,58,.5); }
.btn.plain { background: transparent; color: inherit; border: 1px solid currentColor; opacity: .8; }
.btn.danger { background: #8a2a2a; color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- 3. שמיים ---------- */
#sky { background: radial-gradient(130% 100% at 50% 0%, var(--night2), var(--night) 60%, #04040f); animation: fadein 1.4s ease; }
.veins { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.veins path { fill: none; stroke: var(--gold); stroke-width: 1; stroke-opacity: .28; stroke-dasharray: 3 5; }
.stars { position: absolute; inset: 0; }
.story {
  position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; padding: 0; border: 0; background: none; border-radius: 50%;
}
.story svg { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); overflow: visible;
  filter: drop-shadow(0 0 5px rgba(255,210,130,.55)); animation: spin var(--tw, 20s) linear var(--td, 0s) infinite; transition: inset .25s, filter .25s; }
.story.ccw svg { animation-direction: reverse; }
.story:hover svg, .story:focus-visible svg { filter: drop-shadow(0 0 10px rgba(255,214,150,.85)); }
.story:focus-visible { outline: 1px dashed rgba(255,230,170,.6); outline-offset: 2px; }
.story .tip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis;
  font-size: 13px; color: #fff4d8; background: rgba(10,11,34,.85); border: 1px solid rgba(232,194,106,.35); padding: 3px 10px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.story:hover .tip, .story:focus-visible .tip { opacity: 1; }
.story.born svg { animation: born 2.4s ease-out, spin var(--tw, 20s) linear 2.4s infinite; }
@keyframes born { 0% { transform: scale(5) rotate(-200deg); filter: brightness(1.8); } 100% { transform: scale(1) rotate(0); } }

.share-star {
  position: absolute; left: 50%; top: max(9vh, 64px); transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: #fff6dd; padding: 6px 16px;
}
.share-star .core { width: 70px; height: 70px; overflow: visible; filter: drop-shadow(0 0 14px rgba(240,200,110,.55)); animation: spin 28s linear infinite, soulbreath 6.5s ease-in-out infinite; }
@keyframes soulbreath { 50% { scale: 1.06; filter: drop-shadow(0 0 22px rgba(240,200,110,.75)); } }
@keyframes pulse { 50% { transform: scale(1.18); box-shadow: 0 0 60px 22px rgba(240,200,110,.45); } }
.share-star .label { font-family: var(--serif); font-size: clamp(20px, 3.4vw, 30px); text-shadow: 0 0 16px rgba(255,210,130,.5); }
.share-star .sub { font-size: 16px; font-weight: 700; color: #2a1d05; background: linear-gradient(180deg, #f3d488, var(--gold2)); padding: 8px 20px; border-radius: 99px; box-shadow: 0 6px 22px rgba(201,154,58,.45); margin-top: 4px; }
.share-star:hover .sub { box-shadow: 0 8px 30px rgba(240,200,110,.65); }
.empty { position: absolute; top: 46%; left: 0; right: 0; text-align: center; color: #b9b4d6; font-size: 16px; padding: 0 24px; }

.sky-bar {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; left: 12px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 4;
}
.chip {
  background: rgba(255,255,255,.07); color: #ece8ff; border: 1px solid rgba(255,255,255,.16); border-radius: 99px; padding: 7px 14px; font-size: 14px; backdrop-filter: blur(6px);
}
.chip:hover { background: rgba(255,255,255,.14); }
.chip.ghost { margin-inline-start: auto; }
.logo-badge { position: absolute; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: min(230px, 50vw); opacity: .85; z-index: 2; pointer-events: none; }

/* ---------- דיאלוגים ---------- */
.dlg {
  width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 18px; padding: 26px 24px 22px;
  background: var(--cream); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.6); position: fixed;
}
.dlg::backdrop { background: rgba(4,4,18,.66); backdrop-filter: blur(3px); }
.dlg[open] { animation: pop .35s cubic-bezier(.2,.8,.3,1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dlg h2 { font-family: var(--serif); font-weight: 500; color: var(--violet); margin: 0 0 8px; font-size: 1.6rem; padding-left: 30px; }
.dlg .x { position: absolute; top: 10px; left: 12px; width: 36px; height: 36px; border: 0; background: none; font-size: 26px; color: #7d6e93; border-radius: 50%; }
.dlg .x:hover { background: rgba(0,0,0,.06); }
.hint { margin: 0 0 16px; color: #574a6b; line-height: 1.55; }
.dlg label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 12px; position: relative; }
.dlg label small { font-weight: 400; color: #8a7c9c; }
.dlg input, .dlg textarea {
  display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 400; font-size: 16px; color: var(--ink);
  background: #fffdf8; border: 1px solid #d9ccb2; border-radius: 10px; padding: 10px 12px; resize: vertical;
}
.dlg input:focus, .dlg textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold2); }
.counter { position: absolute; left: 10px; bottom: 6px; font-size: 12px; color: #9a8daa; font-variant-numeric: tabular-nums; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; gap: 0; } }
.hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.privacy.small { font-size: 13.5px; color: #6a5d7c; margin: 4px 0 14px; }
.err { color: #8a2a2a; margin: 0 0 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.read .r-text { white-space: pre-wrap; line-height: 1.8; font-size: 17.5px; margin: 10px 0 14px; max-height: 58dvh; overflow-y: auto; }
.read .r-meta { color: #7d6e93; font-size: 14.5px; margin: 0 0 16px; }

.all #allList { max-height: 72dvh; overflow-y: auto; margin-top: 8px; }
.all article { border-top: 1px solid #e3d6bd; padding: 16px 0; }
.all article h3 { font-family: var(--serif); font-weight: 500; color: var(--violet); margin: 0 0 6px; font-size: 1.2rem; }
.all article p { white-space: pre-wrap; margin: 0 0 6px; line-height: 1.75; }
.all article .m { color: #7d6e93; font-size: 14px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px); opacity: 0; z-index: 50;
  background: rgba(20,18,48,.92); color: #fff4d8; border: 1px solid rgba(232,194,106,.5); padding: 10px 20px; border-radius: 99px;
  transition: opacity .3s, transform .3s; pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 520px) { .letter h1 .sep { display: none; } .letter h1 .dates { display: block; } }
.still *, .still *::before { transition: none !important; animation: none !important; }
.still .skip { display: none; }

.invite { background: linear-gradient(180deg, rgba(255,250,236,.95), rgba(248,234,200,.9)); border: 2px solid var(--gold); border-radius: 16px; padding: 20px 22px 22px; margin: 1.4em 0 1.6em; box-shadow: 0 8px 30px rgba(201,154,58,.18); }
.invite p { margin: 0 0 .8em; }
.invite p:first-child { font-weight: 700; font-size: 1.05em; color: #3a2470; }
.btn.big { font-size: 1.12rem; padding: 14px 30px; display: block; margin: 16px auto 0; }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 22%; display: block; }
@media (max-aspect-ratio: 3/4) {
  :root { --aw: min(72vw, 42vh); }
  .arch { top: 7vh; }
  .beam { top: calc(7vh + var(--aw) * 1.43 - 4px); }
  .figure { height: 50vh; }
}

/* ---------- סבב שיפורים: עיצוב ---------- */
.seam { display: block; width: min(320px, 70%); height: 14px; margin: .2em auto 1.6em; }
.letter [lang=en] { white-space: nowrap; font-family: var(--serif); font-style: italic; color: #4a2c80; }
.invite .inv-h { font-family: var(--serif); font-weight: 700; font-size: 1.35em; color: #4a2c80; text-align: center; margin: 0 0 .5em; }
.invite p:first-child, .invite p { font-weight: 500; color: #1d1630; font-size: 1em; }
.invite .inv-lead { margin: .4em 0 .2em; font-weight: 600; }
.inv-q { list-style: none; padding: 0; margin: 0 0 .4em; display: grid; gap: .3em; }
.inv-q li::before { content: "✦"; color: var(--gold2); margin-inline-end: .55em; font-size: .8em; }
.btn.outline { background: transparent; color: #4a2c80; border: 1.5px solid var(--gold2); }
.btn.outline:hover { background: rgba(232,194,106,.12); }
.sticky-share { position: sticky; bottom: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); text-align: center;
  background: linear-gradient(rgba(248,241,227,0), rgba(248,241,227,.96) 40%); transition: opacity .4s, transform .4s; }
.sticky-share.off { opacity: 0; transform: translateY(100%); pointer-events: none; }
@media (min-width: 900px) { .sticky-share { display: none; } }
.letter .privacy { color: #3a2f4d; }
@media (max-width: 520px) { .letter { font-size: 19px; } }

.share-star .label { font-weight: 700; font-size: clamp(26px, 5.4vw, 40px); color: #fff8e6; }
.share-star .sub { white-space: nowrap; font-size: clamp(16px, 4.2vw, 19px); padding: 11px 26px; }
.share-star .core { width: clamp(80px, 20vw, 108px); height: auto; aspect-ratio: 1; }
.share-star .empty { position: static; display: block; margin-top: 18px; font-family: var(--serif); font-size: 18px; color: #d9d3f2; white-space: normal; width: min(84vw, 360px); text-wrap: balance; }
.share-star { transition: top 1.2s ease, transform 1.2s ease; }
#sky.is-empty .share-star { top: 50%; transform: translate(-50%, -60%); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chip { font-size: 15.5px; padding: 8px 16px; }

/* דיאלוגים */
.dlg { border-top: 3px solid transparent;
  background: linear-gradient(var(--cream), var(--cream)) padding-box, linear-gradient(90deg, transparent, #f3d488, #c99a3a, #f3d488, transparent) border-box; }
.dlg h2 { font-weight: 700; font-size: 1.75rem; text-align: center; padding: 0 36px; margin-bottom: 2px; }
.dlg .seam { margin: 0 auto 14px; width: min(260px, 60%); }
.dlg label { font-size: 16.5px; }
.dlg input, .dlg textarea { font-size: 17.5px; line-height: 1.7; border-color: #cdbb95; background: #fffef9; }
.dlg textarea { font-family: var(--serif); }
.counter { color: #6a5d7c; }
.dlg label small { color: #6a5d7c; }
.btn.plain { opacity: 1; }
.read .r-text { font-family: var(--serif); font-size: 19.5px; }
.read .r-text p { margin: 0 0 .8em; animation: rise .9s ease both; }
.all article h3 { cursor: pointer; }
.prompts { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.prompts button { border: 1px solid #d9c79f; background: #fffaf0; color: #4a2c80; border-radius: 99px; padding: 6px 13px; font-size: 15px; }
.prompts button[aria-pressed=true] { background: #f3e2b5; border-color: var(--gold2); }
.guard { background: rgba(232,194,106,.16); border-inline-start: 3px solid var(--gold); border-radius: 8px; padding: 9px 12px; font-size: 15.5px; color: #3a2f4d; margin: 0 0 14px; }
.dlg .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 15.5px; color: #3a2f4d; margin: 4px 0 14px; }
.dlg .check input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--gold2); }
.actions .btn.gold { flex: 1; }
.share-done { text-align: center; padding: 30px 6px 18px; animation: rise .8s ease both; }
.done-h { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; color: #4a2c80; line-height: 1.5; margin: 0 0 10px; }
.done-sub { color: #5d4f73; margin: 0; }

/* פתיחה: כפתור דילוג ברור יותר */
.skip { font-size: 16px; padding: 11px 20px; min-height: 44px; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.32); color: #fff; }

/* נשימה לפני קריאה */
#sky .stars .story { transition: opacity .8s ease, filter .8s ease; }
#sky.listening .stars .story:not(.focus) { opacity: .2; }
#sky.listening .stars .story.focus svg { filter: drop-shadow(0 0 16px rgba(255,214,150,.95)); }
.breath { position: absolute; width: 140px; height: 140px; margin: -70px 0 0 -70px; border-radius: 50%; pointer-events: none; z-index: 4;
  border: 1.5px solid rgba(255,230,170,.55); box-shadow: 0 0 30px rgba(255,214,150,.35), inset 0 0 30px rgba(255,214,150,.25);
  animation: breath 3.6s ease-in-out both; }
.breath-text { position: absolute; transform: translate(-50%, 70px); z-index: 4; color: #f6ecd2; font-family: var(--serif); font-size: 18px; white-space: nowrap;
  animation: fadein 1s ease both; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
@keyframes breath { 0% { scale: .5; opacity: 0; } 45% { scale: 1.35; opacity: 1; } 100% { scale: .5; opacity: 0; } }
.veins path { stroke-dasharray: none; stroke-opacity: .32; stroke-width: 1.1; }
.veins path.new { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- סבב שיפורים: תנועה ---------- */
.instant, .instant * { transition: none !important; }
#letter.leaving { opacity: 0; transition: opacity .7s cubic-bezier(.4,0,.2,1); }
.wing { transition: transform 4.4s cubic-bezier(.36,.02,.12,1), opacity 3.2s cubic-bezier(.4,0,.6,1) .55s, filter 3.4s ease .2s; }
.wing-l { transition-delay: .14s, .69s, .34s; }
.story { animation: starbreath var(--bw, 7s) ease-in-out var(--bd, 0s) infinite; }
@keyframes starbreath { 50% { scale: .9; opacity: .8; } }
.story.born svg { animation: born 2.4s cubic-bezier(.2,.7,.3,1), spin var(--tw, 90s) linear 2.4s infinite; }
@keyframes born { 0% { transform: scale(1.6); opacity: 0; filter: brightness(1.8); } 100% { transform: scale(1); opacity: 1; } }

/* כותרת על החלון הסגור, לפני שהוא נפתח (בקשת נאוה) */
.title-card { position: absolute; left: 0; right: 0; top: 13%; bottom: 42%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35em;
  text-align: center; padding: 0 8%; pointer-events: none; font-family: var(--serif); font-weight: 700; color: #241a52; }
.title-card .tc1 { font-size: clamp(24px, calc(var(--aw) * .125), 54px); line-height: 1.2; text-wrap: balance; opacity: 0; transform: translateY(10px); filter: blur(4px);
  transition: opacity 1.6s ease, transform 1.6s ease, filter 1.6s ease; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.title-card .tc2 { font-family: var(--sans); font-weight: 700; letter-spacing: .06em; font-size: clamp(17px, calc(var(--aw) * .075), 32px); color: #3d2d78;
  opacity: 0; transform: translateY(10px); transition: opacity 1.6s ease .5s, transform 1.6s ease .5s; direction: ltr; }
.titled .title-card .tc1, .titled .title-card .tc2 { opacity: 1; transform: none; filter: none; }
.opened .title-card .tc1, .opened .title-card .tc2 { opacity: 0; filter: blur(6px); transform: scale(1.04); transition: opacity 1.4s ease, transform 1.8s ease, filter 1.4s ease; }

/* ---------- גימורים ---------- */
/* תפר הזהב: נמתח כמו תיקון, ואז ברק רך עובר לאורכו מדי כמה שניות */
.seam .sm { stroke-dasharray: 1; stroke-dashoffset: 1; }
.seam.in .sm { animation: draw 1.8s cubic-bezier(.6,.05,.25,1) .2s forwards; }
.seam .gl { stroke-dasharray: .07 1.2; stroke-dashoffset: .07; opacity: 0; filter: blur(.6px); }
.seam.in .gl { animation: glint 7s ease-in-out 2.2s infinite; }
@keyframes glint { 0% { stroke-dashoffset: .07; opacity: 0; } 8% { opacity: .9; } 40% { stroke-dashoffset: -1.05; opacity: .9; } 46%, 100% { stroke-dashoffset: -1.1; opacity: 0; } }
/* פסקאות המכתב עולות בעדינות בגלילה */
.letter > .reveal { opacity: 0; transform: translateY(14px); animation: none; transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.3,1); }
.letter > .reveal.in { opacity: 1; transform: none; }
/* כותרת החלון: מילה אחרי מילה */
.title-card .tc1 span { display: inline-block; opacity: 0; transform: translateY(8px); filter: blur(3px); transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease; }
.titled .title-card .tc1 span { opacity: 1; transform: none; filter: none; }
.title-card .tc1 { opacity: 1 !important; transform: none !important; filter: none !important; }
.opened .title-card .tc1 span { opacity: 0; filter: blur(6px); transition-delay: 0s !important; transition-duration: 1.2s; }
/* כפתור הזהב: ברק עדין במעבר עכבר */
.btn.gold { position: relative; overflow: hidden; }
.btn.gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); transform: translateX(-120%); }
.btn.gold:hover::after { transition: transform 1s ease; transform: translateX(120%); }
@media (prefers-reduced-motion: reduce) { .seam .sm { stroke-dashoffset: 0; } .seam .gl { display: none; } .letter > .reveal { opacity: 1; transform: none; } }

/* iOS: אחרי טעינה מחדש סרגלי הדפדפן משנים את גובה המסך — הסצנות ממלאות את הגובה הגדול,
   ומה שמעוגן לתחתית יושב בקצה הנראה בפועל (100lvh-100dvh = גובה הסרגלים) */
html, body { background: #120d30; }
@supports (height: 100lvh) {
  :root { --tb: calc(100lvh - 100dvh); }
  .scene { inset: auto; top: 0; left: 0; right: 0; height: 100lvh; }
  .figure { bottom: calc(var(--tb) - 1px); }
  .floor-glow { bottom: calc(var(--tb) - 8vh); }
  .skip { bottom: calc(var(--tb) + max(18px, env(safe-area-inset-bottom))); }
  .letter-scroll { bottom: var(--tb); }
  .logo-badge { bottom: calc(var(--tb) + max(16px, env(safe-area-inset-bottom))); }
  #veil { height: 100lvh; bottom: auto; }
}

.consent { border: 1px solid #e3d3ad; border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; background: #fffaf0; }
.consent summary { cursor: pointer; font-weight: 600; color: #4a2c80; font-size: 15.5px; }
.consent[open] summary { margin-bottom: 10px; }
.consent label:last-child { margin-bottom: 4px; }

.dlg { overflow-x: hidden; overscroll-behavior: contain; }
.dlg form, .dlg .share-body { max-width: 100%; }
.dlg input, .dlg textarea { max-width: 100%; }
@media (max-width: 520px) {
  .dlg { padding: 22px 16px 18px; }
  .dlg h2 { font-size: 1.45rem; padding: 0 30px; }
  .prompts { gap: 6px; }
  .prompts button { font-size: 14px; padding: 5px 11px; }
}

/* פרלקסה: שכבות עמוקות מעט גדולות מהמסגרת כדי שלא ייחשפו קצוות בתזוזה */
.sky.deep { inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); }
.mid { position: absolute; inset: 0; }
.layer { transition: none; }

/* ---------- סיור אוטומטי ---------- */
#sky.touring .stars .story:not(.focus) { opacity: .45; }
#sky.touring .stars .story.focus svg { filter: drop-shadow(0 0 16px rgba(255,214,150,.95)); }
#sky.touring .stars .story.focus { animation: none; scale: 1.35; transition: scale 1.2s cubic-bezier(.2,.7,.3,1), opacity .8s; }
.tour-card { position: absolute; left: 50%; bottom: calc(var(--tb, 0px) + max(70px, 9vh)); translate: -50% 12px; width: min(560px, 88vw); z-index: 5;
  display: flex; flex-direction: column; gap: 6px; text-align: right; padding: 16px 20px 14px; border-radius: 16px;
  background: rgba(14,12,44,.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(232,194,106,.45); box-shadow: 0 10px 40px rgba(0,0,0,.45); color: #f6efdc;
  opacity: 0; transition: opacity .7s ease, translate .9s cubic-bezier(.2,.7,.3,1); cursor: pointer; }
.tour-card.on { opacity: 1; translate: -50% 0; }
.tc-title { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: #ffe9b0; }
.tc-text { font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; color: #efe8ff; }
.tc-more { font-size: .9rem; color: #e8c26a; margin-top: 2px; }
@media (max-width: 520px) { .tour-card { bottom: calc(var(--tb, 0px) + 66px); padding: 14px 16px 12px; } .tc-text { font-size: 1rem; } }

/* חלון הסיפור: שורת מטא שקטה + ניווט בקצוות (RTL: הקודם מימין, הבא משמאל) */
.read .r-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.read .r-foot .r-meta { margin: 0; }
.r-link { background: none; border: 0; padding: 4px 0; color: #4a2c80; font-size: 15px; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(201,154,58,.6); text-underline-offset: 4px; }
.r-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #e6d8bb; padding-top: 14px; }
.r-nav .btn { padding: 9px 20px; font-size: 16px; }
.r-nav .btn[hidden] + .btn, .r-nav .btn:only-child { margin-inline-start: auto; }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; } .nav-btn .ar { font-size: 1.1em; line-height: 1; }
.nav-btn { direction: ltr; }
