/* base.css — nền tảng dùng chung mọi trang: chữ, nút, đầu trang + menu, chân trang, màn chuyển trang, hệ hiệu ứng.
   Màu chỉ lấy từ tokens.css. Spec: notes/spec/2026-10-28-huy-hung-website-v2.md */

/* ---------- nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: var(--fs-body); line-height: 1.65;
  font-kerning: normal; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, address { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
b, strong { font-weight: 600; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }
.dark :focus-visible, .site-head :focus-visible, .site-foot :focus-visible, .page-head :focus-visible { outline-color: var(--gold); }
.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 300; padding: 10px 16px; background: var(--gold); color: var(--night); font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
[id] { scroll-margin-top: calc(var(--head-h) + 16px); }
main p { text-wrap: pretty; }
/* khối chữ căn đều hai bên (2026-10-29, như bản in); tiêu đề, nhãn, con số, tên trong ô giữ căn trái */
.j, .lede, .lede-xl, .page-lede, .sec-sub, .stars li { text-align: justify; }

/* khối xanh: chữ chỉ trắng */
.dark { position: relative; isolation: isolate; background: var(--forest); color: var(--on-dark); }
.dark--night { background: var(--night); }
.tex { position: absolute; inset: 0; z-index: -1; background: url(../assets/img/nen-xanh-l.webp) center / cover; }
.sec { padding: var(--sec) 0; }
.sec--mist { background: var(--mist); }

/* ---------- chữ ---------- */
.sec-t {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h2);
  line-height: 1.06; letter-spacing: .004em; color: var(--forest); text-wrap: balance;
}
.sec-t--m { font-size: clamp(2.5rem, 1.7rem + 2.8vw, 4.25rem); }
.dark .sec-t { color: var(--on-dark); }
.sec-sub { margin-top: 14px; max-width: 44em; font-size: var(--fs-lede); font-weight: 300; color: var(--ink-2); }
.dark .sec-sub { color: var(--on-dark-2); }
.kick { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; font-size: 1rem; color: var(--bronze); }
.kick::before { content: ""; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; }
.dark .kick, .page-head .kick { color: var(--gold); }
.h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.3; color: var(--forest); }
.dark .h3 { color: var(--on-dark); }
.lede { font-size: var(--fs-lede); font-weight: 300; line-height: 1.55; }
.lede-xl { font-size: var(--fs-xl); font-weight: 300; line-height: 1.42; color: var(--forest); text-wrap: pretty; }
.lede-xl b { font-weight: 600; }
.dark .lede-xl { color: var(--on-dark); }
.num { font-family: var(--font-display); font-weight: 800; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }

.stars { display: grid; gap: 10px; }
.stars li { position: relative; padding-left: 26px; }
.stars li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 13px; height: 13px; background: var(--bronze);
  -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat;
}
.dark .stars li::before { background: var(--gold-light); }

