/* =========================================================
   Chrysadore — khung chung (v8)
   · Thanh trên + menu phủ toàn màn (viết lại từ "Immersive Full Screen
     Navigation" trên 21st.dev: tấm màn kéo xuống bằng clip-path, chữ, ảnh,
     dòng địa chỉ hiện lần lượt, chữ cuộn từng ký tự khi rê chuột)
   · Hero quạt ảnh (viết lại từ "Centered Hero with Image Fan" trên 21st.dev)
   ========================================================= */

/* ---------- Thanh trên ---------- */
.glass-nav { display: none; }
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 36px);
  color: var(--ink);
  transition: translate .7s cubic-bezier(.2, .7, .1, 1), background-color .4s, color .4s, box-shadow .4s;
}
.topbar.nav-away { translate: 0 -110%; }
.topbar.tb-solid { background: rgba(244, 237, 224, .94); box-shadow: 0 10px 24px -20px rgba(28, 26, 23, .7); }
.topbar.on-dark { color: var(--paper); }
.topbar.on-dark.tb-solid { background: rgba(28, 26, 23, .92); }
.menu-open .topbar { color: var(--paper); background: transparent; box-shadow: none; translate: 0 0; }
.menu-open .topbar::after { opacity: 0; }

.tb-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.tb-brand img { width: 30px; height: 30px; border-radius: 7px; }
.tb-brand span { font-family: var(--f-display); font-weight: 600; font-size: 21px; letter-spacing: .01em; }
.tb-tools { display: flex; align-items: center; gap: 10px; }
.topbar .nav-fav { width: 40px; height: 40px; color: inherit; border-radius: 50%; display: grid; place-items: center; position: relative; transition: transform .3s var(--ease-pop); }
.topbar .nav-fav:hover { transform: scale(1.1); color: var(--rose); }
.topbar .nav-fav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar .nav-lang { color: inherit; border-color: currentColor; }
.topbar .nav-lang[data-on] span { color: inherit; }
.topbar .nav-lang[data-on="vi"] [data-l="vi"], .topbar .nav-lang[data-on="en"] [data-l="en"] { color: #fff; }

.tb-menu {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 18px 0 16px; border-radius: 999px;
  border: 0; cursor: pointer; font: 600 15px/1 var(--f-body); letter-spacing: .04em;
  background: var(--ink); color: var(--paper);
  transition: background-color .35s, color .35s, transform .3s var(--ease-pop);
}
.tb-menu:hover { transform: scale(1.04); }
.topbar.on-dark .tb-menu, .menu-open .tb-menu { background: var(--paper); color: var(--ink); }
.tb-lines { position: relative; width: 18px; height: 10px; }
.tb-lines i { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .5s cubic-bezier(.7, 0, .2, 1), top .5s cubic-bezier(.7, 0, .2, 1); }
.tb-lines i:first-child { top: 0; }
.tb-lines i:last-child { top: 8px; }
.menu-open .tb-lines i:first-child { top: 4px; transform: rotate(45deg); }
.menu-open .tb-lines i:last-child { top: 4px; transform: rotate(-45deg); }
.tb-word { position: relative; display: inline-grid; overflow: hidden; height: 1.2em; line-height: 1.2; }
.tb-word span { grid-area: 1 / 1; transition: transform .5s cubic-bezier(.7, 0, .2, 1); }
.tb-word span + span { transform: translateY(110%); }
.menu-open .tb-word span:first-child { transform: translateY(-110%); }
.menu-open .tb-word span + span { transform: none; }

/* ---------- Menu phủ toàn màn ---------- */
.menu {
  position: fixed; inset: 0; z-index: 75;
  background: var(--ink); color: var(--paper);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .85s cubic-bezier(.77, 0, .18, 1), visibility 0s linear .85s;
  overflow-y: auto; overscroll-behavior: contain;
}
.menu::before { content: ""; position: fixed; inset: 0; background-image: var(--noise); opacity: .45; mix-blend-mode: overlay; pointer-events: none; }
.menu-open .menu { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .85s cubic-bezier(.77, 0, .18, 1), visibility 0s; }
.menu-in {
  position: relative; min-height: 100%;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto; column-gap: clamp(24px, 5vw, 80px);
  padding: 110px clamp(20px, 5vw, 80px) 36px;
}
.menu-nav ul { list-style: none; margin: 0; padding: 0; }
.menu-nav li { padding: 6px 0 10px; border-bottom: 1px solid rgba(244, 237, 224, .14); }
.mn-link {
  display: inline-block; text-decoration: none; color: var(--paper);
  font-family: var(--f-display); font-weight: 400; font-size: clamp(2.3rem, 5vw, 4.6rem); line-height: 1.12;
  letter-spacing: -.015em;
}
.mn-link[aria-current] { color: var(--kraft); }
.mn-link:focus-visible { outline-offset: 6px; }
/* chữ cắt từng ký tự: mỗi ký tự mang bản sao ngay bên dưới, rê chuột thì cuộn lên */
.mn-roll { display: inline-block; overflow: hidden; padding: .14em 0 .06em; vertical-align: bottom; }
.mn-roll i { position: relative; display: inline-block; font-style: normal; white-space: pre; transition: transform .55s cubic-bezier(.7, 0, .2, 1); transition-delay: calc(var(--i) * 16ms); }
.mn-roll i::after { content: attr(data-c); position: absolute; left: 0; top: 118%; color: var(--kraft); font-style: italic; }
.mn-link:hover .mn-roll i, .mn-link:focus-visible .mn-roll i { transform: translateY(-118%); }
/* lúc mở menu: mỗi dòng trồi lên từ dưới mép */
.mn-lift { display: block; overflow: hidden; }
.mn-lift > * { display: inline-block; transform: translateY(105%); transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.menu-open .mn-lift > * { transform: none; transition-delay: calc(.32s + var(--n) * 70ms); }
.mn-sub { margin: 2px 0 4px; font-size: 18px; color: #d9cdb8; opacity: 0; transition: opacity .6s; }
.menu-open .mn-sub { opacity: 1; transition-delay: .7s; }
.mn-sub a { color: inherit; text-underline-offset: 4px; text-decoration-color: rgba(201, 168, 124, .6); }
.mn-sub a:hover { color: var(--kraft); }

.menu-pic {
  position: relative; align-self: center; justify-self: center; margin: 0;
  width: min(100%, 440px); aspect-ratio: 4 / 5;
  padding: 12px 12px 46px; background: var(--sheet); rotate: -3deg;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .85);
  clip-path: inset(100% 0 0 0); transition: clip-path 1s cubic-bezier(.77, 0, .18, 1);
}
.menu-open .menu-pic { clip-path: inset(-40px -40px -40px -40px); transition-delay: .45s; }
.menu-pic .tape { top: -12px; }
.menu-pic span:not(.tape) { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: var(--ink-2); }
.menu-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; scale: 1.08; filter: sepia(.18) saturate(.9); transition: opacity .6s, scale 1.2s cubic-bezier(.2, .8, .2, 1); }
.menu-pic img.on { opacity: 1; scale: 1; }
.menu-pic figcaption { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: var(--ink); font-size: 18px; }

.menu-foot {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px;
  padding-top: 28px; font-size: 15px; color: #cbbfa9;
  opacity: 0; translate: 0 12px; transition: opacity .6s, translate .6s;
}
.menu-open .menu-foot { opacity: 1; translate: 0 0; transition-delay: .8s; }
.menu-foot a { color: var(--paper); text-underline-offset: 4px; }
.menu-foot p { margin: 0; }

/* ---------- Hero quạt ảnh ---------- */
.fan-hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: max(100svh, 640px);
  padding: clamp(104px, 15vh, 150px) 0 0;
  text-align: center;
  display: flex; flex-direction: column;
}
.fan-hero .grain { opacity: .5; }
.fh-copy { position: relative; z-index: 4; width: var(--wrap); margin: 0 auto 40px; } /* 40px: khoảng tối thiểu tới quạt */
.fh-title {
  font-family: var(--f-display); font-weight: 500; line-height: .98; letter-spacing: -.03em;
  font-size: clamp(2.9rem, 6.6vw, 6rem); color: var(--ink); text-wrap: balance;
}
.fh-title em { font-style: italic; font-weight: 800; color: var(--rose); }
.fh-line { margin: 16px auto 0; font-size: clamp(17px, 1.5vw, 21px); color: var(--ink-2); max-width: 34ch; }

