@font-face {
  font-family: "Cormorant Unicase";
  src: url("../assets/fonts/cormorant-unicase-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Unicase";
  src: url("../assets/fonts/cormorant-unicase-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-latin-300-normal.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}

:root {
  --bg: #0f0b08;
  --ivory: #fbf8ee;
  --gold: #c9a86a;
  --bronze: #7b5b3f;
  --brown: #564435;
  --blue: #3d9fff;
  --pad: 28px;
  --serif-vn: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-width: thin; scrollbar-color: var(--bronze) var(--bg); }
html, body { background: var(--bg); }
body {
  font-family: "Geist", system-ui, sans-serif;
  color: var(--ivory);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }

#track { height: 1200vh; width: 1px; }

#hall {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  display: block; z-index: 1; cursor: crosshair;
}

#hero-fallback {
  position: fixed; inset: 0; z-index: 1; overflow: hidden; opacity: 0;
  background: #0f0b08; pointer-events: none;
}
#hero-fallback img { width: 100%; height: 100%; object-fit: cover; display: block; }
#hero-fallback::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(15,11,8,.72) 100%);
}

/* ---- film layer ---- */
#film {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0; background: #000;
}
.chapter { position: absolute; inset: 0; opacity: 0; overflow: hidden; }
.chapter img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  will-change: transform; transform-origin: 50% 50%;
}
.chapter-text {
  position: absolute; left: var(--pad); top: calc(var(--pad) + 56px);
  max-width: min(620px, 82vw); text-shadow: 0 1px 18px rgba(0,0,0,.65), 0 0 3px rgba(0,0,0,.5);
  z-index: 3;
  /* scrim: the paintings are bright at the top (window, sky), so bare
     text goes unreadable mid-scroll — a soft dark panel fixes it */
  background: linear-gradient(180deg, rgba(8,6,4,.66), rgba(8,6,4,.38) 72%, rgba(8,6,4,0));
  padding: 16px 20px 30px; margin: -16px -20px;
}
.numeral {
  font-family: "Cormorant Unicase", serif; font-weight: 500;
  font-size: 15px; letter-spacing: .35em; color: var(--gold); margin-bottom: 10px;
}
.chapter-text h2 {
  font-family: "Cormorant Unicase", serif; font-weight: 500;
  font-size: clamp(38px, 6vw, 84px); line-height: .95; letter-spacing: .02em;
  color: var(--ivory);
}
.chapter-text .vn {
  font-family: var(--serif-vn); font-style: italic;
  font-size: clamp(15px, 1.6vw, 19px); color: #e8dcc3; margin-top: 8px;
}
.chapter-text .body {
  font-family: "Geist", sans-serif; font-weight: 300;
  font-size: clamp(14px, 1.4vw, 17px); line-height: 1.65; color: #f2ede0;
  margin-top: 12px; max-width: 520px;
}
#grain {
  position: absolute; inset: -100px; pointer-events: none; opacity: .08; z-index: 5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}