/* ---------- nút: góc trên phải vát như lá cờ của logo; nền vàng quét từ trái khi rê ---------- */
.btn {
  --cut: 14px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; border: 0;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: color .35s var(--ease);
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.btn:hover::before { transform: scaleX(1); }
.btn:focus-visible { outline-offset: -6px; }
.btn--gold { background: var(--gold); color: var(--night); }
.btn--gold::before { background: var(--gold-light); }
.btn--line { color: var(--on-dark); background: color-mix(in srgb, var(--paper) 10%, transparent); box-shadow: inset 0 0 0 1px var(--rule-dark); }
.btn--line::before { background: var(--paper); }
.btn--line:hover { color: var(--forest); }
.btn--green { background: var(--forest); color: var(--on-dark); }
.btn--green::before { background: var(--night); }
.btn .ico { width: 18px; height: 18px; }

/* liên kết chữ có gạch vàng mọc dần */
.more {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 600; text-decoration: none; color: var(--forest);
  background: linear-gradient(var(--bronze), var(--bronze)) left bottom / 36px 2px no-repeat; transition: background-size .45s var(--ease);
}
.more:hover { background-size: 100% 2px; }
.dark .more, .page-head .more { color: var(--on-dark); background-image: linear-gradient(var(--gold), var(--gold)); }

/* ---------- màn chuyển trang: 6 thanh trồi lên phủ màn hình, ngôi sao ở giữa ---------- */
.curtain { position: fixed; inset: 0; z-index: 250; display: grid; grid-template-columns: repeat(6, 1fr); pointer-events: none; visibility: hidden; }
html.is-leaving .curtain, html.is-arriving .curtain { visibility: visible; }
.curtain i { background: var(--forest); transform: translateY(101%); box-shadow: inset 1px 0 0 color-mix(in srgb, var(--gold) 35%, transparent); }
.curtain-star { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; fill: var(--gold-light); opacity: 0; transform: scale(.2) rotate(-45deg); }
html.is-leaving .curtain { pointer-events: all; }
html.is-leaving .curtain i { transform: none; transition: transform .5s var(--ease) calc(var(--o) * 70ms); }
html.is-leaving .curtain-star { opacity: 1; transform: none; transition: opacity .3s .3s, transform .5s var(--ease) .25s; }
html.is-arriving .curtain i { transform: none; animation: curtain-up .75s var(--ease) calc(.1s + var(--o) * 70ms) forwards; }
html.is-arriving .curtain-star { opacity: 1; transform: none; animation: curtain-star .5s ease .05s forwards; }
@keyframes curtain-up { to { transform: translateY(-101%); } }
@keyframes curtain-star { to { opacity: 0; transform: scale(1.6); } }

/* ---------- đầu trang ---------- */
.site-head {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--head-h);
  display: flex; align-items: center; gap: clamp(16px, 2.6vw, 40px); padding: 0 var(--gutter);
  color: var(--on-dark); transition: transform .45s var(--ease);
}
/* nền ở ::before — backdrop-filter trên chính header làm menu position:fixed bám theo header */
.site-head::before { content: ""; position: absolute; inset: 0; z-index: -1; transition: background-color .35s, box-shadow .35s; }
.site-head.is-solid::before { background: color-mix(in srgb, var(--night) 95%, transparent); box-shadow: 0 1px 0 var(--rule-dark); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.site-head.is-hidden { transform: translateY(-100%); }
.brand { flex: none; display: block; }
.brand img { height: 56px; width: auto; }
.nav { display: flex; align-items: center; margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 34px); }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-link { position: relative; padding: 12px 0; font-size: .95rem; font-weight: 500; text-decoration: none; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-item:hover > .nav-link::after, .nav-item.is-current > .nav-link::after { transform: scaleX(1); }
.sub-btn { display: grid; place-items: center; width: 28px; height: 28px; margin-left: 2px; padding: 0; border: 0; background: none; cursor: pointer; }
.sub-btn .ico { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.nav-item.is-open .sub-btn .ico { transform: rotate(180deg); }
.nav-tel { display: none; }
.hotline {
  display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 8px 0;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: .02em; color: var(--gold-light); text-decoration: none;
}
.hotline .ico { width: 18px; height: 18px; }
.menu-btn { display: none; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--gold-grad); transform: scaleX(var(--p, 0)); transform-origin: left; }
.site-head:not(.is-solid) .progress { opacity: 0; }

/* menu thả xuống (máy tính) */
@media (min-width: 1025px) {
  .sub {
    position: absolute; top: calc(100% + 6px); left: -24px; min-width: 300px; padding: 14px; display: grid; gap: 2px;
    background: var(--night); box-shadow: 0 24px 50px -20px color-mix(in srgb, var(--night) 80%, transparent), inset 0 0 0 1px var(--rule-dark);
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s;
  }
  .sub::before { content: ""; position: absolute; inset: -14px 0 auto; height: 14px; }
  .nav-item:hover > .sub, .nav-item.is-open > .sub, .nav-item:focus-within > .sub { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s var(--ease); }
  .sub > a, .sub-all { padding: 10px 12px; font-size: .95rem; text-decoration: none; transition: background-color .2s; }
  .sub > a:hover, .sub-all:hover, .sub a[aria-current] { background: color-mix(in srgb, var(--paper) 8%, transparent); }
  .sub--mega { left: 50%; width: min(860px, 92vw); transform: translate(-50%, -8px); grid-template-columns: 1fr; padding: 18px; }
  .nav-item:hover > .sub--mega, .nav-item.is-open > .sub--mega, .nav-item:focus-within > .sub--mega { transform: translate(-50%, 0); }
  .sub-all { justify-self: start; font-weight: 600; color: var(--gold-light); }
  .sub-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
  .sub-cards a { display: grid; gap: 10px; padding: 8px; text-decoration: none; font-size: .88rem; line-height: 1.35; transition: background-color .2s; }
  .sub-cards a:hover, .sub-cards a[aria-current] { background: color-mix(in srgb, var(--paper) 8%, transparent); }
  .sub-cards img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s var(--ease); }
  .sub-cards a:hover img { transform: scale(1.05); }
  .sub-cards li { overflow: hidden; }
}

