/* Cây thông ảnh — chrome tối giản: vàng champagne trên nền xanh thông / đỏ nhung rất sâu */
:root {
  --gold: #e3c48a; --gold-hi: #f6e3b8; --gold-lo: #a9824a; --ivory: #f3ead8; --ink: #07110c;
  --serif: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Be Vietnam Pro', system-ui, sans-serif;
  --u: min(1vh, 0.5625vw); /* đơn vị theo khung 16:9 */
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #060d0a; color: var(--ivory); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body.idle { cursor: none; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }

.grain { position: fixed; inset: 0; pointer-events: none; opacity: .06; mix-blend-mode: overlay; background-size: 256px 256px; }
.vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 72% 78% at 50% 46%, rgba(0,0,0,0) 38%, rgba(3,6,5,.34) 100%); transition: opacity 1.2s ease; }
.vignette::after { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease;
  background: radial-gradient(ellipse 46% 58% at 50% 46%, rgba(0,0,0,0) 46%, rgba(3,6,5,.62) 100%); }
body.is-hero .vignette::after, body.is-focus .vignette::after { opacity: 1; }

.brand { position: fixed; left: calc(var(--u) * 5.6); top: calc(var(--u) * 5); pointer-events: none; transition: opacity .8s ease; }
.brand-over { font-size: calc(var(--u) * 2.2); font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--gold-hi); }
.brand-title { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: calc(var(--u) * 6.2); line-height: 1.12; margin-top: calc(var(--u) * 0.9);
  background: linear-gradient(180deg, var(--gold-hi) 10%, var(--gold) 55%, var(--gold-lo) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 .12em .14em 0; white-space: nowrap; }
.brand-sub { font-size: calc(var(--u) * 1.75); font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--ivory); opacity: .92; margin-top: calc(var(--u) * 0.2);
  display: flex; align-items: center; gap: 1.2em; white-space: nowrap; }
.brand-sub::before { content: ''; width: calc(var(--u) * 4.4); height: 1px; background: linear-gradient(90deg, var(--gold), rgba(227,196,138,.2)); }

.counter { position: fixed; right: calc(var(--u) * 5.6); top: calc(var(--u) * 4.6); text-align: right; pointer-events: none; transition: opacity .8s ease; }
.counter-num { display: block; font-family: var(--serif); font-weight: 600; font-size: calc(var(--u) * 9.4); line-height: 1; font-variant-numeric: lining-nums tabular-nums;
  background: linear-gradient(180deg, var(--gold-hi) 8%, var(--gold) 55%, var(--gold-lo) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.counter-num.bump { animation: bump .9s cubic-bezier(.2,.9,.25,1); }
@keyframes bump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-6%) scale(1.07); } 100% { transform: none; } }
.counter-label { display: block; font-size: calc(var(--u) * 1.8); font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--ivory); opacity: .92; margin-top: calc(var(--u) * 0.6); margin-right: -.3em; }

.hint { position: fixed; left: calc(var(--u) * 5.6); bottom: calc(var(--u) * 5); display: flex; align-items: center; gap: calc(var(--u) * 2); pointer-events: none; transition: opacity .8s ease; }
.hint-qr { width: calc(var(--u) * 10.5); height: calc(var(--u) * 10.5); padding: calc(var(--u) * 0.8); background: var(--ivory); border-radius: calc(var(--u) * 0.9);
  box-shadow: 0 0 0 1px rgba(227,196,138,.7), 0 calc(var(--u) * 1) calc(var(--u) * 3) rgba(0,0,0,.45); }
.hint-qr svg, .hint-qr img { width: 100%; height: 100%; display: block; }
.hint-main { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: calc(var(--u) * 2.7); color: var(--gold-hi); white-space: nowrap; }
.hint-url { font-size: calc(var(--u) * 2.2); letter-spacing: .12em; color: var(--ivory); opacity: .9; margin-top: calc(var(--u) * 0.7); white-space: nowrap; }