/* ---- product strip (scroll-linked) ---- */
.strip {
  position: absolute; left: 0; right: 0; bottom: calc(var(--pad) + 6px); z-index: 3;
  display: flex; gap: 14px; padding: 0 var(--pad);
  pointer-events: auto; will-change: transform;
}
.p-card {
  flex: 0 0 248px; background: rgba(10,8,6,.82);
  border: 1px solid rgba(201,168,106,.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 10px; display: flex; flex-direction: column; gap: 7px;
  transition: border-color .25s ease;
}
.p-card:hover { border-color: var(--gold); }
.p-card img { width: 100%; height: 148px; object-fit: cover; display: block; cursor: pointer; }
.p-brand { font-size: 10px; letter-spacing: .3em; color: var(--gold); }
.p-name { font-size: 13.5px; line-height: 1.45; min-height: 40px; color: var(--ivory); }
.p-price-row { display: flex; align-items: baseline; gap: 8px; }
.p-price { font-size: 18px; font-weight: 500; color: var(--blue); }
.p-old { font-size: 12px; color: #8f8271; text-decoration: line-through; }
.p-sold { font-size: 11px; letter-spacing: .08em; color: #cfc4ab; }
.p-add {
  margin-top: auto; cursor: pointer; text-align: center;
  font-family: "Geist", sans-serif; font-size: 12px; letter-spacing: .22em;
  color: var(--ivory); background: transparent; border: 1px solid var(--gold);
  padding: 10px 0 9px; transition: background .2s ease, color .2s ease;
}
.p-add:hover { background: var(--gold); color: var(--bg); }
.p-add.added { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---- services panel (chapter IV) ---- */
.services {
  position: absolute; left: 0; right: 0; bottom: calc(var(--pad) + 6px); z-index: 3;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 var(--pad);
  pointer-events: auto;
}
.svc {
  background: rgba(10,8,6,.82); border: 1px solid rgba(201,168,106,.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 14px; display: flex; flex-direction: column; gap: 5px;
}
.svc-name { font-family: "Cormorant Unicase", serif; font-size: 17px; letter-spacing: .05em; }
.svc-note { font-size: 11.5px; line-height: 1.5; color: #cfc4ab; }
.svc-price { font-size: 13px; color: var(--blue); font-weight: 500; }
.svc-cta {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px;
  background: rgba(10,8,6,.82); border: 1px solid rgba(201,168,106,.45);
  padding: 12px 14px;
}
.svc-cta span { font-size: 13px; color: var(--ivory); line-height: 1.55; }
.svc-cta .svc-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.svc-cta-row a, .svc-cta-row button {
  cursor: pointer; text-decoration: none; text-align: center;
  font-family: "Geist", sans-serif; font-size: 12px; letter-spacing: .2em;
  color: var(--ivory); background: transparent; border: 1px solid var(--gold);
  padding: 11px 18px 10px; transition: background .2s ease, color .2s ease;
}
.svc-cta-row a:hover, .svc-cta-row button:hover { background: var(--gold); color: var(--bg); }
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-30px, 20px); }
  50% { transform: translate(20px, -25px); } 75% { transform: translate(-15px, -10px); }
  100% { transform: translate(0, 0); }
}
#vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,.42) 100%);
}

/* ---- hall chrome ---- */
#masthead {
  position: fixed; top: var(--pad); left: 0; right: 0; z-index: 3;
  text-align: center; pointer-events: none;
  transition: opacity .6s ease;
}
#masthead .title {
  font-family: "Cormorant Unicase", serif; font-weight: 500;
  font-size: clamp(17px, 2.2vw, 26px); letter-spacing: .32em; color: var(--ivory);
  text-shadow: 0 1px 12px rgba(0,0,0,.7);
}
#masthead .sub {
  font-size: 11px; letter-spacing: .42em; color: var(--gold); margin-top: 7px;
  text-shadow: 0 1px 10px rgba(0,0,0,.7);
}
#hint {
  position: fixed; right: var(--pad); bottom: var(--pad); z-index: 3;
  font-size: 11px; letter-spacing: .34em; color: var(--ivory);
  text-shadow: 0 1px 10px rgba(0,0,0,.8); pointer-events: none;
  animation: hint-bob 2.6s ease-in-out infinite;
}
@keyframes hint-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

#card {
  position: fixed; left: var(--pad); bottom: var(--pad); z-index: 3;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: rgba(15,11,8,.55); border: 1px solid rgba(201,168,106,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 12px 16px; cursor: pointer; text-align: left; color: var(--ivory);
  transition: border-color .25s ease, background .25s ease, opacity .4s ease;
}
#card:hover { border-color: var(--gold); background: rgba(15,11,8,.75); }
#card .card-num { font-family: "Cormorant Unicase", serif; font-size: 13px; letter-spacing: .3em; color: var(--gold); }
#card .card-name { font-family: "Cormorant Unicase", serif; font-size: 19px; letter-spacing: .06em; }
#card .card-meta { font-size: 11px; letter-spacing: .18em; color: #cfc4ab; }

#rail {
  position: fixed; right: var(--pad); top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; flex-direction: column; gap: 12px;
}
#rail button {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer;
  opacity: .45; transition: opacity .25s ease; padding: 0; color: var(--ivory);
}
#rail button:hover, #rail button.active { opacity: 1; }
#rail img { width: 44px; height: 30px; object-fit: cover; border: 1px solid rgba(201,168,106,.7); display: block; }
#rail span { font-family: "Cormorant Unicase", serif; font-size: 14px; letter-spacing: .2em; }

