:root {
  --ink: #120807;
  --paper: #f7ecd9;
  --gold: #d6ad62;
  --gold-soft: #e9cf98;
  --lacquer: #5c0e12;
  --serif: 'Playfair Display', Georgia, serif;
  --book: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Be Vietnam Pro', system-ui, sans-serif;
  --han: 'Noto Serif SC', 'Songti SC', 'SimSun', 'PMingLiU', serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.i-pause { display: none; }
[aria-pressed="true"] .i-play { display: none; }
[aria-pressed="true"] .i-pause { display: inline; }

/* ============ the stage ============ */
.story { position: relative; z-index: 1; }
.stage-wrap { position: sticky; top: 0; height: 100vh; height: 100svh; }
.stage { --sw: 400px; position: relative; width: 100%; height: 100%; overflow: hidden; background: #1a0b09; isolation: isolate; }
.world { position: absolute; inset: 0; }
.world .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.no-webgl .world::after { content: 'Trình duyệt này chưa bật WebGL nên chưa xem được các bức bình phong.'; position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem; text-align: center; font-size: .9rem; color: rgba(247, 236, 217, .8); }

/* ============ words on the frame ============
   Sizes follow --sw, the smaller of the frame width and three quarters of its height,
   so words keep their proportions on a phone held upright and on a wide monitor. */
.caps { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.cap { position: absolute; left: 50%; width: min(86%, calc(var(--sw) * .95)); margin-left: max(-43%, calc(var(--sw) * -.475)); text-align: center; color: #fff9ef; opacity: 0; translate: 0 calc(var(--sw) * .025);
  transition: opacity .9s ease, translate 1.3s cubic-bezier(.2, .8, .2, 1);
  text-shadow: 0 0 calc(var(--sw) * .035) rgba(20, 5, 5, .75), 0 calc(var(--sw) * .004) calc(var(--sw) * .01) rgba(20, 5, 5, .6); }
.cap.on { opacity: 1; translate: none; }
.cap.cut { transition: none; }
.cap-top { top: 10%; }
.cap-mid { top: 50%; transform: translateY(-50%); }
.cap-mid.low { top: 61%; }
.cap-bottom { bottom: 9%; }
.cap-bottom.low { bottom: 4.5%; }
.cap-top.high { top: 7%; }
.cap small { display: block; font-family: var(--sans); font-weight: 600; font-size: calc(var(--sw) * .027); letter-spacing: .42em; padding-left: .42em; text-transform: uppercase; color: var(--gold-soft); }
.cap p { margin: calc(var(--sw) * .02) 0 0; font-family: var(--book); font-style: italic; font-weight: 500; font-size: calc(var(--sw) * .058); line-height: 1.32; }
.cap p.s { font-family: var(--sans); font-style: normal; font-weight: 400; font-size: calc(var(--sw) * .031); line-height: 1.6; letter-spacing: .03em; color: rgba(255, 249, 239, .9); }
.cap b.name { display: block; margin-top: calc(var(--sw) * .01); font-family: var(--serif); font-style: italic; font-weight: 400; font-size: calc(var(--sw) * .145); line-height: 1.05; }
.cap b.date { display: block; margin-top: calc(var(--sw) * .02); font-family: var(--serif); font-weight: 400; font-size: calc(var(--sw) * .1); letter-spacing: .04em; white-space: nowrap; }

/* the opening title, after the clip's "JAPAN / ANIMATED" with its red sun */
/* the title reads as letters cut from ivory card, lifted off the silk */
.cap.title b, .cap b.name, .cap b.date { text-shadow: 0 calc(var(--sw) * .003) 0 rgba(120, 70, 40, .55), 0 calc(var(--sw) * .009) calc(var(--sw) * .012) rgba(25, 6, 4, .55), 0 0 calc(var(--sw) * .04) rgba(20, 5, 5, .45); }
.cap.title b { display: block; font-family: var(--serif); font-weight: 400; font-size: calc(var(--sw) * .128); line-height: 1; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.cap.title b i { font-style: italic; text-transform: none; color: var(--gold-soft); }
.cap.title small { margin-top: calc(var(--sw) * .025); color: #fff9ef; letter-spacing: .5em; }
.cap.title .dot { display: grid; place-items: center; width: calc(var(--sw) * .085); height: calc(var(--sw) * .085); margin: calc(var(--sw) * .05) auto 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff3b2f, #c3110f 70%); box-shadow: 0 0 calc(var(--sw) * .05) rgba(255, 40, 20, .45);
  font-family: var(--han); font-size: calc(var(--sw) * .05); line-height: 1; color: #ffe9b8; text-shadow: none; }

/* paper grain and a soft vignette over the whole frame */
.grain { position: absolute; inset: 0; z-index: 7; pointer-events: none; mix-blend-mode: overlay; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.vignette { position: absolute; inset: 0; z-index: 6; pointer-events: none; background: radial-gradient(ellipse at 50% 48%, transparent 55%, rgba(10, 3, 2, .5)); }

/* ============ chrome ============ */
.bars { position: absolute; top: 12px; left: 14px; right: 14px; z-index: 9; display: flex; gap: 5px; }
.bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.bars b { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.hint { position: absolute; left: 0; right: 0; bottom: 6%; z-index: 9; display: flex; flex-direction: column; align-items: center; gap: .6rem; transition: opacity .6s ease; }
.hint p { margin: 0; font-size: .78rem; color: #fff5e6; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.hint.gone { opacity: 0; pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: .55rem; padding: .75rem 1.4rem .75rem 1.1rem; border: 1px solid rgba(247, 236, 217, .5); border-radius: 999px; background: rgba(247, 236, 217, .1); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.pill svg { width: 18px; height: 18px; fill: currentColor; }
.pill-light { background: var(--paper); color: #3a1712; border-color: transparent; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.controls { position: absolute; right: 16px; bottom: 16px; z-index: 9; display: flex; gap: 8px; }
.ctl { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 40px; height: 40px; padding: 0 11px; border: 0; border-radius: 999px; background: rgba(20, 8, 6, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff8ec; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.ctl svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ctl .lbl { display: none; }
.pill:focus-visible, .ctl:focus-visible, .chapters button:focus-visible, .music:focus-visible, .btn:focus-visible, .link:focus-visible, .replay:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.loader { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: var(--ink); transition: opacity .8s ease, visibility .8s; }
.loader span { width: 34px; height: 34px; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--gold-soft); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ready .loader { opacity: 0; visibility: hidden; }

/* chapter list over the left edge of the frame, only where there is room for it */
.rail { display: none; }
.chapters { margin: 0; padding: 0; list-style: none; }
.chapters button { display: flex; align-items: baseline; gap: .7rem; padding: .3rem 0; border: 0; background: none; color: rgba(247, 236, 217, .55); font-family: var(--serif); font-style: italic; font-size: 1.05rem; text-shadow: 0 1px 10px rgba(0, 0, 0, .8); cursor: pointer; transition: color .4s; }
.chapters button span { font-family: var(--sans); font-style: normal; font-size: .6rem; letter-spacing: .1em; }
.chapters button:hover, .chapters button.active { color: #fff8ec; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .rail { display: flex; align-items: center; position: absolute; left: 0; top: 0; bottom: 0; z-index: 9; padding: 0 5rem 0 clamp(18px, 3vw, 48px); transition: opacity .6s ease;
    background: linear-gradient(90deg, rgba(10, 4, 3, .62), rgba(10, 4, 3, .35) 55%, rgba(10, 4, 3, 0)); }
  .ctl { padding: 0 16px 0 13px; }
  .ctl .lbl { display: inline; }
}
.filming .rail, .at-details .rail { opacity: 0; pointer-events: none; }

/* ============ invitation ============ */
.details { position: relative; z-index: 3; min-height: 100vh; padding: 0 6vw 60px; text-align: center; color: var(--paper); overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(160, 30, 30, .35), transparent 65%), linear-gradient(180deg, #4a0b0e, #2b0709 60%, #1b0606); }
.frieze { display: block; width: calc(100% + 12vw); max-width: none; height: auto; margin: 0 -6vw clamp(40px, 7vw, 80px); border-bottom: 3px solid var(--gold);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); opacity: .92; }
.card { max-width: 640px; margin: 0 auto; }
.seal { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 1.4rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e8352a, #a50f0e 70%);
  box-shadow: 0 0 0 1px rgba(233, 207, 152, .5), 0 10px 30px rgba(0, 0, 0, .35); font-family: var(--han); font-size: 34px; line-height: 1; color: #ffe2a8; }
.kicker { margin: 0 0 .6rem; font-size: .74rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.names { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(3rem, 9vw, 5rem); line-height: 1.08; color: #fff8ec; }
.names span { display: block; }
.names i { display: block; font-size: .5em; color: var(--gold); }
.lead { max-width: 480px; margin: 1.3rem auto 2.4rem; font-family: var(--book); font-style: italic; font-size: 1.25rem; line-height: 1.5; color: rgba(247, 236, 217, .82); }
.when { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; max-width: 420px; margin: 0 auto; }
.when span { padding: .5rem 0; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); font-size: .78rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-soft); }
.when b { font-family: var(--serif); font-weight: 400; font-size: clamp(3.4rem, 9vw, 4.6rem); line-height: 1; color: #fff8ec; }
.month { margin: .5rem 0 2.2rem; font-family: var(--serif); letter-spacing: .12em; color: rgba(247, 236, 217, .8); }
.venue p { margin: 0; color: rgba(247, 236, 217, .82); }
.venue .venue-name { font-family: var(--serif); font-size: 1.35rem; color: #fff8ec; }
.link { display: inline-block; margin-top: .7rem; font-size: .74rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); text-decoration: none; border-bottom: 1px solid currentColor; }
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.6rem 0; }
.families h2 { margin: 0 0 .35rem; font-family: var(--sans); font-size: .7rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.families p { margin: 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.55; color: #fff3e2; }
.countdown { display: flex; justify-content: center; gap: clamp(.5rem, 2vw, 1rem); margin: 0 0 2.4rem; }
.countdown div { width: clamp(66px, 16vw, 92px); padding: .9rem 0 .7rem; border: 1px solid rgba(214, 173, 98, .45); border-radius: 12px; background: rgba(20, 5, 5, .35); }
.countdown b { display: block; font-family: var(--serif); font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 400; line-height: 1; color: #fff8ec; font-variant-numeric: tabular-nums; }
.countdown small { font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-soft); }
.btn { display: inline-flex; padding: 1rem 2.2rem; border-radius: 999px; background: linear-gradient(180deg, #ecd197, #c99a4e); color: #3a1210; font-size: .76rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; text-decoration: none; box-shadow: 0 12px 26px rgba(0, 0, 0, .35); transition: transform .3s ease, filter .3s ease, opacity 1.1s ease, translate 1.4s cubic-bezier(.2, .8, .2, 1); }
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.replay { display: block; width: max-content; margin: 1.6rem auto 0; font-size: .8rem; color: rgba(247, 236, 217, .7); text-decoration: none; border-bottom: 1px solid rgba(247, 236, 217, .35); }
.foot { margin: 3.2rem 0 0; font-size: .7rem; letter-spacing: .18em; color: rgba(247, 236, 217, .45); }
.reveal { opacity: 0; translate: 0 26px; transition: opacity 1.1s ease, translate 1.4s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; translate: none; }

.music { position: fixed; top: 22px; right: 18px; z-index: 20; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(20, 8, 6, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff8ec; cursor: pointer; }
.music[hidden] { display: none; }
.music svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.music .i-pause { fill: currentColor; stroke: none; }

/* frame-by-frame export (binhphong.film): only the picture and its words */
.filming .bars, .filming .hint, .filming .controls, .filming .loader { display: none; }
.filming .cap { transition: none; }

@media (max-width: 520px) { .families { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .loader span { animation: none; }
  .cap, .reveal, .hint { transition-duration: .01s !important; }
}
