/* HYLME · Let Your Wishes Float — storytelling Loy Krathong. Mobile-first.
   Mood: midnight navy water, warm candlelight, soft gold, muted lotus pink. */
/* @font-face rules live in css/fonts.css (public OFL set) / css/fonts-ci.css (licensed CI set) */
:root {
  /* HYLME CI: deep forest green · cream · olive (+ soft gold secondary) */
  --forest: #1A210F; --forest-2: #242E15; --forest-3: #3A4A22; /* #3A4A22 = official Hylme green (RGB 58-74-34) */
  --gold: #D4BF8B; --gold-2: #E8DDBA; --gold-d: #A99A66;
  --olive: #A9AE7E; --olive-l: #D3D5AE;
  --lotus: #D9B1B7; --cream: #E7E8CD; /* official Hylme cream (RGB 231-232-205) */ --mist: rgba(231, 232, 205, .76); --mist-2: rgba(231, 232, 205, .54);
  --line: rgba(231, 232, 205, .14); --line-2: rgba(231, 232, 205, .26);
  --thai: 'Brand Thai', 'Aktiv Grotesk Thai', 'Noto Sans Thai', system-ui, sans-serif;
  --head: 'Brand Headline', 'Tenor Sans', 'Poppins', sans-serif;
  --serif: 'Brand Display', 'The Seasons', 'Cormorant Garamond', Georgia, serif;
  --latin: 'Poppins', 'Century Gothic', 'Brand Thai', sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --pad: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 300 16px/1.7 var(--thai); color: var(--cream); background: var(--forest); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) var(--pad) 14px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.wordmark { font: 600 17px/1 var(--serif); letter-spacing: .5em; padding-left: .5em; color: var(--cream); text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
.wordmark.small { font-size: 14px; }
.sound { border: 1px solid var(--line-2); background: rgba(26, 33, 15, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; color: var(--cream); min-height: 38px; }
.sound .snd-on { display: none; } .sound[aria-pressed=true] .snd-on { display: inline; } .sound[aria-pressed=true] .snd-off { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 14px 28px; border-radius: 999px; border: 1px solid transparent; font: 500 16px/1.2 var(--thai); transition: transform .2s var(--ease), background .2s, opacity .2s, box-shadow .2s; touch-action: manipulation; }
.btn:active { transform: scale(.975); transition-duration: .08s; }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .btn { transition: transform .35s var(--lux-in, ease), background .3s, opacity .2s, box-shadow .35s, border-color .3s; }
  .btn:not([disabled]):hover { transform: translateY(-2px); }
  .btn-gold:not([disabled]):hover { box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .25) inset; }
  .btn-line:not([disabled]):hover { border-color: var(--cream); background: rgba(231, 232, 205, .06); }
}
.btn[disabled] { opacity: .5; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1A1A2A; box-shadow: 0 10px 30px -10px rgba(212, 191, 139, .55); }
.btn-line { background: transparent; border-color: var(--line-2); color: var(--cream); }
.btn-text { background: transparent; color: var(--mist); min-height: 44px; padding: 10px 14px; font-weight: 400; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line-2); }

/* scenes */
.scene { position: relative; }
.river-stage { position: absolute; inset: 0; overflow: hidden; overflow: clip; background: var(--forest); }
.river-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kicker { font: italic 500 17px/1.3 var(--serif); letter-spacing: .04em; color: var(--gold); }