#sound {
  position: fixed; left: var(--pad); top: var(--pad); z-index: 3;
  background: none; border: 0; cursor: pointer; color: var(--ivory);
  font-family: "Geist", sans-serif; font-size: 11px; letter-spacing: .3em;
  text-shadow: 0 1px 10px rgba(0,0,0,.8); padding: 4px 0;
}
#sound:hover { color: var(--gold); }

#cart-btn {
  position: fixed; right: var(--pad); top: var(--pad); z-index: 7;
  background: rgba(15,11,8,.6); border: 1px solid var(--gold); cursor: pointer; color: var(--ivory);
  font-family: "Geist", sans-serif; font-size: 11px; letter-spacing: .28em;
  padding: 9px 14px; transition: background .2s ease, color .2s ease;
}
#cart-btn:hover { background: var(--gold); color: var(--bg); }
#cart-btn.full { background: var(--blue); border-color: var(--blue); color: #fff; }

#touch-tip {
  position: fixed; z-index: 6; pointer-events: none; display: none;
  font-size: 11px; letter-spacing: .3em; color: var(--ivory);
  background: rgba(15,11,8,.72); border: 1px solid rgba(201,168,106,.6);
  padding: 7px 12px; white-space: nowrap; transform: translate(14px, 14px);
}

/* ---- finale ---- */
#finale {
  position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px;
  pointer-events: none; opacity: 0; padding: 0 20px;
  background: radial-gradient(ellipse at center, rgba(15,11,8,.12) 0%, rgba(15,11,8,.55) 100%);
}
.finale-line {
  font-family: "Cormorant Unicase", serif; font-weight: 500;
  font-size: clamp(26px, 4.6vw, 58px); line-height: 1.05; letter-spacing: .04em;
  color: var(--ivory); text-shadow: 0 2px 26px rgba(0,0,0,.8); max-width: 900px;
}
.finale-vn { font-family: var(--serif-vn); font-style: italic; font-size: clamp(15px, 1.8vw, 20px); color: #e8dcc3; }
.finale-addr { font-family: var(--serif-vn); font-style: italic; font-size: clamp(13px, 1.5vw, 16px); color: #cfc4ab; }
.finale-sub { font-size: 11px; letter-spacing: .42em; color: var(--gold); margin-top: 6px; }
.finale-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.finale-btns button, .finale-btns a {
  pointer-events: auto; cursor: pointer; text-decoration: none; text-align: center;
  font-family: "Cormorant Unicase", serif; font-size: 16px; letter-spacing: .3em;
  color: var(--ivory); background: transparent;
  border: 1px solid var(--gold); padding: 14px 26px 12px;
  transition: background .25s ease, color .25s ease;
}
#order-zalo { background: var(--blue); border-color: var(--blue); color: #fff; }
#order-zalo:hover { background: #2f8ce8; }
.finale-btns button:hover, .finale-btns a:hover { background: var(--gold); color: var(--bg); }
#watch-again { margin-top: 0; }
.finale-note { font-size: 12px; letter-spacing: .1em; color: #cfc4ab; min-height: 16px; }

/* ---- overlay ---- */
#overlay {
  position: fixed; inset: 0; z-index: 8; display: none;
  background: rgba(8,6,4,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center; gap: 36px; padding: 40px;
}
#overlay.open { display: flex; }
#overlay img { max-width: min(58vw, 760px); max-height: 78vh; object-fit: contain; border: 1px solid rgba(201,168,106,.5); }
.overlay-text { max-width: 420px; }
.overlay-text h3 { font-family: "Cormorant Unicase", serif; font-weight: 500; font-size: 34px; letter-spacing: .04em; }
.overlay-meta { font-size: 11px; letter-spacing: .3em; color: var(--gold); margin: 10px 0 16px; }
.overlay-text p:last-child { font-weight: 300; font-size: 15px; line-height: 1.8; color: #efe9d8; }
#overlay-close {
  position: absolute; top: 22px; right: 26px; background: none; border: 0; cursor: pointer;
  color: var(--ivory); font-size: 22px; padding: 8px;
}
#overlay-close:hover { color: var(--gold); }
#overlay-shop {
  margin-top: 20px; cursor: pointer;
  font-family: "Geist", sans-serif; font-size: 12px; letter-spacing: .22em;
  color: var(--ivory); background: transparent; border: 1px solid var(--gold);
  padding: 12px 20px 11px; transition: background .2s ease, color .2s ease;
}
#overlay-shop:hover { background: var(--gold); color: var(--bg); }

/* ---- product overlay + cart panel ---- */
#p-overlay {
  position: fixed; inset: 0; z-index: 8; display: none;
  background: rgba(8,6,4,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center; gap: 36px; padding: 40px;
}
#p-overlay.open { display: flex; }
#p-overlay img { max-width: min(46vw, 560px); max-height: 78vh; object-fit: contain; border: 1px solid rgba(201,168,106,.5); }
#p-overlay-close {
  position: absolute; top: 22px; right: 26px; background: none; border: 0; cursor: pointer;
  color: var(--ivory); font-size: 22px; padding: 8px;
}
#p-overlay-close:hover { color: var(--gold); }
.p-price { font-size: 24px; font-weight: 500; color: var(--blue); margin-top: 14px; }
.p-price s { font-size: 15px; color: #8f8271; margin-left: 8px; }
.p-sold { font-size: 12px; letter-spacing: .1em; color: #cfc4ab; margin-top: 6px; }
.p-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.qty { display: flex; align-items: center; border: 1px solid rgba(201,168,106,.6); }
.qty button { background: none; border: 0; color: var(--ivory); font-size: 18px; cursor: pointer; padding: 8px 14px; }
.qty button:hover { color: var(--gold); }
.qty span { min-width: 32px; text-align: center; font-size: 15px; }
#p-add {
  cursor: pointer; font-family: "Geist", sans-serif; font-size: 12px; letter-spacing: .22em;
  color: #fff; background: var(--blue); border: 1px solid var(--blue);
  padding: 12px 22px 11px; transition: background .2s ease;
}
#p-add:hover { background: #2f8ce8; }

#cart-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 9; width: min(400px, 94vw);
  background: rgba(12,9,6,.97); border-left: 1px solid rgba(201,168,106,.55);
  display: none; flex-direction: column; padding: 22px;
}
#cart-panel.open { display: flex; }
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cart-head h3 { font-family: "Cormorant Unicase", serif; font-size: 22px; letter-spacing: .14em; }
#cart-close { background: none; border: 0; color: var(--ivory); font-size: 20px; cursor: pointer; padding: 6px; }
#cart-close:hover { color: var(--gold); }
#cart-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.cart-empty { color: #8f8271; font-size: 13px; line-height: 1.7; }
.cart-item { display: flex; gap: 12px; border: 1px solid rgba(201,168,106,.35); padding: 10px; align-items: center; }
.cart-item img { width: 64px; height: 64px; object-fit: cover; flex: 0 0 64px; }
.cart-item .ci-name { font-size: 13px; line-height: 1.4; }
.cart-item .ci-price { font-size: 14px; color: var(--blue); font-weight: 500; margin-top: 4px; }
.ci-qty { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.ci-qty button { background: none; border: 1px solid rgba(201,168,106,.5); color: var(--ivory); cursor: pointer; width: 26px; height: 26px; font-size: 14px; }
.ci-qty span { min-width: 24px; text-align: center; font-size: 13px; }
.cart-foot { border-top: 1px solid rgba(201,168,106,.4); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cart-total { font-size: 17px; }
.cart-total span { color: var(--blue); font-weight: 500; }
#cart-order, #cart-clear {
  cursor: pointer; text-align: center; font-family: "Geist", sans-serif; font-size: 12px; letter-spacing: .22em;
  padding: 12px 0 11px; transition: background .2s ease, color .2s ease;
}
#cart-order { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
#cart-order:hover { background: #2f8ce8; }
#cart-call {
  text-align: center; text-decoration: none; font-family: "Geist", sans-serif; font-size: 12px; letter-spacing: .22em;
  color: var(--ivory); background: transparent; border: 1px solid var(--gold); padding: 12px 0 11px;
}
#cart-call:hover { background: var(--gold); color: var(--bg); }
#cart-clear { color: #8f8271; background: transparent; border: 1px solid rgba(143,130,113,.5); }
#cart-clear:hover { color: var(--ivory); border-color: var(--ivory); }
.cart-note { font-size: 12px; line-height: 1.6; color: #cfc4ab; min-height: 16px; }

/* ---- preloader ---- */
#preloader {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity .8s ease;
}
#preloader.done { opacity: 0; pointer-events: none; }
.pre-frame { position: absolute; inset: 26px; pointer-events: none; }
.pre-frame i { position: absolute; background: var(--gold); opacity: 0; transition: opacity 1.2s ease; }
.pre-frame i:nth-child(1) { top: 0; left: 0; right: 0; height: 1px; }
.pre-frame i:nth-child(2) { bottom: 0; left: 0; right: 0; height: 1px; }
.pre-frame i:nth-child(3) { left: 0; top: 0; bottom: 0; width: 1px; }
.pre-frame i:nth-child(4) { right: 0; top: 0; bottom: 0; width: 1px; }
#preloader.lit .pre-frame i { opacity: .85; }
.pre-title {
  font-family: "Cormorant Unicase", serif; font-weight: 500; text-align: center;
  font-size: clamp(30px, 5vw, 54px); line-height: 1.08; letter-spacing: .1em; color: var(--ivory);
}
.pre-count { display: flex; align-items: baseline; gap: 16px; }
#pre-num { font-family: "Cormorant Unicase", serif; font-size: 30px; letter-spacing: .12em; color: var(--gold); min-width: 74px; text-align: right; }
#pre-word { font-size: 11px; letter-spacing: .42em; color: #cfc4ab; }
#enter {
  font-family: "Cormorant Unicase", serif; font-size: 17px; letter-spacing: .4em;
  color: var(--bg); background: var(--gold); border: 0; cursor: pointer;
  padding: 15px 34px 13px 38px; transition: background .25s ease, transform .25s ease;
}
#enter:hover { background: var(--ivory); transform: translateY(-1px); }
.pre-note { font-size: 10px; letter-spacing: .34em; color: #8f8271; text-align: center; padding: 0 20px; }

#nogl {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 30;
  background: rgba(8,6,4,.85); border: 1px solid rgba(201,168,106,.5);
  padding: 8px 14px; max-width: 92vw; text-align: center;
}
#nogl p { font-family: "Geist", sans-serif; font-size: 11px; letter-spacing: .14em; color: #cfc4ab; }
#nogl-err { font-size: 10px !important; color: #8f8271 !important; margin-top: 3px; word-break: break-word; }

