/* Our First Home, illustrated (23 Oct 2026): story-game layer on top of site.css.
   Everything but the video is painted; the page reads like a quiet narrative game. */
:root { --dusk: #1b2236; --dusk-2: #263050; --cream: #fff8ec; }

/* ---------- main menu = link in bio ---------- */
.menu { position: relative; min-height: 100svh; overflow: hidden; background: var(--dusk); color: var(--cream); display: flex; flex-direction: column; }
.menu > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%;
              transform: translateY(calc(var(--par, 0) * -50px)) scale(1.05); }
.menu .veil { position: absolute; inset: 0; background: rgba(27, 34, 54, .18); }
.dust { position: absolute; inset: 0; pointer-events: none; }
.dust i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 236, 190, .85); filter: blur(.5px); animation: drift 9s linear infinite; opacity: 0; }
@keyframes drift { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 85% { opacity: .7; } 100% { transform: translate(30px, -140px); opacity: 0; } }
.menu .head { position: relative; text-align: center; padding: 15svh 20px 0; text-shadow: 0 2px 18px rgba(20, 16, 10, .55);
              transition: opacity 2.2s var(--out), transform 2.2s var(--out), filter 2.2s var(--out); }
/* visible by default; the intro only plays when JS adds and then drops .pre (never stuck hidden) */
.menu.pre .head, .menu.pre nav { opacity: 0; transform: translateY(8px); filter: blur(6px); }
.menu .brand { font-weight: 300; letter-spacing: .34em; font-size: 12px; text-transform: uppercase; }
.menu h1 { margin: 12px 0 6px; font-weight: 200; font-size: 46px; letter-spacing: .01em; line-height: 1; }
.menu .head .zh { font-size: 17px; letter-spacing: .32em; }
.menu .head .hand { display: block; font-size: 23px; color: var(--butter); margin-top: 12px; }
.menu nav { position: relative; margin-top: auto; padding: 0 20px 26px; width: var(--col); align-self: center;
             transition: opacity 1.6s var(--out) .9s, transform 1.6s var(--out) .9s, filter 1.6s var(--out) .9s; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 18px; margin-top: 8px; border-radius: 14px; border: 0;
      background: rgba(27, 34, 54, .62); color: var(--cream); text-decoration: none; font: 500 16px/1 var(--en); letter-spacing: .01em;
      -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .4s var(--out), transform .4s var(--out); cursor: pointer; }
.mi:active { transform: scale(.98); }
@media (hover: hover) { .mi:hover { background: rgba(27, 34, 54, .8); } }
.mi svg { width: 20px; height: 20px; flex: none; }
.mi .sub { margin-left: auto; font-size: 12px; opacity: .7; }
.mi.first { background: rgba(255, 248, 236, .92); color: var(--ink); font-weight: 700; min-height: 58px; }
.icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.icons a { display: grid; place-items: center; height: 50px; border-radius: 14px; background: rgba(27, 34, 54, .62); color: var(--cream);
           -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-decoration: none; font: 13px var(--zh); }
.icons a svg { width: 21px; height: 21px; }
.icons a.soon { opacity: .45; pointer-events: none; }

/* ---------- journal ---------- */
.journal { background: var(--paper); padding: 60px 0 34px; position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='34'%3E%3Crect y='33' width='10' height='1' fill='%238fdaff' fill-opacity='.45'/%3E%3C/svg%3E");
  background-position: 0 22px; }
.journal::before { content: ""; position: absolute; top: 0; bottom: 0; left: 34px; border-left: 2px solid rgba(255, 107, 74, .35); }
.page { width: var(--col); margin: 0 auto; padding: 0 22px 0 52px; position: relative; }
.entry { margin: 0 0 30px; font: 700 25px/34px var(--hand); color: var(--ink); }
.entry .date { display: block; font-size: 19px; color: var(--coral); }
.entry .zh { display: block; font-size: 17px; line-height: 34px; color: var(--muted); }
.journal .polaroid { width: 64%; display: block; margin: 6px 0 32px auto; transform: rotate(3deg); }
.journal .polaroid.l { margin-left: -14px; transform: rotate(-4deg); }
.journal .polaroid img { aspect-ratio: 4 / 5; }
.journal .polaroid figcaption { font-size: 21px; }
.doodle { display: block; margin: -8px 0 18px; }
.doodle path { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--out); }
.doodle.on path { stroke-dashoffset: 0; }
.doodle .c { stroke: var(--coral); }