/* 1 · hook */
.hook { height: 100svh; min-height: 560px; }
.hook .river-stage::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 23, 10, .55) 0%, rgba(18, 23, 10, 0) 38%, rgba(18, 23, 10, 0) 60%, rgba(26, 33, 15, .82) 90%, #1A210F 100%); pointer-events: none; }
.hook-copy { position: absolute; inset: auto 0 0 0; z-index: 2; padding: 0 var(--pad) calc(86px + env(safe-area-inset-bottom)); text-align: center; display: grid; justify-items: center; gap: 12px; }
.hook .en { font: italic 500 clamp(19px, 5.4vw, 30px)/1.35 var(--serif); color: var(--mist); max-width: 22ch; }
.hook h1 { font: 400 clamp(27px, 7.6vw, 52px)/1.35 var(--thai); letter-spacing: -.2px; text-shadow: 0 2px 24px rgba(0, 0, 0, .5); margin: 2px 0 10px; }
.reveal { opacity: 0; transform: translateY(14px); animation: rise 1.2s var(--ease) forwards; }
.hook-copy .reveal:nth-child(1) { animation-delay: .3s; } .hook-copy .reveal:nth-child(2) { animation-delay: .9s; } .hook-copy .reveal:nth-child(3) { animation-delay: 1.7s; } .hook-copy .reveal:nth-child(4) { animation-delay: 2.5s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.scroll-cue { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 2; width: 26px; height: 40px; border: 1px solid var(--line-2); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* 2 · invite */
.invite { padding: 84px 0 72px; background: radial-gradient(120% 60% at 50% 0%, rgba(212, 191, 139, .08), transparent 60%), var(--forest); }
.invite-inner { width: calc(100% - 2 * var(--pad)); max-width: 760px; margin: auto; display: grid; justify-items: center; gap: 16px; text-align: center; }
.invite h2 { font: 400 clamp(23px, 6.2vw, 38px)/1.45 var(--thai); }
.video-card { position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: #000; margin: 10px 0 8px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.video-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(13, 17, 7, .82)); pointer-events: none; }
.video-card.playing-real::after, .video-card.playing-real .play, .video-card.playing-real .captions, .video-card.playing-real .video-tag { display: none; }
.play { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 2; width: 74px; height: 74px; border-radius: 50%; border: 1px solid rgba(231, 232, 205, .55); background: rgba(26, 33, 15, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .4s; }
.play span { position: absolute; left: 53%; top: 50%; transform: translate(-50%, -50%); border-left: 18px solid var(--cream); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.video-card.captioning .play { opacity: 0; pointer-events: none; }
.captions { position: absolute; inset: auto 18px 46px; z-index: 2; font: 400 16.5px/1.6 var(--thai); text-shadow: 0 1px 10px rgba(0, 0, 0, .8); min-height: 3.2em; }
.captions span { display: block; animation: rise .9s var(--ease) both; }
.video-tag { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; font-size: 11.5px; color: var(--mist-2); white-space: nowrap; }

/* 3–7 · experience */
.experience { height: 100svh; min-height: 600px; overflow: hidden; }
.experience .river-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #1A210F 0%, rgba(26, 33, 15, .8) 9%, rgba(18, 23, 10, 0) 32%); }
/* on the water the moon and the temple are the picture: a lighter veil, just enough for the heading */
.experience:is([data-step="release"], [data-step="floating"], [data-step="river"]) .river-stage::after { background: linear-gradient(180deg, rgba(26, 33, 15, .92) 0%, rgba(26, 33, 15, .55) 8%, rgba(18, 23, 10, 0) 20%); }
.stage-head { position: absolute; inset: 0 0 auto 0; z-index: 3; padding: calc(64px + env(safe-area-inset-top)) var(--pad) 0; text-align: center; pointer-events: none; }
.steps { list-style: none; margin: 0 auto 12px; padding: 0; display: flex; justify-content: center; gap: 6px; }
.steps li { width: 26px; height: 3px; border-radius: 3px; background: var(--line-2); font-size: 0; transition: background .4s, width .4s; }
.steps li.done { background: var(--gold-d); }
.steps li.now { background: var(--gold); width: 40px; }
h1, h2, .stage-title, .stage-en, .hook .en { text-wrap: balance; }
.stage-title { font: 400 clamp(21px, 5.8vw, 34px)/1.45 var(--thai); text-shadow: 0 2px 18px rgba(0, 0, 0, .55); transition: opacity .4s; }
.stage-en { font: italic 500 clamp(16px, 4.4vw, 22px)/1.35 var(--serif); color: var(--gold-2); margin-top: 4px; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }

.river-k { position: absolute; left: 0; top: 0; z-index: 2; will-change: transform; touch-action: none; border-radius: 40%; outline-offset: -20px; }
.can-release .river-k { cursor: grab; } .is-dragging .river-k { cursor: grabbing; }
.rk-body { position: absolute; inset: 0; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
.rk-body svg, .rk-reflection svg { width: 100%; height: 100%; display: block; overflow: visible; }
.rk-reflection { position: absolute; left: 0; width: 100%; height: 100%; opacity: .32; pointer-events: none; mask-image: linear-gradient(180deg, transparent 0 21%, #000 22%, transparent 68%); -webkit-mask-image: linear-gradient(180deg, transparent 0 21%, #000 22%, transparent 68%); }
.rk-reflection > div { width: 100%; height: 100%; transform: scaleY(-1); filter: blur(1.2px); }
.swipe-hint { position: absolute; left: 50%; bottom: 46%; z-index: 3; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; border: 1px solid var(--line-2); opacity: 0; pointer-events: none; }
.swipe-hint span { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%) rotate(45deg); width: 10px; height: 10px; border-left: 1.5px solid var(--cream); border-top: 1.5px solid var(--cream); }
.can-release .swipe-hint { animation: swipe 2s ease-in-out infinite; }
/* the lantern in the hands: arrows rising above it say "swipe up" (17 Nov client) */
.lantern-hint { position: absolute; left: 50%; top: 35%; z-index: 3; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.lantern-hint i { width: 16px; height: 16px; border-left: 2px solid var(--cream); border-top: 2px solid var(--cream); transform: rotate(45deg); opacity: 0; animation: lantern-arrow 1.6s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(255, 210, 150, .6)); }
.lantern-hint i + i { animation-delay: .25s; margin-top: -6px; }
.lantern-hint b { margin-top: 8px; font: 500 13px/1.3 var(--thai); color: var(--cream); text-shadow: 0 1px 8px rgba(0, 0, 0, .7); white-space: nowrap; }
.lantern-held .lantern-hint { opacity: 1; }
@keyframes lantern-arrow { 0% { opacity: 0; transform: translateY(10px) rotate(45deg); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { .lantern-hint i { animation: none; opacity: 1; } }
@keyframes swipe { 0% { opacity: 0; transform: translateY(20px); } 35% { opacity: .9; } 100% { opacity: 0; transform: translateY(-36px); } }

.wish-note { position: fixed; z-index: 30; left: 0; top: 0; max-width: min(320px, 80vw); padding: 14px 18px; border-radius: 6px; background: linear-gradient(180deg, #FBF4E4, #F1E3C6); color: #3A3326; font: 400 15px/1.55 var(--thai); box-shadow: 0 0 34px rgba(255, 214, 150, .55); transform-origin: center; pointer-events: none; }

/* bottom sheet: fades out of the water instead of a box */
.sheet { position: absolute; inset: auto 0 0 0; z-index: 4; max-height: 62svh; overflow-y: auto; overscroll-behavior: contain; padding: 46px var(--pad) calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(20, 26, 11, 0) 0, rgba(20, 26, 11, .86) 38px, rgba(20, 26, 11, .96) 100%); scrollbar-width: none; }
.sheet::-webkit-scrollbar { display: none; }
.panel { display: grid; gap: 14px; animation: rise .5s var(--ease) both; max-width: 520px; margin: 0 auto; }
.actions { display: grid; gap: 4px; justify-items: stretch; }
.actions.grid { grid-template-columns: 1fr 1fr; gap: 10px; }
.actions.grid .btn-gold { grid-column: 1 / -1; }
.fine { font-size: 12px; color: var(--mist-2); text-align: center; line-height: 1.6; }

/* let go: a sheet of paper that vanishes */
.paper { position: relative; padding: 18px 18px 14px; border-radius: 4px; background: linear-gradient(180deg, #FBF6EA, #F2E8D2); color: #3A3326; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8); transform: rotate(-1.2deg); }
.paper::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(180deg, transparent 0 29px, rgba(58, 51, 38, .09) 29px 30px); pointer-events: none; }
.paper textarea { position: relative; width: 100%; border: 0; background: transparent; resize: none; font: 400 17px/30px var(--thai); color: #3A3326; outline: none; min-height: 92px; }
.paper textarea::placeholder { color: rgba(58, 51, 38, .45); }
.paper.vanish { animation: vanish 2.2s var(--ease) forwards; }
@keyframes vanish { 0% { opacity: 1; filter: blur(0); transform: rotate(-1.2deg) translateY(0) scale(1); } 60% { opacity: .5; filter: blur(3px); } 100% { opacity: 0; filter: blur(14px); transform: rotate(-4deg) translateY(-60px) scale(.9); } }

/* choose */
/* ten designs (3 to make yourself + 7 specials): one row that scrolls sideways, snapping card by card */
.designs { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 20px) / 3.3); gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding-bottom: 6px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.designs::-webkit-scrollbar { display: none; }
.designs > button { scroll-snap-align: start; }
.designs-more { margin: -4px 0 0; text-align: right; font-size: 12.5px; color: var(--mist, rgba(231,232,205,.8)); transition: opacity .5s ease; }
.designs-more span { display: inline-block; animation: more-nudge 1.4s ease-in-out infinite; }
.designs-more.seen { opacity: 0; }
@keyframes more-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@media (min-width: 960px) { .designs-more { display: none; } }
@media (min-width: 960px) { .designs { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; } }
.designs button { border: 1px solid var(--line); background: rgba(231, 232, 205, .04); border-radius: 16px; padding: 6px 4px 10px; display: grid; justify-items: center; gap: 2px; font-size: 13px; color: var(--mist); transition: border-color .2s, background .2s; }
.designs button .thumb { width: 100%; height: 58px; display: block; overflow: hidden; }
.designs button .thumb svg { transform: scale(1.5) translateY(6%); }
.designs button .thumb svg { width: 100%; height: 100%; }
.designs button b { font-weight: 500; color: var(--cream); font-size: 13.5px; }
.designs button small { font: italic 500 12.5px var(--serif); color: var(--gold-2); line-height: 1.1; }
.designs button[aria-pressed=true] { border-color: var(--gold); background: rgba(212, 191, 139, .12); }
.opt-row { display: flex; align-items: center; gap: 12px; }
.opt-label { flex: 0 0 52px; font-size: 13px; color: var(--mist-2); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { border: 1px solid var(--line-2); background: transparent; color: var(--cream); border-radius: 999px; min-height: 42px; padding: 8px 15px; font-size: 14px; transition: border-color .2s, background .2s; }
.choices button[aria-pressed=true] { border-color: var(--gold); background: rgba(212, 191, 139, .16); color: var(--gold-2); }
.choices.swatches button { width: 40px; height: 40px; min-height: 40px; padding: 0; border-width: 2px; border-color: rgba(231, 232, 205, .2); }
.choices.swatches button[aria-pressed=true] { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 191, 139, .25); }
.choices.chips { justify-content: center; }

/* wish */
.field { width: 100%; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(231, 232, 205, .06); color: var(--cream); font-size: 16px; font-weight: 400; }
textarea.field { resize: none; line-height: 1.7; }
/* the wish starts with a fixed "ขอให้" (2026-11-16): set on the first line, the visitor writes the rest */
.wish-field { position: relative; width: 100%; }
/* the opt-in to the shared river: a quiet row, the box unticked until the visitor chooses */
.share-wish { width: 100%; display: grid; gap: 2px; text-align: left; }
.share-wish label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--cream); cursor: pointer; }
.share-wish input { width: 20px; height: 20px; flex: none; accent-color: #B8B887; }
.share-wish .fine { text-align: left; margin: 0 0 0 30px; font-size: 11.5px; line-height: 1.5; }
.wish-field textarea.field { text-indent: 3.1em; }
.wish-prefix { position: absolute; left: 17px; top: 14px; font-size: 16px; line-height: 1.7; font-weight: 500; color: var(--gold-2, #D4BF8B); pointer-events: none; }
.field::placeholder { color: rgba(231, 232, 205, .42); }
.field:focus { outline: none; border-color: var(--gold); background: rgba(231, 232, 205, .09); }
.hintrow { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--mist-2); margin-top: -6px; }
.hintrow #charCount { font-family: var(--latin); }
.error { color: #F3B9A8; font-size: 14px; text-align: center; }
.error:empty { display: none; }

/* release / confirm / river */
.lead-hint { text-align: center; color: var(--mist); font-size: 14.5px; }
.confirm { text-align: center; font: 400 18px/1.7 var(--thai); padding: 6px 0 10px; }
.confirm em { display: block; font: italic 500 19px/1.4 var(--serif); color: var(--gold-2); margin-top: 6px; }
.card-wrap { display: grid; gap: 12px; animation: rise .6s var(--ease) both; }
.card-canvas { width: 100%; max-width: 360px; margin: 0 auto; height: auto; aspect-ratio: 4 / 5; display: block; border-radius: 14px; background: #F5F2EB; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .9); }
.check { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: var(--mist); min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.signoff { text-align: center; font: italic 500 18px/1.45 var(--serif); color: var(--gold-2); }
.signoff span { font: 400 15px/1.7 var(--thai); font-style: normal; color: var(--cream); }

.footer { padding: 34px var(--pad) calc(34px + env(safe-area-inset-bottom)); text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--mist-2); font-size: 12.5px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; top: calc(66px + env(safe-area-inset-top)); transform: translate(-50%, -12px); z-index: 60; width: max-content; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 14px; background: var(--cream); color: var(--forest); font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: auto 16px 16px; padding: 14px; border-radius: 14px; background: var(--cream); color: var(--forest); text-align: center; z-index: 90; }

/* krathong SVG animation hooks */
.krathong.is-animated .k-flame { transform-box: fill-box; transform-origin: 50% 90%; animation: k-flicker 2.2s ease-in-out infinite; }
.krathong.is-animated .k-flame.k-ignite { animation: k-ignite .9s var(--ease) both, k-flicker 2.2s ease-in-out .9s infinite; }
.krathong.is-animated .k-glow, .krathong.is-animated .k-halo { animation: k-glow 3.2s ease-in-out infinite; }
.krathong.is-animated .k-sparkle { transform-box: fill-box; transform-origin: center; animation: k-twinkle 3s ease-in-out infinite; }
.krathong.is-animated .k-firefly { animation: k-fly 7s ease-in-out infinite; }
.krathong.is-animated .k-smoke { stroke-dasharray: 6 5; animation: k-smoke 4.8s linear infinite; }
@keyframes k-flicker { 0%, 100% { transform: scale(1, 1) rotate(0); } 20% { transform: scale(.95, 1.07) rotate(-2.5deg); } 45% { transform: scale(1.04, .94) rotate(1.8deg); } 70% { transform: scale(.98, 1.05) rotate(-1deg); } }
@keyframes k-ignite { 0% { transform: scale(0, 0); opacity: 0; } 60% { transform: scale(1.25, 1.35); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes k-glow { 0%, 100% { opacity: .8; } 50% { opacity: 1; } }
@keyframes k-twinkle { 0%, 100% { opacity: .25; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes k-fly { 0%, 100% { transform: translate(0, 0); opacity: .9; } 50% { transform: translate(-4px, -14px); opacity: 1; } }
@keyframes k-smoke { from { stroke-dashoffset: 0; opacity: .9; } to { stroke-dashoffset: -44; opacity: .6; } }

/* desktop: panel becomes a right-hand column over the river */
@media (min-width: 960px) {
  :root { --pad: 40px; }
  .wordmark { font-size: 19px; }
  .hook-copy { inset: 0; align-content: center; padding: 0 var(--pad); }
  .hook .river-stage::after { background: radial-gradient(60% 50% at 50% 48%, rgba(18, 23, 10, .55), rgba(18, 23, 10, 0) 75%), linear-gradient(180deg, rgba(18, 23, 10, .5), rgba(18, 23, 10, 0) 30%); }
  .invite { padding: 120px 0 110px; }
  .video-card { aspect-ratio: 16 / 10; }
  .stage-head { left: 440px; padding-top: 88px; }
  /* on the water the moon and the temple fill the right side: the heading moves into the left column */
  .experience:is([data-step="release"], [data-step="floating"], [data-step="river"]) .stage-head { left: 0; right: auto; width: 440px; padding: 120px 36px 0; z-index: 5; }
  .sheet { inset: 0 auto 0 0; width: 440px; max-height: none; display: grid; align-content: center; padding: 96px 36px 36px; background: linear-gradient(270deg, rgba(20, 26, 11, 0), rgba(20, 26, 11, .9) 60px, rgba(20, 26, 11, .96)); }
  .swipe-hint { left: calc(440px + (100% - 440px) / 2); }
  .card-canvas { max-width: 330px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .krathong * { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- v3.1 · smooth storytelling ---------- */
html { scroll-padding-top: 0; }
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 45; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--gold-d), var(--gold-2)); }
/* scroll reveal: lift + unblur, staggered by --d */
.sr { opacity: 0; transform: translateY(26px); filter: blur(6px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 140ms); }
.sr.in { opacity: 1; transform: none; filter: none; }
.hook-copy { will-change: transform, opacity; }

/* why we float */
.why { padding: 96px 0 104px; background: radial-gradient(90% 50% at 50% 0%, rgba(212, 191, 139, .07), transparent 70%), var(--forest); }
.why::before { content: ''; position: absolute; inset: -120px 0 auto 0; height: 120px; background: linear-gradient(180deg, rgba(26, 33, 15, 0), var(--forest)); pointer-events: none; }
.why-inner { width: calc(100% - 2 * var(--pad)); max-width: 980px; margin: auto; text-align: center; display: grid; gap: 18px; justify-items: center; }
.why h2 { font: 400 clamp(25px, 6.6vw, 42px)/1.45 var(--thai); }
.why-beats { list-style: none; margin: 18px 0 6px; padding: 0; display: grid; gap: 30px; width: 100%; }
.why-beats li { display: grid; justify-items: center; gap: 6px; }
.beat-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(212, 191, 139, .35); margin-bottom: 6px; }
.beat-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.why-beats b { font: 500 19px/1.4 var(--thai); }
.why-beats span:not(.beat-icon) { color: var(--mist); max-width: 30ch; }
.bridge { margin-top: 18px; font: 400 17px/1.8 var(--thai); color: var(--mist); max-width: 44ch; }
.bridge em { font-style: normal; color: var(--gold-2); }

/* the morning after: sticky river + scrolling beats */
.after { position: relative; }
.after-sticky { position: sticky; top: 0; height: 100svh; margin-bottom: -100svh; overflow: hidden; }
.after-sticky .river-stage { mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%); }
.after-shade { position: absolute; inset: 0; background: rgba(15, 19, 8, .15); transition: background 1.4s var(--ease); pointer-events: none; }
.after[data-beat="2"] .after-shade { background: rgba(22, 28, 12, .38); }
.after[data-beat="3"] .after-shade { background: rgba(28, 34, 18, .55); }
.after[data-beat="4"] .after-shade { background: rgba(15, 19, 8, .2); }
.beats { position: relative; z-index: 2; }
.beat { min-height: 100svh; display: grid; place-items: center; padding: 80px var(--pad); }
.beat-card { max-width: 560px; text-align: center; display: grid; gap: 12px; justify-items: center; padding: 26px 22px; border-radius: 22px; background: rgba(18, 23, 10, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.beat-card h2 { font: 400 clamp(22px, 6vw, 36px)/1.5 var(--thai); text-shadow: 0 2px 20px rgba(0, 0, 0, .5); }
.beat-card p:not(.kicker) { color: var(--mist); }
.facts { list-style: none; margin: 6px 0 0; padding: 0; width: 100%; text-align: left; display: grid; }
.facts li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts b { font-weight: 500; color: var(--gold-2); }
.facts span { font-size: 14.5px; color: var(--mist); }

/* invite blends in from the river */
.invite::before { content: ''; position: absolute; inset: -1px 0 auto 0; height: 100px; background: linear-gradient(180deg, var(--forest), rgba(26, 33, 15, 0)); pointer-events: none; }

/* experience: smooth panel + heading cross-fades */
.head-text { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.head-text.swap { opacity: 0; transform: translateY(-6px); }
.panel.leaving { animation: fall .22s var(--ease) both; }
@keyframes fall { to { opacity: 0; transform: translateY(10px); } }
.sub { display: grid; gap: 14px; animation: rise .45s var(--ease) both; }
.lead-hint small { color: var(--mist-2); }
#petalCount { color: var(--gold-2); font-family: var(--latin); font-size: 13px; }
.river-k.pop .rk-body { animation: kpop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes kpop { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
.experience[data-step="make"] .river-k { cursor: pointer; }
.distance { text-align: center; font: 500 46px/1 var(--serif); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.distance small { display: block; font: 400 13px/1.6 var(--thai); color: var(--mist-2); margin-top: 6px; }
.actions.inline { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.takehome { display: grid; gap: 10px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.takehome h3 { margin: 0; font: italic 500 21px/1.3 var(--serif); color: var(--gold-2); text-align: center; }
.takehome ul { list-style: none; margin: 0; padding: 0; display: grid; }
.takehome li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.takehome li b { font-weight: 500; color: var(--gold); }
.takehome li span { color: var(--mist); }
.pledge-q { text-align: center; color: var(--cream); font-size: 15px; margin-top: 6px; }
.pledges button { font-size: 13.5px; }
@media (min-width: 960px) {
  .why-beats { grid-template-columns: repeat(3, 1fr); gap: 36px; }
  .beat { justify-items: start; padding-left: 8vw; }
  .beat-card { text-align: left; justify-items: start; }
}
@media (prefers-reduced-motion: reduce) { .sr { opacity: 1; transform: none; filter: none; } .after-shade { transition: none; } }
/* mobile: keep the water (and what floats on it) visible under the story cards */
@media (max-width: 959px) {
  .beat { place-items: start center; padding-top: calc(78px + env(safe-area-inset-top)); }
  .beat-card { padding: 20px 18px; gap: 8px; }
  .beat-card h2 { font-size: clamp(20px, 5.6vw, 30px); }
  .facts li { padding: 7px 0; }
  .facts span { font-size: 13.5px; }
}
.sheet { mask-image: linear-gradient(180deg, transparent 0, #000 34px); -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 34px); }


/* ---------- v3.2 · HYLME CI layer ---------- */
body { font-weight: 400; }
.wordmark { display: inline-block; padding: 0; text-shadow: none; }
.wordmark img { display: block; height: 30px; width: auto; filter: drop-shadow(0 1px 8px rgba(0, 0, 0, .35)); }
img.wordmark.small { height: 26px; width: auto; }
/* CI type system: The Seasons uppercase with an italic accent · Poppins taglines with a bold word · Aktiv Grotesk Thai */
.display { font: 400 clamp(22px, 6.2vw, 36px)/1.15 var(--serif); text-transform: uppercase; letter-spacing: .06em; color: var(--cream); }
.display em { font-style: italic; text-transform: none; letter-spacing: 0; color: var(--olive-l); font-size: 1.12em; }
.kicker { font: 500 13px/1.5 var(--thai); font-style: normal; letter-spacing: .04em; color: var(--olive-l); }
.hook .en, .stage-en { font-family: var(--latin); font-style: normal; font-weight: 300; letter-spacing: .01em; color: var(--mist); }
.hook .en { font-size: clamp(15px, 4.2vw, 21px); line-height: 1.55; max-width: 28ch; }
.stage-en { font-size: clamp(13px, 3.6vw, 16px); color: var(--olive-l); }
.hook .en b, .stage-en b, .signoff b { font-weight: 700; color: var(--cream); }
.hook h1, .stage-title, .why h2, .beat-card h2, .invite h2 { font-family: var(--thai); font-weight: 500; letter-spacing: 0; }
.signoff { font: 300 16px/1.6 var(--latin); color: var(--mist); }
.takehome h3 { font: italic 400 22px/1.3 var(--serif); color: var(--olive-l); }
.distance { font-family: var(--serif); color: var(--cream); }
.confirm em { font: 300 16px/1.5 var(--latin); color: var(--olive-l); }
/* CI buttons: cream pill (primary) · thin outline pill (secondary) */
.btn { font-family: var(--thai); font-weight: 500; letter-spacing: .01em; }
.btn-gold { background: var(--cream); color: var(--forest-3); box-shadow: 0 10px 28px -12px rgba(0, 0, 0, .6); }
.btn-gold:active { background: #F1F2E1; }
.btn-line { border-color: rgba(231, 232, 205, .55); }
.steps li.now { background: var(--cream); }
.steps li.done { background: var(--olive); }
.choices button[aria-pressed=true], .designs button[aria-pressed=true] { border-color: var(--olive-l); background: rgba(169, 174, 126, .16); color: var(--cream); }
.beat-icon { border-color: rgba(169, 174, 126, .5); }
.beat-icon svg { stroke: var(--olive-l); }
.facts b, .takehome li b { color: var(--olive-l); }
.bridge em { color: var(--olive-l); }
/* nature textures from the CI photography */
.why { background: linear-gradient(180deg, var(--forest) 0%, rgba(26, 33, 15, .82) 30%, rgba(26, 33, 15, .9) 100%), url('../assets/ci-leaves-dark.webp?v=2026111805') center / cover no-repeat, var(--forest); }
.invite { background: linear-gradient(180deg, var(--forest) 0%, rgba(26, 33, 15, .78) 40%, var(--forest) 100%), url('../assets/ci-leaf-macro.webp?v=2026111805') center / cover no-repeat, var(--forest); }
/* CI thin hairline frames */
.video-card { outline: 1px solid rgba(231, 232, 205, .3); outline-offset: 6px; }
.beat-card { border: 1px solid rgba(231, 232, 205, .12); background: rgba(20, 26, 11, .55); }
.paper { background: linear-gradient(180deg, #F1F2E1, #E7E8CD); color: var(--forest-3); }
.wish-note { background: linear-gradient(180deg, #F1F2E1, #DCDDBE); color: var(--forest-3); box-shadow: 0 0 34px rgba(236, 222, 170, .5); }
.toast { background: var(--cream); color: var(--forest-3); }
@media (min-width: 960px) { .wordmark img { height: 36px; } }

/* ---------- v3.3 · official Hylme brand identity (logo, colours, Tenor Sans) ---------- */
.wordmark img { height: 34px; filter: none; }
img.wordmark.small { height: 30px; }
.display { font-family: var(--head); font-weight: 400; letter-spacing: .1em; }
.display em { font-family: var(--serif); }
.distance { font-family: var(--head); letter-spacing: .04em; }
.steps li.now { background: var(--cream); }
.btn-gold { background: var(--cream); color: var(--forest-3); }
.why { background: linear-gradient(180deg, var(--forest) 0%, rgba(58, 74, 34, .72) 34%, rgba(26, 33, 15, .92) 100%), url('../assets/ci-leaves-dark.webp?v=2026111805') center / cover no-repeat, var(--forest); }
@media (min-width: 960px) { .wordmark img { height: 40px; } }

/* krathong sits IN the water: the part below the waterline turns translucent so the water shows through */
.rk-body { mask-image: linear-gradient(180deg, #000 0, #000 calc(var(--wl, 78.6%) - .5%), rgba(0, 0, 0, .5) calc(var(--wl, 78.6%) + 1.5%), rgba(0, 0, 0, .28) 100%); -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(var(--wl, 78.6%) - .5%), rgba(0, 0, 0, .5) calc(var(--wl, 78.6%) + 1.5%), rgba(0, 0, 0, .28) 100%); }

/* ---------- v3.4 photographic krathong ---------- */
.kphoto { position: relative; width: 100%; height: 100%; aspect-ratio: 1; }
.kphoto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none;
  /* built from the base up: a soft, feathered top edge (not a hard cut) so it never looks sliced or sunk into the table */
  -webkit-mask-image: linear-gradient(180deg, transparent calc(var(--reveal) - 7%), #000 calc(var(--reveal) + 1%));
  mask-image: linear-gradient(180deg, transparent calc(var(--reveal) - 7%), #000 calc(var(--reveal) + 1%));
  transition: opacity 1.1s ease; }
.kphoto { transition: --reveal 1s cubic-bezier(.4,0,.2,1); } /* only the parent animates; the images inherit the live value */
@property --reveal { syntax: '<percentage>'; inherits: true; initial-value: 0%; }
.kphoto .kp-lit { opacity: 0; }
.kphoto.lit .kp-lit { opacity: 1; }
.kphoto .kp-glow { position: absolute; left: 50%; top: 28%; width: 46%; height: 40%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,196,110,.42), rgba(255,170,80,.12) 60%, transparent); mix-blend-mode: screen; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.kphoto.lit .kp-glow { opacity: 1; animation: kpFlicker 2.8s ease-in-out infinite; }
.kphoto.ignite .kp-glow { animation: kpIgnite 1.2s ease-out, kpFlicker 2.8s 1.2s ease-in-out infinite; }
@keyframes kpFlicker { 0%,100% { opacity: .85; } 45% { opacity: 1; } 70% { opacity: .78; } }
@keyframes kpIgnite { from { opacity: 0; transform: translate(-50%, -50%) scale(.4); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.kphoto .kp-coins { position: absolute; left: 37%; bottom: 41%; width: 13%; height: auto; transform: translateX(-50%) rotate(-8deg); filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.kphoto .kp-tag, .is-3d .kp-tag, .is-layers .kp-tag { position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); padding: 2px 10px; border-radius: 99px; font: 500 11px/1.5 var(--thai);
  color: var(--forest); background: rgba(231,232,205,.88); white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.designs .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (prefers-reduced-motion: reduce) { .kphoto img, .kphoto .kp-glow { transition: none; animation: none; } }

/* Warm invitation at the wick before the visitor lights it. */
.awaiting-light::after { content: ''; position: absolute; left: var(--wick-x); top: var(--wick-y); width: 36px; height: 36px; transform: translate(-50%, -50%); border: 1px solid rgba(244,222,170,.76); border-radius: 50%; box-shadow: 0 0 20px rgba(239,194,110,.4); pointer-events: none; animation: wick-breathe 2s ease-in-out infinite; }
@keyframes wick-breathe { 50% { opacity: .5; scale: 1.06; } }

/* ---------- v3.4 riverside table (making the krathong) ---------- */
.table-scene { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; opacity: 0; transform: scale(1.06); transform-origin: 50% 70%; transition: opacity .8s ease, transform 1.1s var(--ease); }
.on-table .table-scene { opacity: 1; transform: none; }
.tbl-plate { position: absolute; left: var(--px); top: var(--py); width: var(--pw); bottom: 0;
  background: url('../assets/scenes/table-interim.webp?v=2026111805') center top / 100% var(--ph) no-repeat, linear-gradient(180deg, #6b4d40, #3b2a20 70%, #241a13);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.55) calc(var(--ph) * .3), #000 calc(var(--ph) * .4));
  mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.55) calc(var(--ph) * .3), #000 calc(var(--ph) * .4)); }
.table-scene.wide .tbl-plate {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.55) calc(var(--ph) * .3), #000 calc(var(--ph) * .4)), linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 0, rgba(0,0,0,.55) calc(var(--ph) * .3), #000 calc(var(--ph) * .4)), linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
  mask-composite: intersect; }
/* complete glass votive (552×585); always fully on screen, tucked behind the krathong on narrow phones */
.tbl-candle { position: absolute; width: calc(var(--ks) * .4); height: auto; left: max(12px, calc(var(--kx) - var(--ks) * 1.02)); top: calc(var(--ky) - var(--ks) * .4 * 1.06 + var(--ks) * .045);
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.tbl-glow { position: absolute; left: calc(max(12px, calc(var(--kx) - var(--ks) * 1.02)) - var(--ks) * .28); top: calc(var(--ky) - var(--ks) * .55); width: calc(var(--ks) * .95); height: calc(var(--ks) * .8); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,186,96,.32), rgba(255,170,80,.08) 60%, transparent); mix-blend-mode: screen; animation: kpFlicker 3.4s ease-in-out infinite; }
.experience .river-stage > canvas { transition: filter 1s ease, transform 1.2s var(--ease); }
.on-table > canvas { filter: blur(3px) brightness(.78) saturate(.92); transform: scale(1.03); }
/* computers: the river photo behind the riverside table is softly out of focus too */
.on-table:not(:has(.table-scene.portrait)) > .stage-photo { filter: blur(3px) brightness(.78) saturate(.92); }
.on-table .rk-body { filter: drop-shadow(0 10px 12px rgba(0,0,0,.45)); } /* (its mask is pushed below the base: --cutx 130%) */
.rk-reflection { transition: opacity .9s ease; }
.on-table .rk-reflection { opacity: 0; }
.river-k::after { content: ''; position: absolute; left: 20%; right: 20%; top: calc(var(--wl, 79%) - 3.5%); height: 8%; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(12,8,4,.6), rgba(12,8,4,0)); opacity: 0; transition: opacity .6s ease; }
.on-table .river-k::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .table-scene, .experience .river-stage > canvas { transition: none; } .tbl-glow { animation: none; } }

/* panel height changes must never shift the page during the ceremony */
.experience, .sheet { overflow-anchor: none; }

/* ---------- v3.4 story order: float first, learn after ---------- */
.hook-actions { display: grid; justify-items: center; gap: 4px; }
.play-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); }
.pl-icon { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); position: relative; flex: none; }
.pl-icon::after { content: ''; position: absolute; left: 12px; top: 9px; border-left: 9px solid var(--cream); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.hook-note { font-size: 12.5px; color: var(--mist-2); letter-spacing: .02em; }
.hook-copy .reveal:nth-child(5) { animation-delay: 2.9s; }
.meaning-tag { font-weight: 500; color: var(--olive-l); }

/* CEO invitation modal */
.invite-modal { width: min(560px, calc(100% - 28px)); max-height: calc(100svh - 28px); padding: 0; border: 1px solid var(--line-2); border-radius: 22px; color: var(--cream);
  background: radial-gradient(120% 60% at 50% 0%, rgba(58, 74, 34, .55), transparent 60%), var(--forest); overflow: auto; overscroll-behavior: contain; }
.invite-modal::backdrop { background: rgba(8, 11, 4, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.invite-modal[open] { animation: modalIn .45s var(--ease) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.invite-modal .invite-inner { width: auto; max-width: none; padding: 26px 20px 22px; gap: 12px; position: relative; display: grid; justify-items: center; text-align: center; }
.invite-modal h2 { font: 500 clamp(19px, 5vw, 24px)/1.5 var(--thai); margin: 0; }
.invite-modal .video-card { margin: 4px 0; aspect-ratio: 4 / 5; max-height: 56svh; width: auto; max-width: 100%; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(26, 33, 15, .6); cursor: pointer; z-index: 2; }
.modal-close span, .modal-close span::after { position: absolute; left: 13px; top: 21px; width: 17px; height: 1.5px; background: var(--cream); transform: rotate(45deg); }
.modal-close span::after { content: ''; left: 0; top: 0; transform: rotate(90deg); }

/* river panel → the story continues */
.next-story { display: grid; gap: 10px; justify-items: center; text-align: center; padding-top: 16px; border-top: 1px solid var(--line); }
.next-story p { margin: 0; color: var(--mist); font-size: 14.5px; max-width: 34ch; }

/* closing: what we do */
.promise { padding: 96px 0 104px; background: radial-gradient(90% 50% at 50% 0%, rgba(58, 74, 34, .5), transparent 70%), var(--forest); }
.promise-inner { width: calc(100% - 2 * var(--pad)); max-width: 980px; margin: auto; display: grid; gap: 22px; justify-items: center; text-align: center; }
.promise h2 { font: 500 clamp(25px, 6.6vw, 42px)/1.45 var(--thai); margin: 0; }
.we-do { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 12px; width: 100%; text-align: left; }
.we-do li { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(231, 232, 205, .035); }
.we-do b { font: 500 17px/1.4 var(--thai); color: var(--cream); }
.we-do span { color: var(--mist); font-size: 14.5px; }
.meaning { width: 100%; display: grid; gap: 6px; padding-top: 22px; border-top: 1px solid var(--line); }
.meaning .why-beats { margin: 10px 0 0; gap: 22px; }
.promise .takehome { width: 100%; max-width: 560px; text-align: left; margin-top: 0; }
.promise .pledge-q small { color: var(--mist-2); font-size: 12.5px; }
.promise-actions { width: 100%; max-width: 420px; display: grid; gap: 10px; }
.promise .signoff { margin-top: 6px; }
@media (min-width: 720px) { .we-do { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .meaning .why-beats { grid-template-columns: repeat(3, 1fr); } .invite-modal { width: min(880px, calc(100% - 64px)); } .invite-modal .invite-inner { padding: 34px 36px 28px; } .invite-modal .video-card { aspect-ratio: 16 / 10; max-height: 60svh; } }
@media (prefers-reduced-motion: reduce) { .invite-modal[open] { animation: none; } }

/* ---------- v3.5 · real-3D krathong ---------- */
.rk-body canvas.k3d, .rk-reflection canvas { width: 100%; height: 100%; display: block; }
.river-k.is-3d .rk-body { filter: none; }
.on-table .river-k.is-3d::after { opacity: 0; }   /* the 3D scene draws its own contact shadow */
.designs .thumb canvas { width: 100%; height: 100%; object-fit: contain; display: block; transform: scale(1.25) translateY(4%); }
.experience[data-step="make"] .river-k.is-3d, .experience[data-step="choose"] .river-k.is-3d, .experience[data-step="wish"] .river-k.is-3d { cursor: grab; }
.turn-hint { display: block; font-size: 12px; color: var(--mist-2); margin-top: 2px; }
[data-panel="make"] .sub { display: grid; gap: 10px; }
[data-panel="make"] .opt-label { flex-basis: 64px; }
[data-panel="make"] .choices.swatches button { width: 44px; height: 44px; min-height: 44px; }
.k3d-glow { position: absolute; left: 50%; top: 30%; width: 26%; height: 34%; transform: translate(-50%, -60%); pointer-events: none; opacity: 0; mix-blend-mode: screen; transition: opacity .7s ease;
  background: radial-gradient(ellipse 50% 50% at 50% 58%, rgba(255, 226, 168, .62), rgba(255, 178, 92, .2) 42%, rgba(255, 160, 70, 0) 72%); }
.k3d-glow.on { opacity: 1; animation: k3d-flicker 2.3s ease-in-out infinite; }
.k3d-glow.ignite { animation: k3d-ignite .9s ease-out, k3d-flicker 2.3s ease-in-out .9s infinite; }
@keyframes k3d-flicker { 0%, 100% { transform: translate(-50%, -60%) scale(1); opacity: .95; } 18% { transform: translate(-50%, -61%) scale(1.06, 1.1); opacity: 1; } 37% { transform: translate(-50%, -59%) scale(.96); opacity: .82; } 61% { transform: translate(-50%, -60.5%) scale(1.03, 1.07); opacity: .98; } 80% { transform: translate(-50%, -59.5%) scale(.98); opacity: .88; } }
@keyframes k3d-ignite { from { transform: translate(-50%, -60%) scale(.2); opacity: 0; } 60% { transform: translate(-50%, -60%) scale(1.25); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .k3d-glow.on, .k3d-glow.ignite { animation: none; } }
.is-3d .kp-tag, .is-layers .kp-tag { bottom: 4%; z-index: 9; }

/* ---------- v3.6 · compact make panel (phones first): step tabs + one-line option rails ---------- */
.make-panel { gap: 10px; }
.sub-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 999px; background: rgba(231, 232, 205, .06); border: 1px solid var(--line); }
.sub-tabs button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--mist-2); font: 500 13.5px var(--thai); touch-action: manipulation; transition: background .2s, color .2s; }
.sub-tabs button.done { color: var(--cream); }
.sub-tabs button[aria-current="step"] { background: var(--cream); color: var(--forest); }
[data-panel="make"] .sub { display: grid; gap: 8px; }
.make-panel .opt-row { gap: 10px; min-width: 0; }
.make-panel .opt-row > .choices { min-width: 0; }
.make-panel .opt-label { flex: 0 0 50px; font-size: 12.5px; }
.choices.rail { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 4px 3px; margin: -4px -3px; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.choices.rail::-webkit-scrollbar { display: none; }
.choices.rail button { flex: 0 0 auto; scroll-snap-align: start; }
.make-panel .choices button { touch-action: manipulation; }
.make-actions { display: grid; grid-template-columns: 52px 1fr; gap: 10px; }
.btn-ghost { min-height: 52px; padding: 0; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--cream); font-size: 26px; line-height: 1; touch-action: manipulation; }
.make-panel .fine { margin-top: -4px; font-size: 11.5px; line-height: 1.4; }
.make-panel .turn-hint { text-align: center; margin: -4px 0 0; }
.experience[data-step="make"] .sheet { padding-top: 26px; }
@media (max-height: 760px) {
  .experience[data-step="make"] .stage-en, .experience[data-step="choose"] .stage-en { display: none; }
  .experience .stage-head { padding-top: calc(56px + env(safe-area-inset-top)); }
}
/* perf: blend modes over a canvas that repaints every frame force a backdrop re-blend each frame on phones → plain alpha glows */
.k3d-glow, .tbl-glow, .kp-glow { mix-blend-mode: normal; }
.k3d-glow { will-change: transform, opacity; }
.choices.rail { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); padding-right: 22px; }

/* ---------- v3.7 · pre-rendered layered krathong (no WebGL) ---------- */
.kstack { position: absolute; inset: 0; }
.kstack .kl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transform-origin: 50% 79%; pointer-events: none; user-select: none; -webkit-user-drag: none;
  transition: opacity .38s ease, transform .7s cubic-bezier(.2, .9, .25, 1.15); }
.kstack .kl.in { opacity: 1; transform: none; }
.kstack .kl.pop { transform: scale(.82) translateY(4%); }
.kstack .kl.bloom { transform: scale(.9) translateY(3%); transition-duration: .5s, .9s; }
.kstack .kl.swap { transform: scale(.985); }
.kstack .kl.ignite { transition-duration: 1.1s, .7s; } /* the candle's light spreading over the krathong */
.kstack .kl.out { opacity: 0; transition: opacity .35s ease; }
.river-k.is-layers .rk-body { filter: none; }
.on-table .river-k.is-layers::after { opacity: 1; left: 18%; right: 18%; top: calc(var(--wl) - 4%); height: 9%; background: radial-gradient(closest-side, rgba(10, 7, 3, .62), rgba(10, 7, 3, 0)); }
/* the candle flame: a small CSS flame that flickers on the compositor (no repaint) */
.kflame { position: absolute; width: 3.2%; height: 6.6%; transform: translate(-50%, -78%) scale(0); transform-origin: 50% 90%; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 50% 60% at 50% 70%, #FFFDF2 0 22%, #FFD98F 45%, rgba(255, 160, 60, .85) 70%, rgba(255, 140, 40, 0) 100%); filter: blur(.3px); transition: opacity .4s ease; }
.kflame.on { opacity: 1; transform: translate(-50%, -78%) scale(1); animation: kflame-flicker 1.9s ease-in-out infinite; }
.kflame.ignite { animation: kflame-ignite .8s cubic-bezier(.2, 1.4, .4, 1), kflame-flicker 1.9s ease-in-out .8s infinite; }
@keyframes kflame-flicker { 0%, 100% { transform: translate(-50%, -78%) scale(1, 1); } 22% { transform: translate(-50%, -78%) scale(.92, 1.08) rotate(-2deg); } 47% { transform: translate(-50%, -78%) scale(1.04, .95) rotate(1.5deg); } 71% { transform: translate(-50%, -78%) scale(.96, 1.06) rotate(-1deg); } }
@keyframes kflame-ignite { from { transform: translate(-50%, -78%) scale(0); } }
@media (prefers-reduced-motion: reduce) { .kflame.on, .kflame.ignite { animation: none; } .kstack .kl { transition: opacity .2s; transform: none !important; } }
/* the glass votive sits on the table: a soft contact shadow under its base + candlelight pooling on the wood (no lifting drop-shadow) */
.tbl-candle { filter: none; z-index: 1; }
.tbl-candle-base { position: absolute; left: calc(max(12px, calc(var(--kx) - var(--ks) * 1.02)) - var(--ks) * .02); top: calc(var(--ky) + var(--ks) * .012); width: calc(var(--ks) * .44); height: calc(var(--ks) * .07);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(8, 5, 2, .78), rgba(8, 5, 2, .35) 60%, rgba(8, 5, 2, 0)); }
.tbl-pool { position: absolute; left: calc(max(12px, calc(var(--kx) - var(--ks) * 1.02)) - var(--ks) * .3); top: calc(var(--ky) - var(--ks) * .02); width: calc(var(--ks) * 1); height: calc(var(--ks) * .2);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 184, 96, .3), rgba(255, 170, 80, .1) 55%, rgba(255, 160, 70, 0)); }
.rk-reflection canvas.krefl { width: 100%; height: 100%; display: block; }

/* ---------- v3.8 · phone backgrounds: a different photograph per scene ---------- */
.table-scene.portrait .tbl-plate { height: var(--ph); bottom: auto; background: url('../assets/scenes/table-portrait.webp?v=2026111805') 0 0 / 100% 100% no-repeat; -webkit-mask-image: none; mask-image: none; }
.table-scene.portrait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 18, 8, .55) 0%, rgba(14, 18, 8, 0) 26%); pointer-events: none; }
/* the photo has its own glass candle on the table, so ours steps aside */
.table-scene.portrait .tbl-candle, .table-scene.portrait .tbl-candle-base, .table-scene.portrait .tbl-pool, .table-scene.portrait .tbl-glow { display: none; }

/* ---------- v3.9 · seamless, flicker-free scene changes ---------- */
.river-stage canvas.stage-fade { pointer-events: none; opacity: 0; z-index: 0; }
/* on phones the full-screen table photo already covers the river: no live blur filter underneath (it flickers and costs GPU) */
.on-table:has(.table-scene.portrait) > canvas { filter: none; transform: none; }
/* the table photo dissolves in and out softly: leaving, it fades while drifting slightly closer, as if we lean out over the water (2026-11-16) */
.table-scene { transition: opacity 1.8s cubic-bezier(.4, 0, .2, 1), transform 2.4s cubic-bezier(.25, .1, .25, 1); }
.on-table .table-scene { transition: opacity 1.1s ease, transform 1.3s var(--ease); }
.river-stage > canvas.k-river { opacity: 0; transition: opacity .9s ease, filter 1s ease, transform 1.2s var(--ease); }
.river-stage > canvas.k-river.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .river-stage > canvas.k-river { transition: none; } }
/* a calmer candle: the glow breathes gently instead of flickering */
@keyframes k3d-flicker { 0%, 100% { transform: translate(-50%, -60%) scale(1); opacity: .96; } 30% { transform: translate(-50%, -60.4%) scale(1.025, 1.04); opacity: 1; } 65% { transform: translate(-50%, -59.7%) scale(.985); opacity: .92; } }
.k3d-glow.on { animation-duration: 3.2s; }
@keyframes kflame-flicker { 0%, 100% { transform: translate(-50%, -78%) scale(1, 1); } 35% { transform: translate(-50%, -78%) scale(.96, 1.04) rotate(-1deg); } 70% { transform: translate(-50%, -78%) scale(1.02, .98) rotate(.8deg); } }
.kflame.on { animation-duration: 2.6s; }
/* the candle's light on its own krathong: a soft warm wash over the flowers and leaves, breathing slowly with the flame */
.kwarm { position: absolute; width: 104%; height: 74%; transform: translate(-50%, -8%); pointer-events: none; opacity: 0; transition: opacity 1.4s ease;
  background: radial-gradient(ellipse 46% 40% at 50% 38%, rgba(255, 176, 92, .26), rgba(255, 160, 80, .11) 42%, rgba(255, 150, 70, 0) 68%); } /* (a plain warm wash: a blend mode on a moving layer is costly on phones) */
.kwarm.on { opacity: 1; animation: kwarm-breathe 4.2s ease-in-out infinite; }
@keyframes kwarm-breathe { 0%, 100% { opacity: .9; } 40% { opacity: 1; } 70% { opacity: .82; } }
@media (prefers-reduced-motion: reduce) { .kwarm.on { animation: none; } }
/* full-bleed scene photos (phones): composited by the GPU, a slow Ken Burns drift instead of per-frame repainting */
.river-stage > .stage-photo { position: absolute; max-width: none; display: block; pointer-events: none; user-select: none; z-index: 0; opacity: 0; transition: opacity 1.2s ease;
  transform-origin: 50% 46%; animation: stage-drift 26s ease-in-out infinite alternate; will-change: transform; }
.river-stage > .stage-photo.in { opacity: 1; }
.stage-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
/* living water (js/water.js): a WebGL layer over the photo's river only; its top edge melts into the photo */
.stage-photo > canvas.stage-water.fade { opacity: 0; transition: opacity .9s ease; } .stage-photo > canvas.stage-water.fade.in { opacity: 1; } /* (made after the page turn: the still photo is there first) */
.stage-photo > canvas.stage-water { position: absolute; left: 0; width: 100%; display: block; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 3%); mask-image: linear-gradient(180deg, transparent 0, #000 3%); }
.river-stage > canvas.k-river { z-index: 1; }
.river-stage > canvas.stage-fade { z-index: 1; }
@keyframes stage-drift { from { transform: scale(1.06) translate3d(0, 0, 0); } to { transform: scale(1.1) translate3d(-0.5%, -0.4%, 0); } } /* starts zoomed enough that the tilt parallax never shows an edge */
@media (prefers-reduced-motion: reduce) { .river-stage > .stage-photo { animation: none; transition: none; } }
.river-stage.offscreen > .stage-photo, .river-stage.offscreen .k3d-glow, .river-stage.offscreen .kflame { animation-play-state: paused; }

/* ---------- CEO film: storyboard end card (Hylme logo + greeting) and subtitles ---------- */
.film-end { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px;
  background: radial-gradient(70% 60% at 50% 45%, rgba(58, 74, 34, .92), rgba(20, 26, 11, .97)); opacity: 0; transition: opacity 1.2s ease; }
.film-end.in { opacity: 1; }
.film-end img { width: min(52%, 220px); height: auto; opacity: 0; transform: translateY(6px); transition: opacity 1.4s ease .25s, transform 1.4s var(--ease) .25s; }
.film-end.in img { opacity: 1; transform: none; }
.film-end p { margin: 0; font: 400 18px/1.5 var(--thai); color: var(--cream); }
.film-end p span { display: block; font: italic 500 15px var(--serif); color: var(--gold-2); }
.film-end .btn-text { min-height: 40px; font-size: 14px; }
.video-card video::cue { font: 400 16px/1.5 var(--thai); color: #FFFDF2; background: rgba(13, 17, 7, .55); }
@media (prefers-reduced-motion: reduce) { .film-end, .film-end img { transition: none; } }
.video-card:has(.film-end:not([hidden])) .play, .video-card:has(.film-end:not([hidden])) .video-tag { opacity: 0; pointer-events: none; }

/* =========================================================
   v4 · THE BOOK — one full-screen page at a time, turned like a book. Calm and uncluttered.
   ========================================================= */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html { scroll-behavior: auto; }
.book { position: fixed; inset: 0; background: #0F1408; overflow: hidden; }
.page { position: absolute; inset: 0; overflow: hidden; background: var(--forest); z-index: 2; }
.page.under { z-index: 1; }
/* Page changes (2026-11-14: a fade, no page turn — and it should feel expensive). Long, unhurried curves:
   the old page eases away (on computers it also softens out of focus), the new one settles in from a breath closer,
   a faint wash of light blooms over the change, and the new page's content rises in one piece after another. */
:root { --lux-out: cubic-bezier(.65, 0, .35, 1); --lux-in: cubic-bezier(.16, 1, .3, 1); }
.page.turn-out { z-index: 3; animation: page-lux-out 1.15s var(--lux-out) both; pointer-events: none; }
.page.turn-in { z-index: 3; animation: page-lux-in 1.15s var(--lux-in) both; }
.page.under { animation: page-lux-under 1.6s var(--lux-in) both; }
@keyframes page-lux-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(1.018); } }
@keyframes page-lux-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@keyframes page-lux-under { from { transform: scale(1.04); } to { transform: none; } }
@media (pointer: fine) { /* computers have the headroom for a focus pull */
  .page.turn-out { animation-name: page-lux-out-soft; }
  @keyframes page-lux-out-soft { from { opacity: 1; transform: none; filter: blur(0); } to { opacity: 0; transform: scale(1.018); filter: blur(6px); } }
}
.book-veil { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0;
  background: radial-gradient(70% 60% at 50% 50%, rgba(231, 232, 205, .09), rgba(231, 232, 205, 0) 70%); }
.book-veil.on { animation: veil-breathe 1.3s var(--lux-out) both; }
@keyframes veil-breathe { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 0; } }
/* leaving the cover: the camera flies into the candle flame and its light becomes the whole screen, pure warm white, which
   then clears onto the invitation (17 Nov client: "into the fire until it's all white", for a smooth transition) */
/* (the flame's own glow swells with the dive — .cover-candle — and this plain white fades over it; no scaled box, whose
   edges showed on the way in) */
.book[data-from="cover"] .book-veil { mix-blend-mode: normal; background: #FFFBF2; }
.book[data-from="cover"] .book-veil.on { animation: veil-candle 2.8s ease-in-out both; }
@keyframes veil-candle { 0%, 12% { opacity: 0; } 40% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }
/* the new page's content rises in, one piece after another */
.page.arriving .page-inner > *, .page.arriving .beat-card > *, .experience.arriving .stage-head, .experience.arriving .sheet { animation: lux-rise .9s var(--lux-in) both; }
.page.arriving .page-inner > :nth-child(1), .page.arriving .beat-card > :nth-child(1), .experience.arriving .stage-head { animation-delay: .32s; }
.page.arriving .page-inner > :nth-child(2), .page.arriving .beat-card > :nth-child(2) { animation-delay: .4s; }
.page.arriving .page-inner > :nth-child(3), .page.arriving .beat-card > :nth-child(3), .experience.arriving .sheet { animation-delay: .48s; }
.page.arriving .page-inner > :nth-child(4), .page.arriving .beat-card > :nth-child(4) { animation-delay: .56s; }
.page.arriving .page-inner > :nth-child(5) { animation-delay: .64s; }
.page.arriving .page-inner > :nth-child(n+6) { animation-delay: .72s; }
.book[data-from="cover"] .page.arriving .page-inner > * { animation-duration: 1.2s; }
.book[data-from="cover"] .page.arriving .page-inner > :nth-child(1) { animation-delay: 1.75s; } /* (as the white clears) */
.book[data-from="cover"] .page.arriving .page-inner > :nth-child(2) { animation-delay: 1.87s; }
.book[data-from="cover"] .page.arriving .page-inner > :nth-child(3) { animation-delay: 1.99s; }
.book[data-from="cover"] .page.arriving .page-inner > :nth-child(n+4) { animation-delay: 2.11s; }
@keyframes lux-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-inner { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: center; justify-items: center; gap: 16px; text-align: center;
  padding: calc(84px + env(safe-area-inset-top)) var(--pad) calc(34px + env(safe-area-inset-bottom)); scrollbar-width: none; }
.page-inner::-webkit-scrollbar { display: none; }
/* centred only while it fits: a page taller than the screen (the card page on phones) starts at its top instead of being
   cut off above, out of reach (2026-11-16: the card with the krathong sat half above the screen) */
.page-inner { align-content: safe center; }
@supports not (align-content: safe center) { .page-inner { align-content: start; } }
.page h2 { margin: 0; font: 500 clamp(24px, 6.6vw, 34px)/1.35 var(--thai); color: var(--cream); text-wrap: balance; }
.page .kicker { margin: 0; }

/* top bar: hidden on the cover; a quiet back arrow on later pages */
.topbar { transition: opacity 1s var(--lux-in, ease) 1.3s; } /* arrives after the cover's candlelight has bloomed */
body[data-page="cover"] .topbar { opacity: 0; pointer-events: none; transition-delay: 0s; }
.topbar .wordmark { height: 26px; width: auto; padding: 0; letter-spacing: 0; }
.page-back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(26, 33, 15, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); position: relative; }
.page-back span { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-left: 1.5px solid var(--cream); border-bottom: 1.5px solid var(--cream); transform: translate(-30%, -50%) rotate(45deg); }
.page-back[hidden] { display: block; visibility: hidden; }

/* COVER — the client's artwork (2026-11-14): full moon, sky lanterns, a lit krathong on the river, the temple beyond.
   The poster always fills the page height (phones crop its sides a little; computers show it whole over a blurred copy).
   Logo, words and divider are live and placed exactly where the artwork had them (measured in % of the poster height). */
.cover { background: #0E1308; container-type: size; }
.cover-backdrop { position: absolute; inset: -60px; background: url('../assets/scenes/cover-poster.webp?v=2026111805') center / cover no-repeat; filter: blur(30px) brightness(.72) saturate(1.05); transform: scale(1.08); }
.cover-poster { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 941 / 1672; translate: -50% 0; transform-origin: 46% 63.4%; /* (the candle flame; centred with `translate`, which applies before `scale` — inside `transform` the centring was scaled too and the dive slid off sideways) */
  animation: cover-push 18s cubic-bezier(.3, 0, .2, 1) both; }
.cover-poster > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cover-poster > canvas.stage-water { position: absolute; left: 0; width: 100%; display: block; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 4%); mask-image: linear-gradient(180deg, transparent 0, #000 4%); }
@media (min-aspect-ratio: 941/1672) { .cover-poster { -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); } }
/* the krathong's candle breathes */
.cover-candle { position: absolute; left: 46%; top: 64.2%; width: 16%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none; z-index: 2;
  background: radial-gradient(closest-side, rgba(255, 232, 170, .55), rgba(255, 196, 110, .18) 45%, rgba(255, 190, 100, 0)); mix-blend-mode: screen; animation: cover-candle 2.6s ease-in-out infinite; }
/* a few more lanterns drift up into the sky */
.cover-lanterns { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.cover-lanterns i { position: absolute; top: 66%; width: 2.6%; aspect-ratio: 3 / 4; border-radius: 30% 30% 22% 22% / 18% 18% 30% 30%; opacity: 0;
  background: linear-gradient(180deg, #F6C77A, #E59A45 70%, #FFE6A8); box-shadow: 0 0 10px 3px rgba(255, 180, 90, .45); animation: cover-lantern 22s linear infinite; }
.cover-lanterns i:nth-child(1) { left: 12%; animation-delay: 1s; } .cover-lanterns i:nth-child(2) { left: 78%; width: 2%; animation-delay: 8s; animation-duration: 26s; } .cover-lanterns i:nth-child(3) { left: 30%; width: 1.6%; animation-delay: 14s; animation-duration: 28s; }
.cover-inner { position: absolute; inset: 0; z-index: 3; text-align: center; }
.cover-lockup { position: absolute; left: 0; right: 0; top: 28.4%; display: grid; justify-items: center; padding: 0 var(--pad); }
.cover-logo { width: min(27.5cqh, 64cqw); height: auto; opacity: 0; transform: translateY(10px) scale(.98); filter: drop-shadow(0 4px 22px rgba(0, 0, 0, .45)); animation: cover-logo 1.8s cubic-bezier(.2, .8, .2, 1) .4s forwards; }
.cover-title { margin: 2.1cqh 0 0; font: 400 max(13px, min(2.05cqh, 4.6cqw))/1.3 var(--head); letter-spacing: .34em; text-transform: uppercase; color: var(--cream); white-space: nowrap; opacity: 0; animation: cover-fade 1.4s ease 1.2s forwards; }
.cover-title em { font: italic 500 1.35em var(--serif); letter-spacing: .02em; text-transform: none; color: var(--cream); }
.cover-rule { margin-top: 1.9cqh; display: flex; align-items: center; gap: 10px; color: rgba(231, 232, 205, .85); width: min(21cqh, 64cqw); }
.cover-rule i { flex: 1; height: 1px; background: currentColor; opacity: .7; transform: scaleX(0); animation: cover-rule 1.2s cubic-bezier(.3, .8, .2, 1) 1.6s forwards; }
.cover-rule i:first-child { transform-origin: 100% 50%; } .cover-rule i:last-child { transform-origin: 0 50%; }
.cover-rule svg { flex: none; width: max(16px, 1.4cqh); height: auto; opacity: 0; animation: cover-fade 1s ease 1.5s forwards; }
.cover-happy { margin: 1.7cqh 0 0; font: 400 max(10.5px, min(1.3cqh, 2.9cqw))/1.4 var(--head); letter-spacing: .34em; text-transform: uppercase; color: rgba(231, 232, 205, .82); opacity: 0; animation: cover-fade 1.4s ease 2s forwards; }
.cover-open { position: absolute; left: 50%; bottom: calc(4.5% + env(safe-area-inset-bottom)); transform: translateX(-50%); min-height: 44px; padding: 0 22px; border-radius: 999px;
  border: 1px solid rgba(231, 232, 205, .32); background: rgba(14, 19, 8, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--cream); font: 400 14px var(--thai); letter-spacing: .06em; opacity: 0; animation: cover-fade 1s ease 2.6s forwards, cover-breathe 2.6s ease-in-out 3.6s infinite; }
.cover.turn-out { animation: cover-lux-out 2.1s var(--lux-out) both; }
.cover.turn-out .cover-lockup { animation: cover-lockup-out 1s var(--lux-out) both; }
.cover.turn-out .cover-open { animation: cover-fade-out .5s ease both; }
.cover.turn-out .cover-poster { animation: cover-dive 2.1s var(--lux-out) both; }
@keyframes cover-lux-out { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cover-lockup-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-18px); } }
@keyframes cover-fade-out { from { opacity: 1; } to { opacity: 0; } }
/* leaving the cover: the camera dives into the krathong's candle flame (the poster scales about it: transform-origin) and its
   light swells to fill the screen, out of which the invitation appears (17 Nov client) */
/* (scale only: an animated filter repainted the whole photo every frame on phones; the white veil brings the light) */
@keyframes cover-dive { 0% { scale: 1.03; } 65% { scale: 3.1; } 100% { scale: 4.6; } }
.cover.turn-out .cover-candle { animation: cover-candle-swell 2.1s var(--lux-out) both; }
@keyframes cover-candle-swell { 0% { opacity: .9; scale: 1; } 40% { opacity: 1; scale: 3.2; } 100% { opacity: 1; scale: 7; } }
@keyframes cover-push { from { scale: 1; } to { scale: 1.045; } }
@keyframes cover-candle { 0%, 100% { opacity: .85; scale: 1; } 30% { opacity: 1; scale: 1.06; } 55% { opacity: .78; scale: .97; } 80% { opacity: .95; scale: 1.03; } }
@keyframes cover-lantern { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 8% { opacity: .9; } 70% { opacity: .7; } 100% { opacity: 0; transform: translate(3cqh, -58cqh) scale(.55); } }
@keyframes cover-rule { to { transform: scaleX(1); } }
@keyframes cover-logo { to { opacity: 1; transform: none; } }
@keyframes cover-fade { to { opacity: 1; } }
@keyframes cover-breathe { 50% { opacity: .55; } }

/* PAGE 1 — the CEO's invitation, the whole temple sharp in the sky above it */
.film { background: #0E1308; }
.film::before { content: ''; position: absolute; inset: 0; background: url('../assets/scenes/temple-moon.webp?v=2026111805') 80% 0% / cover no-repeat; }
.film::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 19, 8, .3) 0%, rgba(14, 19, 8, 0) 14%, rgba(14, 19, 8, 0) 37%, rgba(14, 19, 8, .72) 45%, rgba(14, 19, 8, .95) 62%); }
.film .page-inner { z-index: 2; }
.film-inner { gap: 10px; align-content: end; padding-top: 45svh; }
.film-inner .kicker, .film-inner h2 { text-shadow: 0 2px 14px rgba(0, 0, 0, .7); }
.film-inner h2 { font-size: clamp(20px, 5.4vw, 30px); }
.film .video-card { width: auto; height: min(36svh, 420px); max-width: 100%; aspect-ratio: 4 / 5; margin: 4px 0 6px; }
@media (min-aspect-ratio: 4/5) { .film::before { background-image: url('../assets/scenes/temple-moon-wide.webp?v=2026111805'); background-position: 80% 30%; } .film::after { background: linear-gradient(90deg, rgba(14, 19, 8, .9) 0%, rgba(14, 19, 8, .7) 40%, rgba(14, 19, 8, 0) 70%); }
  .film-inner { padding-top: 84px; justify-items: start; text-align: left; max-width: 560px; } .film .video-card { height: min(52svh, 480px); } }
/* the real film (23 Nov): the card takes the film's own shape and the whole frame shows (its titles sit near the edges) */
.film .video-card.real-film { width: 100%; height: auto; max-height: min(62svh, 640px); aspect-ratio: 16 / 9; }
.video-card.real-film video { object-fit: contain; }

/* PAGE 2 — the krathong (the experience fills the page) */
.experience.page { height: auto; min-height: 0; }

/* PAGE 3 — the card on its own page: nothing cut off */
.card-page { background: radial-gradient(90% 60% at 50% 0%, rgba(58, 74, 34, .55), transparent 70%), var(--forest); }
.card-page .card-wrap { width: min(100%, 420px); display: grid; gap: 10px; }
.card-page .card-canvas { width: 100%; height: auto; border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.card-page .actions.grid { grid-template-columns: 1fr 1fr; }
.card-page .actions.grid #recordVideo { grid-column: 1 / -1; }

/* PAGE 4 — where real krathongs go (one quiet scene, one card) */
.after .river-stage { position: absolute; inset: 0; }
.after-inner { align-content: end; padding-bottom: calc(110px + env(safe-area-inset-bottom)); } /* (room for the controls below) */
.after .beat-card { max-width: 440px; display: grid; gap: 12px; justify-items: center; padding: 22px 20px 24px; border-radius: 22px; background: rgba(16, 21, 9, .66); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(231, 232, 205, .14); }
.after .beat-card p:not(.kicker) { margin: 0; color: var(--mist); font-size: 15px; line-height: 1.7; }
/* "คืนนี้ กระทงของคุณจะไปไหน" (17 Nov): the visitor's krathong on the river, the collection boat, progress, sources */
/* the beat's picture and the visitor's krathong in one 9:16 box (placed by js/app.js: cover on phones, a column on computers) */
.journey-scene { position: absolute; z-index: 2; pointer-events: none; }
.journey-backdrop { position: absolute; inset: -40px; z-index: 2; background: center / cover no-repeat; filter: blur(28px) brightness(.5) saturate(.9); opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.journey-backdrop.on { opacity: 1; }
.journey-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.journey-photo img.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .journey-k canvas { animation: none; } }
.journey-k { position: absolute; width: 30%; pointer-events: none; transition: opacity 1.2s ease, filter 1.2s ease; } /* (its transform pins the waterline on the spot: js/app.js) */
.journey-k[hidden] { display: none; }
.journey-k canvas { width: 100%; height: auto; display: block; animation: jk-bob 4.6s ease-in-out infinite; transform-origin: 50% 70%; }
.journey-k.stranded canvas { animation: none; } /* (on the mud: still) */
@keyframes jk-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2%); } }
.journey-k.collect { filter: brightness(.6) saturate(.62) contrast(.94); } /* the blue small hours: dim, colour drained (no hue shift: it turned the leaves purple) */
.journey-k.stranded { width: 26%; filter: brightness(.86) contrast(.92) saturate(.85); }
.journey-k.yours { filter: brightness(1.05) sepia(.18) saturate(1.05) drop-shadow(0 0 22px rgba(255, 196, 120, .45)); } /* warm sunrise light, a soft glow: the thank-you */
.after .page-inner { z-index: 4; }
/* the beat controls: pinned low and centred (thumb reach), the same place on every beat; the card above holds the words */
.after-nav { position: absolute; z-index: 4; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 10px; pointer-events: none; }
.after-nav > * { pointer-events: auto; }
.after-nav .btn { width: min(100%, 320px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.page.arriving .after-nav { animation: lux-rise .9s var(--lux-in) .56s both; }
.after-dots { display: flex; gap: 8px; } .after-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(231, 232, 205, .28); transition: background .4s; } .after-dots i.on { background: var(--gold-2, #D4BF8B); }
.after-live { display: grid; gap: 12px; justify-items: center; }
.after-sources { font-size: 12px; color: var(--mist-2, rgba(231,232,205,.6)); text-align: left; width: 100%; } .after-sources summary { cursor: pointer; text-align: center; }
.after-sources ul { margin: 8px 0 0; padding-left: 18px; } .after-sources a { color: inherit; }
@media (prefers-reduced-motion: reduce) { .journey-photo img, .journey-k { transition: none; } }
/* the hour, unmistakable (17 Nov: every beat read as the same golden night): the photo is regraded and a light wash laid over
   it — blue small hours, a pale peach dawn, a grey morning, a soft clear morning for yours */
#afterStage .stage-photo, #afterStage > canvas { transition: filter 1.6s ease; }
.after-light { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.6s ease, background 1.6s ease; }
.after[data-beat="collect"] #afterStage .stage-photo { filter: brightness(.62) saturate(.7) contrast(1.05); }
.after[data-beat="collect"] .after-light { opacity: 1; background: linear-gradient(180deg, rgba(28, 44, 78, .55), rgba(20, 30, 52, .25) 55%, rgba(10, 14, 24, .3)); }
.after[data-beat="morning"] #afterStage .stage-photo { filter: brightness(1.08) saturate(.5) sepia(.12); }
.after[data-beat="morning"] .after-light { opacity: 1; background: linear-gradient(180deg, rgba(255, 196, 160, .55), rgba(250, 214, 182, .28) 45%, rgba(210, 196, 180, .12)); }
.after[data-beat="stranded"] #afterStage .stage-photo { filter: brightness(.9) saturate(.32) contrast(.95); }
.after[data-beat="stranded"] .after-light { opacity: 1; background: linear-gradient(180deg, rgba(170, 176, 182, .45), rgba(120, 126, 130, .2)); }
.after[data-beat="yours"] #afterStage .stage-photo { filter: brightness(1.12) saturate(.62) sepia(.08); }
.after[data-beat="yours"] .after-light { opacity: 1; background: linear-gradient(180deg, rgba(255, 224, 186, .45), rgba(240, 232, 214, .2) 50%, rgba(240, 232, 214, 0)); }
@media (prefers-reduced-motion: reduce) { #afterStage .stage-photo, .after-light { transition: none; } }
/* phones: the story card at the top, the river below it, so the krathong, the boat and the bank are seen clearly (17 Nov) */
@media (max-aspect-ratio: 5/4), (max-width: 959px) {
  .after-inner { align-content: start; padding-top: calc(78px + env(safe-area-inset-top)); }
  .after .beat-card { padding: 16px 18px 18px; gap: 10px; }
}
/* computers: the picture is a centred column; the card sits to its left, clear of the krathong */
@media (min-aspect-ratio: 5/4) and (min-width: 960px) {
  .after-inner { align-content: center; justify-items: start; padding-left: max(32px, calc(25vw - 260px)); }
  .after-nav { right: auto; left: max(32px, calc(25vw - 260px)); width: min(400px, calc(50vw - 28.15vh - 48px)); } /* (under the card's column) */
  .after .beat-card { max-width: min(400px, calc(50vw - 28.15vh - 48px)); }
}

/* PAGES 5–6 — what Hylme does, a pledge */
.promise { background: radial-gradient(90% 50% at 50% 0%, rgba(58, 74, 34, .5), transparent 70%), var(--forest); padding: 0; }
.promise .we-do { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 12px; max-width: 440px; text-align: left; }
.promise .we-do li { display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; background: rgba(231, 232, 205, .05); border: 1px solid rgba(231, 232, 205, .12); }
.promise .we-do b { font-weight: 500; color: var(--cream); }
.promise .we-do span { font-size: 14px; color: var(--mist); line-height: 1.6; }
.pledge { background: linear-gradient(180deg, rgba(20, 26, 11, .82), rgba(20, 26, 11, .94)), url('../assets/scenes/dawn-portrait.webp?v=2026111805') center / cover; }
.pledge .pledges { justify-content: center; max-width: 440px; }
.pledge .signoff { margin-top: 10px; }
.pledge .privacy { max-width: 360px; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .book-veil { display: none; } .page.arriving .page-inner > *, .page.arriving .beat-card > *, .experience.arriving .stage-head, .experience.arriving .sheet { animation: none; } .page.turn-out, .page.turn-in, .page.under, .cover-logo, .cover-title, .cover-happy, .cover-rule svg, .cover-open { animation: none; opacity: 1; transform: none; } .cover-open { transform: translateX(-50%); } .cover-rule i { animation: none; transform: none; } .cover-poster, .cover-candle { animation: none; } .cover-lanterns { display: none; } }
/* a page's river is a backdrop: its own stacking context, always under the page's text and buttons */
.page > .river-stage { z-index: 0; }
.page > .page-inner { z-index: 2; }

/* ---------- v4.1 the krathong sits IN the water (weight, waterline, scene light) ---------- */
/* the base is cut at the waterline; what's under it shows faintly through dark water */
/* the waterline wraps round the base (2026-11-16: a straight cut across it made it look pasted on, hovering): seen from above,
   it is the front half of an ellipse, lowest at the front centre (where the leaf wall meets the water) and higher at the sides */
/* the waterline mask rides on --cutx, which transitions (17 Nov: the base was cut off in one frame when the table left) */
@property --cutx { syntax: '<percentage>'; inherits: true; initial-value: 130%; }
.river-stage .rk-body { transition: --cutx 1.3s cubic-bezier(.4, 0, .2, 1), filter .6s ease; }
.river-stage.on-table .rk-body { --cutx: 130%; }
.river-stage:not(.on-table) .rk-body { --cutx: var(--cut, 76.4%); }
.river-stage:not(.on-table) .rk-body { --ry: 6.6%; /* (the mask only on the water: on the table it cost frames while the parts pop in) */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(var(--cutx) - var(--ry) - .4%), transparent calc(var(--cutx) - var(--ry) + .6%)), radial-gradient(31.5% var(--ry) at 50% calc(var(--cutx) - var(--ry)), #000 0, #000 91%, rgba(0,0,0,.16) 100%, rgba(0,0,0,0) 150%);
  mask-image: linear-gradient(180deg, #000 0, #000 calc(var(--cutx) - var(--ry) - .4%), transparent calc(var(--cutx) - var(--ry) + .6%)), radial-gradient(31.5% var(--ry) at 50% calc(var(--cutx) - var(--ry)), #000 0, #000 91%, rgba(0,0,0,.16) 100%, rgba(0,0,0,0) 150%); }
/* the reflection is painted on the water canvas (rippled slices), not as a DOM copy */
.river-k .rk-reflection { display: none; }
/* scene light: the studio-lit render is graded into the warm, low-key night of the photographs */
.river-k .kstack { transition: filter 1.2s ease; }
.river-stage:not(.on-table) .river-k .kstack { filter: brightness(.86) sepia(.34) saturate(1) contrast(.93) blur(.25px) drop-shadow(0 0 7px rgba(255, 176, 96, .2)); } /* warm night light, edges melt into the photo (2026-11-16: it looked cold and cut out) */ /* the photo's low warm light and softness (round 3: it still stood out) */
.river-stage.on-table .river-k .kstack { filter: sepia(.08) saturate(1.04); }
/* the candle warms the petals around it once lit */
.river-k .k3d-glow.on { width: 46%; height: 40%; opacity: .85; }
/* names belong on the card, not floating on the river */
.river-stage:not(.on-table) .kp-tag { display: none; }

/* ---------- v4.2 let go: a paper note given to the candle flame ---------- */
.letgo { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s; }
.experience[data-step="letgo"] .letgo, .experience[data-step="letgone"] .letgo { opacity: 1; visibility: visible; transition: opacity .6s ease; }
.lg-candle { position: absolute; left: 50%; top: calc(49% - 70px); width: 30px; height: 70px; transform: translateX(-50%); border-radius: 6px 6px 4px 4px;
  background: linear-gradient(90deg, #CFC7AE, #F4EFDF 40%, #FBF8EE 55%, #D9D1B8); box-shadow: 0 10px 18px rgba(0,0,0,.4); }
.lg-candle::before { content: ''; position: absolute; left: 50%; top: -9px; width: 2px; height: 10px; background: #2A2116; transform: translateX(-50%); border-radius: 1px; }
.lg-flame { position: absolute; left: 50%; bottom: calc(100% + 6px); width: 16px; height: 34px; transform: translateX(-50%); transform-origin: 50% 90%;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(ellipse 50% 60% at 50% 70%, #FFFBEA 0 25%, #FFD27A 45%, rgba(255,150,50,.85) 70%, rgba(255,120,40,0) 100%);
  filter: blur(.4px); animation: lg-flick 2.2s ease-in-out infinite; }
.lg-glow { position: absolute; left: 50%; bottom: 100%; width: 180px; height: 180px; transform: translate(-50%, 40%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,196,110,.42), rgba(255,170,80,.12) 55%, rgba(255,170,80,0)); animation: lg-glow 2.2s ease-in-out infinite; }
@keyframes lg-flick { 0%, 100% { transform: translateX(-50%) scale(1, 1); } 30% { transform: translateX(-50%) scale(.93, 1.07) rotate(-2deg); } 62% { transform: translateX(-50%) scale(1.04, .95) rotate(1.5deg); } }
@keyframes lg-glow { 50% { opacity: .82; } }
.lg-hold { position: absolute; left: 0; right: 0; top: 52.5%; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.lg-hold.dragging { transition: none; }
.lg-paper { position: absolute; left: 50%; top: 0; width: min(74vw, 300px); aspect-ratio: 2 / 1; transform: translateX(-50%); pointer-events: auto; touch-action: none; cursor: grab;
  border-radius: 3px; padding: 20px 20px 16px; color: #3A3222; overflow: hidden;
  background: linear-gradient(160deg, #F3EEDF, #E4DCC6); box-shadow: 0 18px 30px rgba(0,0,0,.45), inset 0 0 30px rgba(140,110,60,.18);
  font: 400 17px/1.5 var(--thai); transition: transform .5s ease, opacity .5s ease; }
.lg-paper::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background: repeating-linear-gradient(0deg, rgba(120,100,60,.05) 0 1px, transparent 1px 27px), radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.35), transparent 60%); }
/* the visitor writes straight onto the paper (round 4: typing in a box below that showed up on the paper felt odd) */
.lg-paper .lg-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 20px 20px 16px; border: 0; border-radius: inherit; background: transparent;
  color: inherit; font: inherit; resize: none; overflow: hidden; outline: none; caret-color: #8A5A2A; touch-action: manipulation; cursor: text; }
.lg-paper .lg-input::placeholder { color: rgba(58, 50, 34, .45); }
.lg-paper:focus-within { box-shadow: 0 18px 30px rgba(0,0,0,.45), inset 0 0 30px rgba(140,110,60,.18), 0 0 0 2px rgba(231, 232, 205, .5); }
.lg-text { display: none; } /* (the words as the burn draws them: kept in sync for the burner, never shown) */
.lg-hold.near .lg-paper { box-shadow: 0 18px 30px rgba(0,0,0,.45), inset 0 14px 18px -10px rgba(255,150,60,.8); }
.lg-paper.burning { background: transparent; box-shadow: none; transition: none; } .lg-paper.burning > :not(canvas), .lg-paper.burning::after { visibility: hidden; }
.lg-paper canvas.lg-burn { position: absolute; inset: 0; width: 100%; height: 100%; }
.lg-paper:not(.burning) canvas.lg-burn { visibility: hidden; } /* staged ahead of the burn (js/letgo.js), shown when it catches */
/* the GPU fire: the note and the air above it, beside the note in its holder (staged hidden, shown when it catches) */
.lg-hold > canvas.lg-fire { position: absolute; z-index: 3; pointer-events: none; visibility: hidden; }
.lg-hold > canvas.lg-fire.on { visibility: visible; }
.lg-paper.gone { opacity: 0; visibility: hidden; transition: none; }
.lg-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
/* the burning note's light on the table and the scene (js/letgo.js sets its place and opacity; compositor only) */
.lg-flash { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; opacity: 0; border-radius: 50%; will-change: opacity;
  background: radial-gradient(closest-side, rgba(255,170,80,.34), rgba(255,120,40,.12) 45%, rgba(255,110,30,0)); }
/* after the burn the candle rests, faded, and stays so while the page moves on (17 Nov: as an animation tied to "letgone",
   it snapped back the moment the step changed and flashed once during the cross-fade) */
.lg-candle { transition: opacity 1.4s ease, transform 1.4s ease; }
.experience:not([data-step="letgo"]) .lg-candle { opacity: 0; transform: translateX(-50%) translateY(-10px); }
@media (prefers-reduced-motion: reduce) { .lg-flame, .lg-glow { animation: none; } }
/* the candle stands on the table: a contact shadow and a warm pool of light on the wood */
.lg-candle::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 150px; height: 26px; transform: translateX(-50%); border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(10,6,2,.55), rgba(10,6,2,.2) 45%, rgba(255,180,90,.16) 60%, rgba(255,180,90,0)); }

/* ---------- v4.3 the candle flame and the sky lantern ---------- */
/* a bolder flame on the taller candle, like the real krathongs in the photographs */
.kstack ~ .kflame { width: 4.2%; height: 9%; }
.lantern-note { margin: 0 0 6px; text-align: center; opacity: .7; }
/* tilt parallax: the photo shifts a few px (separate from its slow Ken Burns transform) */
.river-stage > .stage-photo { translate: var(--tilt-x, 0px) var(--tilt-y, 0px); transition: opacity 1.2s ease, filter 1s ease; }
/* the krathong's stage (2026-11-14 round 2: the temple flickered and the krathong slid against the water): no CSS drift on
   the photo; the camera moves the photo (JS transform), the canvas (same maths) and the krathong as one, and a tilt shifts
   all three by the same few px */
.river-stage.k-stage > .stage-photo { animation: none; transform-origin: 50% 50%; }
.river-stage.k-stage > canvas.k-river, .river-stage.k-stage > .river-k { translate: var(--tilt-x, 0px) var(--tilt-y, 0px); }

/* ---------- v4.4 the shared river ---------- */
.river-bubble { position: absolute; z-index: 6; transform: translate(-50%, -100%); max-width: 240px; padding: 10px 14px 8px; border-radius: 14px; text-align: center;
  background: rgba(236, 231, 218, .94); color: #253326; box-shadow: 0 10px 24px rgba(0,0,0,.35); font: 400 14px/1.45 var(--thai); animation: rb-in .35s ease; }
.river-bubble::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.river-bubble b { display: block; font-weight: 600; font-size: 13px; opacity: .75; }
.rb-report { display: block; margin: 4px auto 0; padding: 4px 6px; min-height: 0; border: 0; background: none; color: #253326; opacity: .55; font: 400 11px/1.2 var(--thai); text-decoration: underline; cursor: pointer; }
@keyframes rb-in { from { opacity: 0; transform: translate(-50%, -90%); } }
.river-count { margin: 0 0 4px; text-align: center; opacity: .8; }
/* others' krathongs on the water behind the table, from the picker on (choose, make, wish), each with its wish appearing
   over it in turn (18 Nov client). They drift on CSS animations (the compositor moves them: no script per frame) in the
   water band of the table photo (--wt..--wb, set by scene.positionTable); a wish bubble is part of its krathong, so it
   rides with it. Nearer = bigger, brighter, faster. */
.rt-count { margin: 6px 0 0; font-size: 11.5px; color: var(--mist-2, rgba(231,232,205,.75)); }
@media (max-width: 959px) and (max-height: 720px) { .rt-count { display: none; } } /* (short phones: the wishes over the water need the room) */
.experience:not(:is([data-step="choose"], [data-step="make"], [data-step="wish"], [data-step="release"])) :is(.table-river, .rt-count) { display: none; }
.river-stage:not(.on-table) .table-river { display: none; } /* (once the krathong is carried to the water) */
.table-river { position: absolute; left: 0; right: 0; top: var(--wt, 30%); height: calc(var(--wb, 45%) - var(--wt, 30%)); pointer-events: none; }
.tr-k { position: absolute; left: 0; top: calc(var(--d) * 100% - var(--s) * .8); width: var(--s); z-index: var(--z); pointer-events: auto; cursor: pointer;
  animation: tr-drift var(--dur) linear var(--delay) infinite; }
.tr-bob { animation: tr-bob 3.2s ease-in-out var(--delay) infinite alternate; }
.tr-k canvas { width: var(--s); height: var(--s); display: block; opacity: var(--a); }
.table-scene:not(.portrait) .tr-k canvas { filter: blur(.8px) brightness(.85); } /* (computers: the river behind is out of focus) */
@keyframes tr-drift { from { transform: translateX(calc(-1 * var(--s) - 12px)); } to { transform: translateX(calc(100vw + 12px)); } }
@keyframes tr-bob { from { transform: translateY(0) rotate(-1.2deg); } to { transform: translateY(-2px) rotate(1.2deg); } }
.tr-bubble { position: absolute; left: 50%; bottom: calc(100% - var(--s) * .12); width: max-content; max-width: 200px; padding: 6px 10px 5px; border-radius: 13px;
  background: rgba(16, 21, 9, .8); border: 1px solid rgba(231, 232, 205, .18); color: var(--cream); text-align: center; font-size: 12.5px; line-height: 1.35;
  opacity: 0; transform: translate(-50%, 6px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.tr-k.say { z-index: 20; } .tr-k.say .tr-bubble { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tr-k.below .tr-bubble { bottom: auto; top: calc(100% + 2px); transform: translate(-50%, -6px); } .tr-k.below.say .tr-bubble { transform: translate(-50%, 0); } /* (short phones: no room above) */
/* the owner's name over every krathong (the client's reference); it gives way to the wish bubble */
.tr-tag { position: absolute; left: 50%; bottom: calc(100% - var(--s) * .14); transform: translateX(-50%); width: max-content; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; background: rgba(16, 21, 9, .66); border: 1px solid rgba(231, 232, 205, .16); color: var(--cream); font: 500 10.5px var(--thai); opacity: calc(.55 + var(--d) * .45); transition: opacity .3s; pointer-events: none; }
.tr-k.say .tr-tag { opacity: 0; }
.tr-name { display: block; font-size: 10.5px; color: var(--mist-2, rgba(231,232,205,.7)); }
.tr-text { display: block; }
.tr-report { border: 0; background: none; padding: 2px 0 0; font: 10.5px var(--thai); color: var(--mist-2, rgba(231,232,205,.6)); text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .tr-k { animation: none; transform: translateX(var(--rx)); } .tr-bob { animation: none; } }
/* phones, river step: the sign line repeats the lantern hint and the heading; without it the panel is ~100 px lower and the
   shared krathongs on the water show (18 Nov: "I can't see the others") */
@media (max-width: 959px) { .experience[data-step="river"] #riverSign { display: none; } }
.share-river { margin: 18px 0 14px; padding: 16px; border: 1px solid rgba(236, 231, 218, .18); border-radius: 18px; background: rgba(236, 231, 218, .05); }
.share-river h3 { margin: 0 0 4px; font: 600 18px/1.4 var(--thai); }
.share-river .field { margin: 10px 0; }
.share-river [data-group="blessing"] { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.share-river [data-group="blessing"] button { min-height: 40px; }
.share-river .btn { width: 100%; }
.share-msg { min-height: 1.4em; margin: 8px 0 0; text-align: center; }

/* =========================================================
   Spin to Win (2026-11-14) — a prize wheel after the blessing card. CI greens, cream and soft gold; the canvas rotates on the compositor.
   ========================================================= */
.btn-spin { letter-spacing: .06em; font-family: var(--head); }
.spin { background: radial-gradient(70% 45% at 50% 42%, rgba(212, 191, 139, .16), transparent 70%), radial-gradient(90% 60% at 50% 0%, rgba(58, 74, 34, .6), transparent 70%), var(--forest); }
.spin::before { content: ''; position: absolute; inset: 0; background: url('../assets/scenes/temple-moon.webp?v=2026111805') 80% 20% / cover no-repeat; opacity: .16; filter: blur(2px); pointer-events: none; }
.spin-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; } /* flex + auto margins = centred, but never clipped at the top when the result makes it tall */
.spin-inner > :first-child { margin-top: auto; } .spin-inner > :last-child { margin-bottom: auto; }
.spin-inner > * { flex: none; }
.spin.won .spin-sub { display: none; } .spin.won .wheel-wrap { width: min(62vw, 32svh, 280px); }
.spin-title { font: 400 clamp(30px, 9vw, 44px)/1.1 var(--head) !important; letter-spacing: .04em; }
.spin-title em { font: italic 500 1.08em var(--serif); color: var(--gold-2); }
.spin-sub { margin: 0; color: var(--mist); font-size: 15px; }
.wheel-wrap { position: relative; width: min(76vw, 40svh, 340px); aspect-ratio: 1; margin: 8px 0 4px; }
.wheel { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; will-change: transform; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .75), 0 0 0 1px rgba(212, 191, 139, .35); }
.wheel-glow { position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 214, 150, .28), rgba(255, 214, 150, 0)); opacity: .6; transition: opacity .6s ease; pointer-events: none; }
.wheel-wrap.spinning .wheel-glow, .wheel-wrap.done .wheel-glow { opacity: 1; }
.wheel-wrap.done .wheel-glow { animation: wheel-glow 2.4s ease-in-out infinite; }
@keyframes wheel-glow { 50% { opacity: .55; } }
/* the pointer: a gold drop at the top that flicks as each peg passes */
.wheel-pointer { position: absolute; left: 50%; top: -4%; z-index: 2; width: 13%; aspect-ratio: 3 / 4; transform: translateX(-50%); transform-origin: 50% 20%;
  background: linear-gradient(180deg, #FFF3D0, #D4BF8B 55%, #A88A48); clip-path: polygon(50% 100%, 0 22%, 12% 6%, 50% 0, 88% 6%, 100% 22%); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.wheel-wrap.tick .wheel-pointer { animation: wheel-flick .12s ease-out; }
@keyframes wheel-flick { 40% { transform: translateX(-50%) rotate(-14deg); } }
.wheel-hub { position: absolute; left: 50%; top: 50%; z-index: 2; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid rgba(212, 191, 139, .85);
  background: radial-gradient(circle at 35% 30%, #4E6131, #2A3618 70%); color: var(--cream); display: grid; place-content: center; justify-items: center; gap: 0; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5), inset 0 2px 6px rgba(255, 255, 255, .12); font: 500 clamp(13px, 3.6vw, 16px)/1.2 var(--thai); transition: transform .2s ease, box-shadow .2s ease; }
.wheel-hub img { width: 46%; height: auto; opacity: .95; }
.wheel-hub:not(:disabled) { animation: hub-call 2.2s ease-in-out infinite; }
.wheel-hub:not(:disabled):active { transform: translate(-50%, -50%) scale(.94); }
.wheel-hub:disabled { cursor: default; opacity: 1; }
.wheel-hub:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 4px; }
@keyframes hub-call { 50% { box-shadow: 0 8px 20px rgba(0, 0, 0, .5), 0 0 0 9px rgba(212, 191, 139, .14), inset 0 2px 6px rgba(255, 255, 255, .12); } }
.spin-result { display: grid; justify-items: center; gap: 6px; padding: 14px 18px 16px; border-radius: 18px; width: min(100%, 360px); background: rgba(231, 232, 205, .07); border: 1px solid rgba(212, 191, 139, .4); }
.spin-result.in { animation: modalIn .6s cubic-bezier(.2, .8, .2, 1) both; }
.spin-result.is-voucher { background: linear-gradient(160deg, rgba(235, 217, 166, .22), rgba(196, 163, 94, .12)); border-color: rgba(235, 217, 166, .8); }
.sr-label { margin: 0; color: var(--mist); font-size: 14px; }
.sr-prize { margin: 0; font: 500 clamp(22px, 6.4vw, 28px)/1.3 var(--thai); color: var(--cream); }
.is-voucher .sr-prize { color: #F1DFA9; }
.sr-code { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; width: 100%; text-align: left; }
.sr-code span { grid-column: 1 / -1; font-size: 12px; color: var(--mist-2); }
.sr-code b { font: 500 18px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--cream); padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px dashed rgba(212, 191, 139, .55); }
.sr-code .btn { min-height: 42px; padding: 0 14px; font-size: 14px; }
.spin-left { color: var(--gold-2) !important; min-height: 1.2em; }
.sr-line { width: 100%; margin-top: 4px; gap: 8px; }
.sr-line svg { flex: none; }
.spin-rules { max-width: 360px; opacity: .75; }
.spin-demo { color: #F0C38A !important; max-width: 340px; }
.spin-confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .wheel-hub:not(:disabled), .wheel-wrap.done .wheel-glow, .wheel-wrap.tick .wheel-pointer, .spin-result.in { animation: none; } }
@media (max-height: 700px) { .spin-sub, .spin-rules { display: none; } .wheel-wrap { width: min(70vw, 36svh, 300px); } }
/* phones, the real film (23 Nov client: "the clip sits too low"): the heading, film and button sit together at eye level,
   just under the moon; the scene darkens behind them so the film reads */
@media (max-aspect-ratio: 4/5) {
  .film-inner:has(.real-film) { align-content: center; padding-top: 16svh; padding-bottom: 4svh; }
  .film:has(.real-film)::after { background: linear-gradient(180deg, rgba(14, 19, 8, .3) 0%, rgba(14, 19, 8, 0) 12%, rgba(14, 19, 8, .1) 30%, rgba(14, 19, 8, .85) 44%, rgba(14, 19, 8, .95) 100%); }
}
/* computers (23 Nov client: "heavy, untidy"): one reading column on the left for every step: the steps bar, the heading
   and the controls stacked together under it, the scene clear on the right. Before, the heading sat over the scene while the
   controls floated mid-height in the column, so the eye jumped across the screen, and the layout changed between steps. */
@media (min-width: 960px) {
  .experience { display: grid; grid-template-columns: 440px 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .experience::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 440px; z-index: 3; pointer-events: none;
    background: linear-gradient(270deg, rgba(20, 26, 11, 0), rgba(20, 26, 11, .82) 80px, rgba(20, 26, 11, .93)); }
  .experience::after { content: ''; position: absolute; top: 96px; bottom: 96px; left: 439px; width: 1px; z-index: 3; pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(231, 232, 205, .14) 20%, rgba(231, 232, 205, .14) 80%, transparent); }
  .experience:is([data-step]) .stage-head { position: relative; inset: auto; grid-area: 1 / 1; width: auto; z-index: 5; padding: 104px 40px 0; text-align: left; }
  .experience .steps { justify-content: flex-start; margin: 0 0 18px; }
  .experience .stage-title { font-size: 30px; line-height: 1.4; }
  .experience .stage-en { font-size: 17px; }
  .experience:is([data-step]) .sheet { position: relative; inset: auto; grid-area: 2 / 1; width: auto; max-height: none; align-content: start; padding: 26px 40px 40px; background: none; }
  .experience .panel { margin: 0; max-width: none; }
}
/* computers, the wish card (23 Nov): the card and its buttons on the left, "float it on everyone's river" and Spin to Win
   on the right, so the page fits the screen instead of a full-width box running off the bottom */
@media (min-width: 960px) {
  .card-page .page-inner:has(.share-river:not([hidden])) { grid-template-columns: min(400px, calc((100svh - 300px) * .8)) 420px; column-gap: 64px; justify-content: center; align-items: center; }
  .card-page .page-inner:has(.share-river:not([hidden])) .kicker { grid-column: 1 / -1; }
  .card-page .page-inner:has(.share-river:not([hidden])) .card-wrap { grid-column: 1; grid-row: 2 / span 2; width: 100%; }
  .card-page .share-river { grid-column: 2; grid-row: 2; align-self: end; margin: 0; padding: 22px; text-align: left; }
  .card-page .share-river [data-group="blessing"] { justify-content: flex-start; }
  .card-page .share-river .fine { text-align: left; }
  .card-page .page-inner:has(.share-river:not([hidden])) .card-canvas { max-width: none; }
  .card-page .page-inner:has(.share-river:not([hidden])) #toSpin { grid-column: 2; grid-row: 3; align-self: start; justify-self: stretch; }
}