/* menu gọn (tablet, điện thoại) */
@media (max-width: 1024px) {
  :root { --head-h: 70px; }
  .hotline span { display: none; }
  .hotline { width: 44px; height: 44px; justify-content: center; margin-left: auto; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--rule-dark); }
  .js .menu-btn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer; }
  .menu-lines, .menu-lines::before, .menu-lines::after { display: block; width: 24px; height: 2px; background: currentColor; transition: transform .3s var(--ease), background-color .2s; }
  .menu-lines { position: relative; }
  .menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
  .menu-lines::before { top: -7px; } .menu-lines::after { top: 7px; }
  .menu-open .menu-lines { background: transparent; }
  .menu-open .menu-lines::before { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-lines::after { transform: translateY(-7px) rotate(-45deg); }
  .js .nav {
    position: fixed; inset: var(--head-h) 0 0; z-index: -1; margin: 0; padding: 12px var(--gutter) 48px; overflow-y: auto;
    flex-direction: column; align-items: stretch; background: var(--night);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transition: opacity .3s; }
  .menu-open .site-head::before { background: var(--night); }
  .menu-open body { overflow: hidden; }
  .js .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .js .nav-item { flex-wrap: wrap; border-bottom: 1px solid var(--rule-dark); }
  .js .nav-link { flex: 1; padding: 16px 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 1.5rem + 2.5vw, 2.6rem); line-height: 1.1; }
  .js .nav-link::after { display: none; }
  .js .nav-item.is-current > .nav-link { color: var(--gold-light); }
  .js .sub-btn { width: 48px; height: 48px; }
  .js .sub-btn .ico { width: 22px; height: 22px; }
  .js .sub { display: none; width: 100%; padding: 0 0 16px; }
  .js .nav-item.is-open > .sub { display: grid; gap: 2px; }
  .js .sub > a, .js .sub-all, .js .sub-cards a { display: block; padding: 10px 0 10px 16px; border-left: 2px solid var(--rule-dark); text-decoration: none; color: var(--on-dark-2); }
  .js .sub a[aria-current] { border-left-color: var(--gold); color: var(--on-dark); }
  .js .sub-cards img { display: none; }
  .js .nav-tel { display: flex; align-items: center; gap: 12px; margin-top: 28px; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--gold-light); text-decoration: none; }
  /* các mục menu trồi lên lần lượt khi mở */
  html.motion.menu-open .nav-item, html.motion.menu-open .nav-tel { animation: up .55s var(--ease) both; }
  html.motion.menu-open .nav-item:nth-child(2) { animation-delay: .05s; }
  html.motion.menu-open .nav-item:nth-child(3) { animation-delay: .1s; }
  html.motion.menu-open .nav-item:nth-child(4) { animation-delay: .15s; }
  html.motion.menu-open .nav-tel { animation-delay: .2s; }
  /* không có JS: menu là dòng cuộn ngang */
  html:not(.js) .site-head { position: absolute; flex-wrap: wrap; height: auto; padding-block: 10px; }
  html:not(.js) .nav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  html:not(.js) .sub, html:not(.js) .sub-btn { display: none; }
}

