/* Openings and living details. Loaded after kedai.css. */

/* ── the opening ── */
.welcome { display: none; }
.welcome.on { display: grid; place-items: center; position: fixed; inset: 0; z-index: 100; cursor: pointer; text-align: center; color: var(--w-ink, #fff); animation: w-gone .01s 2.75s forwards; }
.welcome i { position: absolute; display: block; }
.w-card { position: relative; z-index: 2; display: grid; justify-items: center; gap: 8px; padding: 24px; animation: w-out .45s 1.9s ease-in forwards; }
.w-card svg { width: 118px; height: 118px; fill: none; stroke: var(--w-line, #fff); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.w-card path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: w-draw 1.25s .1s cubic-bezier(.5,0,.3,1) forwards; }
.w-card small { font-size: .72rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; opacity: 0; animation: w-up .6s .35s forwards; }
.w-card b { font-family: var(--display); font-size: clamp(2.1rem, 9vw, 4.2rem); line-height: 1.05; max-width: 14ch; text-wrap: balance; opacity: 0; animation: w-up .7s .5s cubic-bezier(.2,1.4,.4,1) forwards; }
.w-card span { font-family: var(--hand); font-size: 1.8rem; color: var(--w-line, #fff); opacity: 0; animation: w-up .6s .85s forwards; }
.welcome em { position: absolute; z-index: 2; bottom: calc(26px + env(safe-area-inset-bottom)); font-style: normal; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: 0; animation: w-hint 1.4s .7s forwards; }
.welcome.skip { animation: w-fade .35s forwards; }
@keyframes w-draw { to { stroke-dashoffset: 0; } } @keyframes w-up { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes w-hint { 30%, 70% { opacity: .65; } 100% { opacity: 0; } } @keyframes w-out { to { opacity: 0; scale: .9; } } @keyframes w-gone { to { visibility: hidden; } } @keyframes w-fade { to { opacity: 0; visibility: hidden; } }
/* shutter rolls up */
.w-shutter .w-a { inset: 0; background: var(--w-bg); animation: w-roll .75s 2s cubic-bezier(.7,0,.2,1) forwards; }
.w-shutter .w-b { left: 0; right: 0; top: 100%; height: 26px; background: radial-gradient(circle at 26px 0, var(--w-edge, var(--deep)) 26px, transparent 26.5px) 0 0 / 52px 100%; animation: w-lift .75s 2s cubic-bezier(.7,0,.2,1) forwards; }
@keyframes w-roll { to { translate: 0 -101%; } } @keyframes w-lift { to { top: -30px; } }
/* curtains part */
.w-curtain .w-a, .w-curtain .w-b { top: 0; bottom: 0; width: 50.4%; background: var(--w-bg); animation: w-left .8s 1.95s cubic-bezier(.7,0,.2,1) forwards; }
.w-curtain .w-a { left: 0; } .w-curtain .w-b { right: 0; animation-name: w-right; }
@keyframes w-left { to { translate: -102% 0; } } @keyframes w-right { to { translate: 102% 0; } }
/* iris closes into the middle */
.w-iris .w-a { inset: 0; background: var(--w-bg); clip-path: circle(150% at 50% 44%); animation: w-iris .75s 2s cubic-bezier(.7,0,.3,1) forwards; }
@keyframes w-iris { to { clip-path: circle(0 at 50% 44%); } }
/* slanted wipe */
.w-wipe .w-a, .w-wipe .w-b { inset: 0; background: var(--w-bg); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); animation: w-wipe .7s 2.02s cubic-bezier(.7,0,.25,1) forwards; }
.w-wipe .w-b { background: var(--w-line, var(--accent)); z-index: -1; animation-delay: 2.1s; }
@keyframes w-wipe { to { clip-path: polygon(135% 0, 135% 0, 100% 100%, 100% 100%); translate: 12% 0; } }

.t-bakery { --w-bg: repeating-linear-gradient(90deg, #c0405a 0 46px, #b23851 46px 92px); --w-line: #ffe9c9; --w-edge: #b23851; }
.t-stall { --w-bg: repeating-linear-gradient(180deg, #17452c 0 34px, #133a25 34px 37px); --w-line: #ffd76a; --w-ink: #fff5d6; --w-edge: #133a25; }
.t-cafe { --w-bg: radial-gradient(circle at 50% 30%, #4a2f1c, #170f0b 70%); --w-line: #e8aa45; --w-ink: #f6ead6; }
.t-florist { --w-bg: linear-gradient(#5d7261, #435547); --w-line: #ffd6de; --w-ink: #fdf6f0; }
.t-frozen { --w-bg: linear-gradient(160deg, #0f5f86, #4fc0e0); --w-line: #ffffff; --w-edge: #4fc0e0; }
.t-boutique { --w-bg: repeating-linear-gradient(90deg, #46264a 0 22px, #582f5d 22px 40px, #3b1f3f 40px 52px); --w-line: #f0d9a8; --w-ink: #fbf3ea; }
.t-barber { --w-bg: #0b2123; --w-line: #e0a526; --w-ink: #f3ead7; }
.t-petcare { --w-bg: radial-gradient(circle at 18% 22%, rgba(255,255,255,.22) 0 40px, transparent 41px), radial-gradient(circle at 84% 74%, rgba(255,255,255,.18) 0 70px, transparent 71px), #1f9e89; --w-line: #fff1b8; }
.t-tuition { --w-bg: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1.4px) 0 0 / 13px 13px, #1c4235; --w-line: #ffcf4d; --w-ink: #f8f5e8; }
.t-salesagent { --w-bg: linear-gradient(135deg, #0d2340, #081528); --w-line: #ff6a4d; }
.t-katering { --w-bg: repeating-linear-gradient(45deg, rgba(255,215,120,.09) 0 2px, transparent 2px 18px), repeating-linear-gradient(-45deg, rgba(255,215,120,.09) 0 2px, transparent 2px 18px), #5a0f1f; --w-line: #ffd778; --w-ink: #fff2d0; }
.t-spa { --w-bg: linear-gradient(#a8654b, #7d4632); --w-line: #ffe6d4; }
.t-carwash { --w-bg: radial-gradient(circle at 50% 38%, #10303c, #05080c 62%); --w-line: #23d5f5; --w-ink: #eaf7fb; }
.t-homestay { --w-bg: linear-gradient(#f6b95c 0%, #7fa854 46%, #23401d 100%); --w-line: #fff6d2; }
.t-property { --w-bg: #171614; --w-line: #d9ae58; --w-ink: #f5f3ee; }
.t-restaurant { --w-bg: radial-gradient(circle at 50% 36%, #5a2410, #140d08 66%); --w-line: #ffab5e; --w-ink: #fff4e6; }
.t-repair { --w-bg: linear-gradient(165deg, #081a3a, #0d2a5c 70%, #1d4a94); --w-line: #ffc61a; }
.t-aircond { --w-bg: linear-gradient(165deg, #07314e, #0a84c6 75%, #7fd4f5); --w-line: #dff5ff; }

/* ── the page comes alive after the opening ── */
.shop .sign > * { animation: rise-in .8s cubic-bezier(.2,.9,.25,1) both; animation-delay: calc(var(--wd, 0s) + .05s); }
.shop .sign > :nth-child(2) { animation-delay: calc(var(--wd, 0s) + .16s); } .shop .sign > :nth-child(3) { animation-delay: calc(var(--wd, 0s) + .27s); }
@keyframes rise-in { from { opacity: 0; translate: 0 34px; } }
.shop .note p, .shop .note span { animation: write 1.5s cubic-bezier(.4,0,.3,1) both; animation-delay: calc(var(--wd, 0s) + .55s); }
.shop .note span { animation-duration: .6s; animation-delay: calc(var(--wd, 0s) + 1.8s); }
@keyframes write { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -5% -20% 0); } }
.shop .cover img { animation: ken 8s cubic-bezier(.15,.6,.3,1) both; animation-delay: var(--wd, 0s); }
/* the drift is for wide screens only: on a phone it opens a gap above the picture */
@media (min-width: 761px) and (hover: hover) { .shop .cover img { translate: 0 min(calc(var(--sy, 0) * .035px), 14px); } }
@keyframes ken { from { scale: 1.28; } to { scale: 1.1; } }
.l-cards .cover img { animation: none; translate: none; }
.l-cards .cover { animation: pin 1.1s cubic-bezier(.2,1.35,.35,1) both; animation-delay: var(--wd, 0s); } @keyframes pin { from { rotate: -9deg; scale: 1.15; translate: 0 -40px; opacity: 0; } }
.cats a { transition: translate .2s, background .2s; } .cats a:hover { translate: 0 -3px; }
.item::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.22), transparent 70%); opacity: 0; transition: opacity .25s; }
@media (hover: hover) { .item:not(:disabled):hover::after { opacity: 1; } }
.item .plus { transition: rotate .35s cubic-bezier(.2,1.6,.4,1), scale .35s; } .item:active .plus { rotate: 90deg; scale: 1.14; }
@media (hover: hover) { .item:not(:disabled):hover .plus { rotate: 90deg; scale: 1.14; } }
/* a finger leaves hover stuck on, so cards only lift for a mouse */
@media (hover: none) { .shop .item:not(:disabled):hover { translate: none; rotate: none; } .shop .item:hover .pic img { scale: 1; } }
.bag-n { animation: pop .5s cubic-bezier(.2,1.8,.4,1); } @keyframes pop { from { scale: .3; } }
.shop .btn { position: relative; overflow: hidden; } .shop .btn::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40px; left: -60px; rotate: 18deg; background: rgba(255,255,255,.32); transition: left .6s; } .shop .btn:hover::after { left: calc(100% + 30px); }
.kot { transform-origin: 50% 0; } .owner .board { animation: rise-in .7s both; }

/* ── ambient: each shop has its own weather ── */
.fx { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.fx i { position: absolute; display: none; left: calc(var(--x) * 1%); animation-delay: calc(var(--i) * -1.37s); will-change: transform, opacity; }
@keyframes fall { from { transform: translate3d(0, -40px, 0) rotate(0); opacity: 0; } 10% { opacity: var(--o, .9); } 85% { opacity: var(--o, .9); } to { transform: translate3d(calc((var(--z) - 11) * 8px), 620px, 0) rotate(calc(var(--z) * 40deg)); opacity: 0; } }
@keyframes float-up { from { transform: translate3d(0, 40px, 0) scale(.6); opacity: 0; } 15% { opacity: var(--o, .8); } to { transform: translate3d(calc((var(--z) - 11) * 6px), -480px, 0) scale(1.15); opacity: 0; } }
@keyframes steam { from { transform: translate3d(0, 0, 0) scale(.5); opacity: 0; } 30% { opacity: .55; } to { transform: translate3d(calc((var(--z) - 11) * 7px), -220px, 0) scale(2.1); opacity: 0; } }
@keyframes firefly { 0%, 100% { transform: translate3d(0, 0, 0); opacity: .1; } 25% { transform: translate3d(26px, -34px, 0); opacity: 1; } 50% { transform: translate3d(-18px, -58px, 0); opacity: .3; } 75% { transform: translate3d(-34px, -18px, 0); opacity: .95; } }
@keyframes twinkle { 0%, 100% { transform: scale(.2) rotate(0); opacity: 0; } 50% { transform: scale(1) rotate(80deg); opacity: .95; } }
@keyframes ripple { from { transform: scale(.1); opacity: .8; } to { transform: scale(1); opacity: 0; } }
@keyframes slide-drop { 0% { transform: translate3d(0, -20px, 0) scaleY(1); opacity: 0; } 12% { opacity: .85; } 55% { transform: translate3d(0, 150px, 0) scaleY(1.5); } 100% { transform: translate3d(0, 520px, 0) scaleY(1); opacity: 0; } }
@keyframes sweep { 0% { translate: -140% 0; } 38%, 100% { translate: 240% 0; } }

/* sprinkles over the bakery */
.t-bakery .fx i { display: block; top: 0; width: 5px; height: calc(var(--z) * 1px + 4px); border-radius: 9px; background: #e0728a; animation: fall calc(var(--d) * 1.3s) linear infinite; animation-delay: calc(var(--i) * -1.37s); --o: .75; }
.t-bakery .fx i:nth-child(3n) { background: #f2b84b; } .t-bakery .fx i:nth-child(4n) { background: #7fc4a8; } .t-bakery .fx i:nth-child(n+13) { display: none; }
/* steam from the pots and cups */
.t-stall .fx i, .t-cafe .fx i { display: block; top: 300px; left: calc(30% + var(--x) * .45%); width: calc(var(--z) * 4px); height: calc(var(--z) * 5px); border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.8), transparent); filter: blur(6px); animation: steam calc(var(--d) * .6s) ease-out infinite; animation-delay: calc(var(--i) * -.53s); }
.t-cafe .fx::before { content: ''; position: absolute; left: 50%; top: -60px; width: 520px; height: 420px; translate: -50% 0; background: radial-gradient(closest-side, rgba(255,184,77,.34), transparent); animation: lamp 4.5s ease-in-out infinite; } @keyframes lamp { 0%, 100% { opacity: .55; } 45% { opacity: 1; } 52% { opacity: .75; } 58% { opacity: 1; } }
/* petals */
.t-florist .fx i { display: block; top: 0; width: calc(var(--z) * 1px + 5px); height: calc(var(--z) * 1px + 9px); border-radius: 80% 10% 80% 40%; background: linear-gradient(135deg, #ffc9d4, #e58a9d); animation: fall calc(var(--d) * 1.5s) linear infinite; animation-delay: calc(var(--i) * -1.37s); }
.t-florist .fx i:nth-child(3n) { background: linear-gradient(135deg, #fff1f3, #f4b8c3); } .t-florist .fx i:nth-child(n+14) { display: none; }
/* snow */
.t-frozen .fx i { display: block; top: 0; width: calc(var(--z) * .65px); height: calc(var(--z) * .65px); border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.9); animation: fall calc(var(--d) * 1s) linear infinite; animation-delay: calc(var(--i) * -.9s); }
/* gold flecks at the feast */
.t-katering .fx i { display: block; top: 0; width: calc(var(--z) * .45px + 2px); height: calc(var(--z) * .45px + 2px); rotate: 45deg; background: #ffd778; box-shadow: 0 0 8px #ffcf5c; animation: fall calc(var(--d) * 1.6s) linear infinite; animation-delay: calc(var(--i) * -1.1s); }
/* bubbles */
.t-petcare .fx i, .t-carwash .fx i:nth-child(2n) { display: block; bottom: 0; width: calc(var(--z) * 2.2px); height: calc(var(--z) * 2.2px); border-radius: 50%; border: 1.5px solid rgba(255,255,255,.95); background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.95) 0 14%, rgba(255,255,255,.12) 16% 60%, rgba(160,225,255,.4)); box-shadow: 0 0 0 1px rgba(40,150,160,.18); animation: float-up calc(var(--d) * 1.1s) ease-in infinite; animation-delay: calc(var(--i) * -.8s); }
/* water running down, and a squeegee pass */
.t-carwash .fx i:nth-child(2n+1) { display: block; top: 0; width: 5px; height: 12px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: linear-gradient(rgba(255,255,255,.1), #8beaff); animation: slide-drop calc(var(--d) * .55s) cubic-bezier(.5,.1,.7,.6) infinite; animation-delay: calc(var(--i) * -.9s); }
.t-carwash .fx i:nth-child(2n) { --o: .55; }
/* fireflies over the paddy */
.t-homestay .fx i { display: block; top: calc(var(--y) * 1%); width: 6px; height: 6px; border-radius: 50%; background: #fff3a8; box-shadow: 0 0 10px 4px rgba(255,226,92,.75); animation: firefly calc(var(--d) * .75s) ease-in-out infinite; animation-delay: calc(var(--i) * -.77s); }
/* twinkles: chalk stars, sequins, showroom glints */
.t-tuition .fx i, .t-boutique .fx i, .t-salesagent .fx i, .t-property .fx i, .t-barber .fx i { display: block; top: calc(var(--y) * 1%); width: calc(var(--z) * 1.5px); height: calc(var(--z) * 1.5px); background: var(--star, #fff); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: twinkle calc(var(--d) * .45s) ease-in-out infinite; animation-delay: calc(var(--i) * -.71s); }
.t-tuition { --star: #ffd85e; } .t-barber { --star: #ffcf6a; } .t-property { --star: #ffe3a8; }
.t-boutique .fx i:nth-child(n+11), .t-salesagent .fx i:nth-child(n+9), .t-property .fx i:nth-child(n+9), .t-barber .fx i:nth-child(n+8) { display: none; }
/* embers rising from the wok */
.t-restaurant .fx i { display: block; bottom: 0; width: calc(var(--z) * .35px + 2px); height: calc(var(--z) * .35px + 2px); border-radius: 50%; background: #ffb057; box-shadow: 0 0 9px 2px rgba(255,120,30,.75); animation: float-up calc(var(--d) * .8s) ease-out infinite; animation-delay: calc(var(--i) * -.67s); }
/* sparks off the soldering bench */
.t-repair .fx i { display: block; top: calc(var(--y) * 1%); width: calc(var(--z) * .3px + 2px); height: calc(var(--z) * .3px + 2px); background: #ffd84d; box-shadow: 0 0 8px 2px rgba(255,198,26,.85); rotate: 45deg; opacity: 0; animation: spark calc(var(--d) * .3s) ease-out infinite; animation-delay: calc(var(--i) * -.43s); }
.t-repair .fx i:nth-child(n+13) { display: none; }
@keyframes spark { 0%, 55% { opacity: 0; transform: translate3d(0, 0, 0) scale(.4); } 62% { opacity: 1; transform: translate3d(0, 0, 0) scale(1.4); } 100% { opacity: 0; transform: translate3d(calc((var(--z) - 11) * 5px), 40px, 0) scale(.2); } }
/* cool air blowing */
.t-aircond .fx i { display: block; top: calc(var(--y) * 1%); left: 0; width: calc(var(--z) * 7px); height: 3px; border-radius: 99px; background: linear-gradient(90deg, transparent, #fff, transparent); animation: breeze calc(var(--d) * .42s) ease-in-out infinite; animation-delay: calc(var(--i) * -.61s); }
@keyframes breeze { from { transform: translate3d(-30vw, 0, 0); opacity: 0; } 25% { opacity: .95; } 75% { opacity: .7; } to { transform: translate3d(110vw, calc((var(--z) - 11) * 3px), 0); opacity: 0; } }
/* a ribbon of light across the picture */
.t-boutique .fx::after, .t-salesagent .fx::after, .t-property .fx::after, .t-barber .fx::after, .t-carwash .fx::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent); animation: sweep 6.5s cubic-bezier(.5,0,.3,1) infinite; animation-delay: calc(var(--wd, 0s) + .3s); }
/* still water */
.t-spa .fx i { display: block; top: calc(var(--y) * 1% - 60px); width: 140px; height: 140px; margin-left: -70px; border-radius: 50%; border: 1.5px solid rgba(180,102,74,.55); box-shadow: inset 0 0 24px rgba(255,255,255,.5); animation: ripple calc(var(--d) * .6s) ease-out infinite; animation-delay: calc(var(--i) * -.9s); }
.t-spa .fx i:nth-child(n+8) { display: none; }
/* the barber's pole */
.t-barber .fx::before { content: ''; position: absolute; left: 14px; top: 64px; width: 20px; height: 150px; border-radius: 12px; border: 3px solid #d9c08a; background: repeating-linear-gradient(-45deg, #b7332b 0 11px, #f6efe0 11px 22px, #1f5f8b 22px 33px, #f6efe0 33px 44px); background-size: 100% 62px; box-shadow: 0 10px 22px rgba(0,0,0,.45), inset 6px 0 8px rgba(255,255,255,.35); animation: pole 1.6s linear infinite; } @keyframes pole { to { background-position: 0 62px; } }

@media (max-width: 760px) { .fx i:nth-child(n+11) { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .fx, .welcome { display: none !important; } .shop .cover img { scale: 1; } }

/* ── Safari: a picture must never decide the size of its frame ──
   iPhones size a percentage height inside an aspect-ratio box from the picture's own pixels, which blew cards up to
   several screens wide. The picture is laid over its frame instead, so only the frame sets the size. */
.item .pic, .shop .cover, .fc-pic { position: relative; overflow: hidden; min-width: 0; min-height: 0; }
.item .pic > img, .item .pic > .noimg, .shop .cover > img, .shop .cover > .noimg, .fc-pic > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.l-cards .cover { overflow: visible; }
.l-cards .cover > img, .l-cards .cover > .noimg { inset: 12px 12px 40px; width: calc(100% - 24px); height: calc(100% - 52px); }
.l-board .item .pic { align-self: stretch; }