#debug {
  position: fixed; top: 8px; right: 8px; z-index: 40;
  font: 11px/1.6 monospace; color: #0f0; background: rgba(0,0,0,.75);
  padding: 6px 9px; white-space: pre; pointer-events: none;
}

@media (max-width: 768px) {
  :root { --pad: 16px; }
  #masthead .title { letter-spacing: .22em; }
  #rail img { width: 34px; height: 23px; }
  #rail span { display: none; }
  #card { padding: 9px 12px; }
  #card .card-name { font-size: 15px; }
  #card .card-meta { display: none; }
  #hint { display: none; }
  #overlay { flex-direction: column; gap: 20px; padding: 60px 20px 30px; overflow-y: auto; }
  #overlay img { max-width: 92vw; max-height: 52vh; }
  #p-overlay { flex-direction: column; gap: 20px; padding: 60px 20px 30px; overflow-y: auto; }
  #p-overlay img { max-width: 92vw; max-height: 46vh; }
  .chapter-text { top: calc(var(--pad) + 48px); }
  .chapter-text h2 { font-size: clamp(30px, 8vw, 44px); }
  .chapter-text .body { display: none; }
  .p-card { flex-basis: 200px; }
  .p-card img { height: 120px; }
  .p-name { min-height: 36px; font-size: 12.5px; }
  .services { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .svc { padding: 10px; }
  .svc-name { font-size: 14px; }
  .svc-note { display: none; }
  #cart-btn { top: auto; bottom: var(--pad); right: var(--pad); }
}