.empty { position: fixed; left: 0; right: 0; bottom: calc(var(--u) * 9); text-align: center; font-family: var(--serif); font-style: italic; font-size: calc(var(--u) * 3.4); color: var(--gold-hi); pointer-events: none; }

body.is-hero .brand, body.is-hero .counter, body.is-hero .hint, body.is-focus .hint, body.is-focus .brand, body.is-focus .counter { opacity: .22; }

.caption { position: fixed; left: 0; right: 0; top: 76.5%; text-align: center; pointer-events: none; opacity: 0; transform: translateY(calc(var(--u) * 1.6)); transition: opacity .7s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.caption.on { opacity: 1; transform: none; }
.caption::before { content: ''; position: absolute; left: 50%; top: 50%; width: 70vw; height: 260%; transform: translate(-50%, -50%); z-index: -1;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(3,7,5,.9) 0%, rgba(3,7,5,.66) 45%, rgba(3,7,5,0) 100%); }
.caption-main { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: calc(var(--u) * 5.2); line-height: 1.2; padding: 0 .2em .1em;
  background: linear-gradient(180deg, #fff3d6 10%, var(--gold) 60%, var(--gold-lo) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 calc(var(--u) * 0.4) calc(var(--u) * 1.4) rgba(0,0,0,.7)); white-space: nowrap; }
.caption-sub { margin-top: calc(var(--u) * 1); font-size: calc(var(--u) * 1.8); font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--ivory); text-shadow: 0 2px 12px rgba(0,0,0,.8); white-space: nowrap; }

.milestone { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; opacity: 0; transition: opacity .9s ease;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(4,9,7,.78) 0%, rgba(4,9,7,.45) 55%, rgba(4,9,7,0) 100%); }
.milestone.on { opacity: 1; }
.ms-num { font-family: var(--serif); font-weight: 700; font-size: calc(var(--u) * 30); line-height: .95; font-variant-numeric: lining-nums;
  background: linear-gradient(180deg, #fff6dc 5%, var(--gold) 50%, #8d6a38 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 calc(var(--u) * 0.8) calc(var(--u) * 3) rgba(0,0,0,.6)); transform: scale(.86); transition: transform 1.6s cubic-bezier(.2,.9,.2,1); padding: 0 .08em .06em; }
.milestone.on .ms-num { transform: none; }
.ms-label { font-size: calc(var(--u) * 2.2); font-weight: 500; letter-spacing: .36em; text-transform: uppercase; color: var(--ivory); margin-top: calc(var(--u) * 1.4); }
.ms-line { font-family: var(--serif); font-style: italic; font-size: calc(var(--u) * 4.2); color: var(--gold-hi); margin-top: calc(var(--u) * 2.2); white-space: nowrap; }

.lightbox { position: fixed; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 9vw; opacity: 0; transition: opacity .6s ease; }
.lightbox.on { opacity: 1; }
.lb-card { background: #0b1611; padding: calc(var(--u) * 1.4); border-radius: calc(var(--u) * 1.2); box-shadow: 0 0 0 1px rgba(227,196,138,.65), 0 calc(var(--u) * 3) calc(var(--u) * 9) rgba(0,0,0,.6);
  transform: translateY(calc(var(--u) * 2)) scale(.97); transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.lightbox.on .lb-card { transform: none; }
.lb-card img { display: block; max-height: 70vh; max-width: 42vw; min-height: 30vh; border-radius: calc(var(--u) * 0.6); background: #132119; }
.lb-card figcaption { display: flex; justify-content: space-between; gap: 2em; padding: calc(var(--u) * 1.4) calc(var(--u) * 0.6) calc(var(--u) * 0.4); font-size: calc(var(--u) * 1.6); letter-spacing: .12em; color: var(--ivory); }
.lb-card figcaption span:first-child { color: var(--gold-hi); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.lb-close { position: absolute; right: 9vw; bottom: 6vh; font: 600 calc(var(--u) * 1.7) var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border: 0; border-radius: 999px; padding: calc(var(--u) * 1.5) calc(var(--u) * 3.6); min-height: 48px; cursor: pointer; }
.lb-close:focus-visible, .mc button:focus-visible, .mc input:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.mc { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 34vw); background: rgba(7,15,11,.96); border-left: 1px solid rgba(227,196,138,.45); padding: 28px 24px 18px; display: flex; flex-direction: column; gap: 14px; z-index: 20; cursor: auto; }
.mc h2 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 30px; color: var(--gold-hi); }
.mc-head p { font-size: 14px; color: var(--ivory); opacity: .8; margin-top: 4px; }
.mc-pin { display: grid; gap: 6px; font-size: 13px; letter-spacing: .08em; color: var(--ivory); }
.mc-pin input { font: 500 18px var(--sans); letter-spacing: .3em; padding: 12px 14px; color: var(--ivory); background: #0f1e17; border: 1px solid rgba(227,196,138,.5); border-radius: 8px; }
.mc-msg { min-height: 20px; font-size: 14px; color: #ffb9a8; }
.mc-msg.ok { color: #bfe6c9; }
.mc-list { list-style: none; padding: 0; overflow: auto; flex: 1; display: grid; gap: 8px; align-content: start; }
.mc-list li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 8px; background: #0f1e17; border-radius: 10px; }
.mc-list img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 1px rgba(227,196,138,.6); }
.mc-list b { display: block; font-size: 15px; font-weight: 600; color: var(--ivory); }
.mc-list small { font-size: 13px; color: var(--ivory); opacity: .7; }
.mc-list button { font: 600 13px var(--sans); letter-spacing: .06em; color: var(--ivory); background: #6f111d; border: 1px solid rgba(255,200,190,.35); border-radius: 999px; padding: 0 16px; min-height: 44px; cursor: pointer; }
.mc-list button:hover { background: #8a1626; }
.mc-keys { font-size: 12px; color: var(--ivory); opacity: .6; }

.status { position: fixed; left: 50%; bottom: 3vh; transform: translateX(-50%); font-size: calc(var(--u) * 1.5); letter-spacing: .1em; padding: .7em 1.6em; border-radius: 999px; background: rgba(60,12,16,.92); color: #ffd9cf; border: 1px solid rgba(255,190,170,.4); }
.fps { position: fixed; right: 12px; bottom: 10px; font: 12px 'Space Mono', monospace; color: var(--gold); opacity: .8; white-space: pre; text-align: right; }

.loader { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; z-index: 30;
  background: radial-gradient(ellipse at 50% 45%, #0d1f17 0%, #060d0a 70%); transition: opacity 1.4s ease; }
.loader.done { opacity: 0; pointer-events: none; }
.loader p { font-family: var(--serif); font-style: italic; font-size: calc(var(--u) * 3); color: var(--gold-hi); }
.loader-star { width: calc(var(--u) * 7); height: calc(var(--u) * 7); background: linear-gradient(160deg, var(--gold-hi), var(--gold-lo));
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.9); opacity: .65; } 50% { transform: scale(1.05); opacity: 1; } }

.fallback { position: fixed; inset: 0; overflow: auto; padding: 8vh 8vw; background: radial-gradient(ellipse at 50% 20%, #0d1f17, #060d0a 70%); text-align: center; z-index: 25; }
.fallback h2 { font-family: var(--serif); font-style: italic; font-size: 48px; color: var(--gold-hi); }
.fallback p { margin: 14px auto 32px; max-width: 34em; font-size: 18px; line-height: 1.6; }
.fallback-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px; }
.fallback-wall img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 2px var(--gold); }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
}
body.mc-open .counter { opacity: 0; }
body.is-ms .counter { opacity: 0; }