/* ---------- episode title card ---------- */
.titlecard { background: var(--dusk); color: var(--cream); text-align: center; padding: 22svh 20px; }
.titlecard .ep { font-weight: 300; letter-spacing: .34em; font-size: 12px; text-transform: uppercase; }
.titlecard h2 { margin: 12px 0 6px; font-weight: 200; font-size: 42px; line-height: 1; }
.titlecard .zh { letter-spacing: .3em; font-size: 16px; }
.titlecard p { font: 700 22px/1.3 var(--hand); color: var(--butter); margin: 18px auto 0; max-width: 24ch; }
.reveal { opacity: 0; transform: translateY(10px); filter: blur(6px); transition: opacity 1.6s var(--out), transform 1.6s var(--out), filter 1.6s var(--out); }
.reveal.on { opacity: 1; transform: none; filter: none; }

/* rooms: painted stage */
.stage { background: var(--dusk); }

/* "will remember that" */
.remember { position: fixed; top: 16px; right: 14px; z-index: 40; display: flex; align-items: center; gap: 10px; background: rgba(27, 34, 54, .85);
  color: var(--cream); padding: 10px 14px 10px 12px; border-radius: 12px; font-size: 14px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateX(20px); transition: opacity .5s var(--out), transform .5s var(--out); pointer-events: none; }
.remember.on { opacity: 1; transform: none; }
.remember svg { width: 22px; height: 22px; flex: none; }

/* ---------- night ---------- */
.nightscene { position: relative; min-height: 100svh; background: var(--dusk); color: var(--cream); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; }
.nightscene > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nightscene .words { position: relative; padding: 12svh 22px 0; width: var(--col); align-self: center; text-align: center; text-shadow: 0 2px 16px rgba(0, 0, 0, .6); }
.nightscene .zh { display: block; font-size: 24px; color: var(--butter); }
.nightscene .en { display: block; font-weight: 200; font-size: 30px; line-height: 1.1; margin-top: 6px; }
.nightscene .owl { margin-top: 18px; background: none; border: 0; color: rgba(255, 248, 236, .75); font: 700 20px/1 var(--hand); cursor: pointer; }
.lightsout { position: absolute; inset: 0; background: var(--paper); pointer-events: none; opacity: 1; }
.nightscene.out .lightsout { animation: flick 1.1s steps(1) forwards; }
@keyframes flick { 0% { opacity: .9; } 16% { opacity: 0; } 28% { opacity: .8; } 40% { opacity: 0; } 50% { opacity: .35; } 60%, 100% { opacity: 0; } }

/* ---------- episodes rail ---------- */
.episodes { background: var(--dusk); color: var(--cream); padding: 54px 0 56px; }
.episodes h2 { width: var(--col); margin: 0 auto; padding: 0 22px; font-weight: 200; font-size: 30px; }
.episodes h2 .zh { display: block; font-size: 15px; letter-spacing: .3em; color: var(--butter); margin-top: 6px; }
.rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 22px max(22px, calc((100vw - 460px) / 2 + 22px)) 10px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.ep-card { flex: 0 0 76%; max-width: 330px; scroll-snap-align: center; border-radius: 18px; overflow: hidden; position: relative; aspect-ratio: 9 / 16;
           background: var(--dusk-2); box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .8); }
.ep-card video, .ep-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-card .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; background: rgba(27, 34, 54, .8); }
.ep-card .meta b { display: block; font-weight: 300; letter-spacing: .24em; font-size: 11px; text-transform: uppercase; color: var(--butter); }
.ep-card .meta span { display: block; font-size: 20px; font-weight: 600; margin-top: 4px; }
.ep-card .meta .zh { font-size: 15px; font-weight: 400; opacity: .85; margin-top: 2px; }
.ep-card.locked img { filter: saturate(.25) brightness(.55); }
.ep-card .lock { position: absolute; top: 40%; left: 0; right: 0; text-align: center; font: 700 27px/1.1 var(--hand); color: var(--cream); }
.ep-card .playbtn { position: absolute; left: 0; right: 0; top: 38%; margin: 0 auto; width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--coral);
                    display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .7); }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 248, 236, .3); transition: background .3s, width .3s var(--out); }
.dots i.on { background: var(--butter); width: 20px; border-radius: 4px; }
.swipehint { text-align: center; font: 700 20px/1 var(--hand); color: rgba(255, 248, 236, .7); margin-top: 12px; }