/* ---------- đầu trang con (mọi trang trừ trang chủ) ---------- */
.page-head {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end;
  min-height: clamp(460px, 74svh, 820px); padding: calc(var(--head-h) + 48px) 0 clamp(40px, 6vw, 80px);
  background: var(--night); color: var(--on-dark);
}
.page-head--short { min-height: clamp(380px, 56svh, 600px); }
.page-head-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.page-head-bg img { width: 100%; height: 100%; object-fit: cover; }
.page-head-bg--tex img { opacity: .95; }
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--night) 72%, transparent) 0, transparent 190px),
              linear-gradient(0deg, var(--shade) 0%, color-mix(in srgb, var(--night) 45%, transparent) 55%, color-mix(in srgb, var(--night) 25%, transparent) 100%);
}
.page-head-in { position: relative; display: grid; gap: 14px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .9rem; color: var(--on-dark-2); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.crumbs span[aria-hidden] { color: var(--gold); }
.page-t { max-width: 15em; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h2); line-height: 1.04; text-wrap: balance; }
.page-t--xl { font-size: clamp(3rem, 1.6rem + 6vw, 7.5rem); }
.page-lede { max-width: 40em; font-size: var(--fs-lede); font-weight: 300; color: var(--on-dark-2); }
.page-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 6px; color: var(--on-dark-2); }
.page-meta span { display: inline-flex; gap: 8px; align-items: flex-start; }
.page-meta .ico { margin-top: .3em; color: var(--gold); }

/* thanh mục con dính dưới đầu trang (trang Giới thiệu) */
.subnav { position: sticky; top: var(--head-h); z-index: 40; background: var(--paper); box-shadow: 0 1px 0 var(--line); transition: top .45s var(--ease); }
html.head-hidden .subnav { top: 0; }
.subnav ul { display: flex; gap: clamp(18px, 2.6vw, 36px); overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { position: relative; display: block; padding: 18px 0 16px; white-space: nowrap; font-size: .95rem; font-weight: 500; color: var(--ink-2); text-decoration: none; transition: color .2s; }
.subnav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold-grad); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.subnav a:hover, .subnav a.is-active { color: var(--forest); }
.subnav a.is-active::after { transform: scaleX(1); }

/* ---------- chân trang ---------- */
.site-foot { position: relative; padding: clamp(56px, 7vw, 96px) 0 28px; background: var(--night); color: var(--on-dark-2); font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) minmax(0, 3fr); gap: 40px clamp(28px, 4vw, 64px); }
.foot-brand img { height: 76px; width: auto; margin-bottom: 18px; }
.foot-org { font-weight: 600; color: var(--on-dark); }
.foot-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.foot-nav > div { display: grid; align-content: start; gap: 8px; }
.foot-nav a { text-decoration: none; line-height: 1.4; }
.foot-nav a:hover, .foot-contact a:hover, .foot-bottom a:hover { color: var(--gold-light); }
.foot-h { margin-bottom: 6px; font-weight: 700; color: var(--on-dark); }
.foot-contact { display: grid; align-content: start; gap: 14px; }
.foot-contact a, .foot-contact p { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; line-height: 1.45; }
.foot-contact .ico { margin-top: .2em; color: var(--gold); }
.foot-contact span { text-align: justify; }
/* chừa chỗ bên phải cho nút liên hệ + nút về đầu trang (ghim góc phải dưới) để link "Liên hệ" không bị che */
.foot-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: clamp(40px, 5vw, 64px); padding: 22px var(--fab-room) 0 0; border-top: 1px solid var(--rule-dark); font-size: .875rem; }
.foot-bottom a { text-decoration: none; }
.foot-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; font-size: 1.0625rem; font-weight: 600; color: var(--on-dark); box-shadow: inset 0 0 0 1px var(--gold); transition: background-color .3s, color .3s; }
.foot-cta .ico { width: 20px; height: 20px; color: var(--gold); }
.foot-bottom .foot-cta:hover { background: var(--gold); color: var(--night); }
.foot-cta:hover .ico { color: var(--night); }