.fan {
  --spread: 1; --rise: 0px; --open: 1; --step: 9deg; --w: clamp(130px, min(15.5vw, 24vh), 236px); /* màn thấp thì thu quạt để không chạm chữ */
  --drop: .64; /* tấm rìa xoay quanh điểm thấp nên tụt xuống: chừa chỗ để khung không cắt ngang ảnh */
  position: relative; z-index: 2; width: 0; height: calc(var(--w) * 4 / 3 + 40px);
  align-self: center; flex: none;
  margin: auto 0 calc(var(--w) * var(--drop) + 28px); /* auto ở trên: quạt dồn xuống đáy khi màn còn dư chỗ */
}
.fan-card {
  position: absolute; top: 0; left: calc(var(--w) / -2); width: var(--w); margin: 0;
  transform-origin: 50% 400%;
  transform: translateY(var(--rise)) rotate(calc(var(--k) * var(--step) * var(--spread) * var(--open)));
  z-index: calc(10 - var(--d));
  transition: translate .45s cubic-bezier(.2, .8, .2, 1);
}
.fan-card a {
  display: block; padding: 8px 8px 34px; background: var(--sheet); text-decoration: none; color: var(--ink);
  box-shadow: 0 2px 3px rgba(28, 26, 23, .18), 0 24px 40px -22px rgba(28, 26, 23, .7);
}
.fan-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; filter: sepia(.22) saturate(.85); transition: filter .45s; }
.fan-card figcaption { position: absolute; left: 0; right: 0; bottom: 7px; font-size: 17px; line-height: 1.2; opacity: .75; transition: opacity .3s; }
.fan-card:hover, .fan-card:focus-within { translate: 0 -30px; }
.fan-card:hover img, .fan-card:focus-within img { filter: none; }
.fan-card a:focus-visible { outline-offset: 3px; }
@media (hover: hover) {
  .fan-card figcaption { opacity: 0; }
  .fan-card:hover figcaption, .fan-card:focus-within figcaption { opacity: .9; }
}