footer.end { background: var(--dusk); color: rgba(255, 248, 236, .75); padding: 0 0 46px; font-size: 13.5px; line-height: 1.55; }
footer.end .mi { margin-bottom: 18px; }
footer.end .zh { display: block; margin-top: 6px; }

/* ---------- help us fill our first home: milestone + room carousel ---------- */
.living { background: var(--paper); padding: 64px 0 56px; }
.living .big { font-size: clamp(30px, 9vw, 38px); }
.goal { margin: 18px 0 0; }
.goal .meter { height: 12px; border-radius: 999px; background: #efe3cf; overflow: hidden; }
.goal .meter i { display: block; height: 100%; width: 2%; border-radius: 999px; background: var(--coral); transition: width 1.2s var(--out); }
.goal p { margin: 8px 0 0; font-size: 15px; color: var(--ink); }
.goal .hand { font-size: 19px; color: var(--muted); margin-left: 4px; }
.sq { display: inline-block; width: 15px; height: 15px; border-radius: 4px; border: 2px dashed #8f95a3; background: rgba(255,253,248,.9); vertical-align: -2px; margin: 0 2px; }
.sq.have { border: 0; background: var(--coral); margin-left: 12px; }
.tabs { display: flex; gap: 8px; margin: 18px 0 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-radius: 999px; background: #fffdf8; color: var(--ink); font: 600 13.5px var(--en);
               cursor: pointer; box-shadow: 0 1px 0 rgba(31,42,68,.12), 0 6px 14px -10px rgba(31,42,68,.35); white-space: nowrap; transition: background .3s; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--cream); }
.carousel { position: relative; margin-top: 14px; }
.track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
         padding: 4px max(20px, calc((100vw - 460px) / 2 + 20px)) 14px; }
.track::-webkit-scrollbar { display: none; }
.room-card { flex: 0 0 min(86vw, 420px); scroll-snap-align: center; }
.sheet { position: relative; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: #fffdf8; box-shadow: 0 18px 36px -20px rgba(31,42,68,.55); }
.sheet .base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet .layer { position: absolute; display: block; opacity: 0; transition: opacity 1.2s var(--out) .2s; }
.sheet.lit .layer { opacity: 1; }
.arrow { position: absolute; top: calc(50% - 7px); transform: translateY(-50%); z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0;
         background: rgba(27, 34, 54, .72); color: var(--cream); display: grid; place-items: center; cursor: pointer;
         -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.arrow svg { width: 20px; height: 20px; }
.arrow.prev { left: max(8px, calc((100vw - 460px) / 2 + 2px)); }
.arrow.next { right: max(8px, calc((100vw - 460px) / 2 + 2px)); }
.slot { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; background: none; padding: 0; cursor: pointer; }
.slot::before { content: ""; position: absolute; inset: 12px; border-radius: 5px; }
.slot.not::before { background: rgba(255, 253, 248, .9); border: 2px dashed #8f95a3; }
.slot.have::before { background: var(--coral); box-shadow: 0 0 0 3px #fff; }
.slot .tag { position: absolute; top: 34px; left: 50%; transform: translateX(-50%) rotate(-3deg); white-space: nowrap; font: 700 15px/1 var(--hand);
             color: #6b7180; background: rgba(255, 253, 248, .85); padding: 3px 7px 2px; border-radius: 6px; pointer-events: none; }
.slot.up .tag { top: auto; bottom: 34px; }
.slot.have .tag { color: var(--coral); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.invite { margin-top: 26px; background: var(--ink); color: var(--cream); border-radius: 20px; padding: 22px 20px; }
.invite .hand { margin: 0; font-size: 21px; color: var(--butter); }
.invite h3 { margin: 4px 0 0; font-weight: 800; font-size: 24px; letter-spacing: -0.03em; line-height: 1.1; }
.invite p { margin: 8px 0 16px; font-size: 15px; line-height: 1.45; color: rgba(255, 248, 236, .85); }
.card .buy { margin-top: 16px; }
.card .buy.soon { opacity: .5; pointer-events: none; }
.room[data-key=bar] .fallback { object-position: 55% 50%; }
.room[data-key=lounge] .fallback { object-position: 65% 50%; }
.slot.r .tag { left: auto; right: 6px; transform: rotate(-3deg); }
.slot.l .tag { left: 6px; transform: rotate(-3deg); }