/* nút liên hệ ghim góc phải dưới, nháy nhẹ; bấm mở hotline / email / trang liên hệ */
:root { --fab-x: clamp(14px, 2vw, 28px); --fab-h: 56px; --fab-room: 190px; }
.fab { position: fixed; right: var(--fab-x); bottom: var(--fab-x); z-index: 46; display: grid; justify-items: end; gap: 10px; }
[data-section="lien-he"] .fab { display: none; }
.fab-btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: var(--fab-h); padding: 0 24px 0 20px; border: 0; border-radius: 999px;
  background: var(--gold); color: var(--night); font: 600 1rem/1 var(--font-text); cursor: pointer;
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--night) 75%, transparent); transition: background-color .3s;
}
.fab-btn:hover, .fab.is-open .fab-btn { background: var(--gold-light); }
.fab-btn .ico { width: 22px; height: 22px; }
.fab-btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 var(--gold); pointer-events: none; }
html.motion .fab:not(.is-open) .fab-btn::before { animation: fab-ping 2.4s var(--ease) 1.5s infinite; }
@keyframes fab-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--gold) 0%, transparent); } }
.fab-panel {
  display: grid; min-width: 260px; padding: 8px; background: var(--night); box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--night) 80%, transparent);
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .35s var(--ease), visibility 0s .25s;
}
.fab.is-open .fab-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .35s var(--ease); }
.fab-panel a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: var(--on-dark); font-weight: 500; text-decoration: none; }
.fab-panel a:hover { background: var(--forest); }
.fab-panel .ico { width: 20px; height: 20px; color: var(--gold); }
@media (max-width: 640px) {
  :root { --fab-h: 52px; --fab-room: 0px; }
  .fab-btn { width: var(--fab-h); padding: 0; justify-content: center; }
  .fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .foot-bottom { padding-bottom: calc(var(--fab-h) * 2 + 24px); }
}

.to-top {
  position: fixed; right: var(--fab-x); bottom: calc(var(--fab-x) + var(--fab-h) + 12px); z-index: 45;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--night); color: var(--gold-light); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--night) 70%, transparent);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .3s, transform .4s var(--ease), visibility 0s .3s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .4s var(--ease); }
.to-top > .ico { position: relative; width: 20px; height: 20px; }
.to-top-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top-ring circle { fill: none; stroke: var(--gold); stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100); }
[data-section="lien-he"] .to-top { bottom: var(--fab-x); }

/* ---------- xem ảnh phóng to ---------- */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: color-mix(in srgb, var(--night) 96%, transparent); color: var(--on-dark); }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lb-fig { display: grid; justify-items: center; gap: 14px; max-width: calc(100vw - 140px); }
.lb-fig img { max-width: 100%; max-height: calc(100dvh - 140px); width: auto; object-fit: contain; }
.lb-cap { font-size: .95rem; color: var(--on-dark-2); text-align: center; }
.lb-count { position: absolute; left: 24px; top: 20px; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--gold-light); }
.lb-btn { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--paper) 10%, transparent); cursor: pointer; transition: background-color .2s; }
.lb-btn:hover { background: color-mix(in srgb, var(--paper) 20%, transparent); }
.lb-btn .ico { width: 24px; height: 24px; }
.lb-prev { left: 16px; top: 50%; margin-top: -26px; }
.lb-next { right: 16px; top: 50%; margin-top: -26px; }
.lb-close { right: 16px; top: 12px; }
html.motion .lightbox[open] .lb-fig img { animation: fade .4s ease both; }
@media (max-width: 640px) {
  .lb-fig { max-width: 100vw; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; margin: 0; }
  .lb-prev { left: calc(50% - 64px); } .lb-next { right: calc(50% - 64px); }
}

/* ---------- hệ hiệu ứng (chỉ khi html.motion: có JS và không giảm chuyển động) ---------- */
html.motion [data-reveal] { transition: opacity .9s var(--ease), transform 1s var(--ease), clip-path 1.2s var(--ease); transition-delay: var(--delay, 0s); }
html.motion [data-reveal="up"]:not(.is-in) { opacity: 0; transform: translateY(36px); }
html.motion [data-reveal="fade"]:not(.is-in) { opacity: 0; }
html.motion [data-reveal="mask"]:not(.is-in) { clip-path: inset(100% 0 0 0); }
html.motion [data-reveal="mask"].is-in { clip-path: inset(0 0 0 0); }
html.motion [data-reveal="title"] { clip-path: inset(-.5em -.3em -.25em -.3em); }
html.motion [data-reveal="title"] > span { display: block; transition: transform 1.1s var(--ease); transition-delay: var(--delay, 0s); }
html.motion [data-reveal="title"]:not(.is-in) > span { transform: translateY(115%); }
html.motion [data-stagger] > * { transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--delay, 0s); }
html.motion [data-stagger]:not(.is-in) > * { opacity: 0; transform: translateY(28px); }
[data-parallax] { will-change: transform; transform: translate3d(0, var(--py, 0px), 0) scale(1.14); }
html:not(.motion) [data-parallax] { transform: none; }

@keyframes up { from { transform: translateY(18px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