/* nút cuộn nằm dưới dòng chữ, không đè lên quạt ảnh */
.fh-cue {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 17px;
  padding: 7px 16px 7px 12px; border-radius: 99px; background: var(--sheet);
  box-shadow: 0 10px 24px -14px rgba(28, 26, 23, .6);
}
.fh-cue svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; animation: fh-bob 2.2s ease-in-out infinite; }
@keyframes fh-bob { 50% { transform: translateY(5px); } }

/* "70 đến 80%": chữ viết tay nhỏ thay cho dấu gạch dài giữa hai số */
.num-to {
  display: inline-block; font-size: .2em; font-weight: 400; letter-spacing: 0;
  vertical-align: middle; margin: 0 .3em; translate: 0 -.3em; opacity: .85;
}

/* thẻ "ba lời hứa" bay vào từ phải làm trang tràn ngang khi đang cuộn */
.promises { overflow-x: clip; }

/* ---------- Trang Chúng mình là ai ---------- */
.ch-head.cm-head .ch-strip img:nth-child(1) { object-position: 50% 20%; }
.cm-next { text-align: center; padding: 70px 0 90px; }
.cm-next .btn { margin: 0 6px 10px; }

/* ---------- Màn nhỏ ---------- */
@media (max-width: 900px) {
  .menu-in { grid-template-columns: 1fr; grid-template-rows: auto auto; padding-top: 96px; }
  .menu-pic { display: none; }
  .fan { --step: 11deg; --drop: .76; }
}
@media (max-width: 640px) {
  .tb-brand span { font-size: 18px; }
  .tb-menu { padding: 0 14px; height: 40px; }
  .tb-word { display: none; }
  .topbar .nav-fav { display: none; }
  .mn-link { font-size: clamp(2.1rem, 10.5vw, 3rem); }
  .menu-foot { flex-direction: column; justify-content: flex-start; align-self: end; }
  .fan-hero { min-height: min(100svh, 720px); }
  .fan { --w: 44vw; --step: 12deg; --drop: .44; }
  .fan-card { transform-origin: 50% 330%; }
  .fan-card.edge { display: none; }
  .fan-card a { padding: 6px 6px 26px; }
  .fan-card figcaption { font-size: 14px; bottom: 5px; }
  .fh-cue { margin-top: 14px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu, .menu-open .menu, .mn-lift > *, .menu-pic, .menu-foot, .mn-sub, .mn-roll i, .tb-lines i, .tb-word span, .fan-card { transition-duration: .01ms !important; transition-delay: 0s !important; }
  .fh-cue svg { animation: none; }
}
