/* =========================================================
   Landing Hero: màn hình chào khi CHƯA đăng nhập (web/js/landing.js dựng & gỡ).
   Phong cách Vàng - Đen của CodeChalk. Mọi quy tắc nằm dưới .cc-landing-scope, keyframes đặt tiền tố cc-landing-.
   Ngoại lệ duy nhất: html.cc-landing-lock (chỉ bật khi landing đang hiện) để khoá cuộn
   và ẩn các khối nổi của app có z-index cao hơn landing (thanh điều hướng 200, nút góp ý 170, tour 160).
   ========================================================= */

html.cc-landing-lock { overflow: hidden; }
html.cc-landing-lock body > .skip,
html.cc-landing-lock #nav,
html.cc-landing-lock .fb-fab,
html.cc-landing-lock .tour,
html.cc-landing-lock .pf-notif { visibility: hidden; }

.cc-landing-scope {
  /* Một bộ font cho mọi chữ tiếng Việt: Be Vietnam Pro (CodeChalk đã nạp sẵn), không trộn nét giữa các font */
  --font-body: 'Be Vietnam Pro', 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'HelveticaNowDisplay-Medium', 'Bricolage Grotesque', 'Be Vietnam Pro', 'Helvetica Neue', Arial, sans-serif;
  --lp-black: #0E1412;
  --lp-deep: #0B0F0E;
  --lp-glass: rgba(14, 20, 18, .78);
  --lp-gold: #F2C44D;
  --lp-gold-deep: #D9A528;
  --lp-gold-soft: #F8D36E;
  --lp-gold-metal: #E5B33A;
  --lp-gold-line: rgba(242, 196, 77, .35);
  --lp-ink: #F0EFEA;
  --lp-text: #D0D7D4;
  --lp-muted: #B8C2BE;
  --lp-label: #9CA8A3;
  position: fixed;
  inset: 0;
  z-index: 110;                       /* dưới .toasts (120) và .modal (150): form đăng nhập hiện đè lên landing */
  overflow: hidden;
  color: var(--lp-ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  background: var(--lp-deep);
  opacity: 1;
  transition: opacity .3s ease;
}
.cc-landing-scope.is-leaving { opacity: 0; pointer-events: none; }
.cc-landing-scope *,
.cc-landing-scope *::before,
.cc-landing-scope *::after { box-sizing: border-box; }
.cc-landing-scope button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; letter-spacing: inherit; }
.cc-landing-scope svg { display: block; flex: none; }
.cc-landing-scope :focus-visible { outline: 2px solid var(--lp-gold); outline-offset: 3px; border-radius: 8px; }

/* ---------- nền: video (tua theo chuột) + nền dự phòng + lớp phủ trái giữ tương phản ---------- */
.cc-landing-scope .cc-landing__fallback {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 55% 60% at 74% 45%, rgba(242, 196, 77, .16), transparent 70%),
    linear-gradient(160deg, #1A2420 0%, #0E1412 55%, #0B0F0E 100%);
}
.cc-landing-scope .cc-landing__video {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 70% center;
  display: block; max-width: none; pointer-events: none;
  opacity: 0; transition: opacity .5s ease;
}
.cc-landing-scope .cc-landing__video.is-ready { opacity: 1; }
.cc-landing-scope .cc-landing__video.is-broken { display: none; }
.cc-landing-scope .cc-landing__scrim {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 15, 14, .88) 0%, rgba(11, 15, 14, .62) 48%, rgba(11, 15, 14, .12) 100%);
}
.cc-landing-scope .cc-landing__scrim::after {   /* dải tối mờ phía trên cho thanh điều hướng */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 140px;
  background: linear-gradient(180deg, rgba(11, 15, 14, .72), rgba(11, 15, 14, 0));
}

/* ---------- thanh điều hướng ---------- */
.cc-landing-scope .cc-landing__nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
}
.cc-landing-scope .cc-landing__left { display: flex; align-items: center; gap: 28px; min-width: 0; }
.cc-landing-scope .cc-landing__logo { display: flex; align-items: center; gap: 10px; color: var(--lp-ink); }
.cc-landing-scope .cc-landing__brand { font-family: var(--font-heading); font-size: 22px; line-height: 1; letter-spacing: -0.025em; font-weight: 600; white-space: nowrap; color: var(--lp-ink); }
.cc-landing-scope .cc-landing__star { font-size: 24px; line-height: 1; letter-spacing: -0.02em; user-select: none; -webkit-user-select: none; color: var(--lp-gold); }
.cc-landing-scope .cc-landing__about {
  display: none; position: relative; font-size: 15px; font-weight: 500; color: var(--lp-ink); padding: 6px 0; transition: color .2s ease;
}
.cc-landing-scope .cc-landing__about::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px; background: var(--lp-gold);
  transform: scaleX(0); transform-origin: left center; transition: transform .25s ease;
}
.cc-landing-scope .cc-landing__about:hover { color: var(--lp-gold); }
.cc-landing-scope .cc-landing__about:hover::after { transform: scaleX(1); }
.cc-landing-scope .cc-landing__actions { display: none; align-items: center; gap: 10px; }

/* nút dùng chung */
.cc-landing-scope .cc-landing__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; white-space: nowrap; line-height: 1.2;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.cc-landing-scope .cc-landing__btn:active { transform: translateY(1px); }
.cc-landing-scope .cc-landing__btn--ghost {        /* Sign In / Khám phá thử thách: kính tối viền vàng */
  background: rgba(14, 20, 18, .6); border: 1.5px solid var(--lp-gold); color: var(--lp-gold); font-weight: 600;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.cc-landing-scope .cc-landing__btn--ghost:hover { background: var(--lp-gold); color: var(--lp-black); }
.cc-landing-scope .cc-landing__btn--solid {        /* Sign Up / Bắt đầu luyện ngay: vàng đặc */
  background: var(--lp-gold); border: 1.5px solid var(--lp-gold); color: var(--lp-black); font-weight: 700;
}
.cc-landing-scope .cc-landing__btn--solid:hover { background: var(--lp-gold-soft); border-color: var(--lp-gold-soft); box-shadow: 0 6px 22px rgba(242, 196, 77, .35); }
.cc-landing-scope .cc-landing__btn--solid:active { background: var(--lp-gold-deep); border-color: var(--lp-gold-deep); }
.cc-landing-scope .cc-landing__btn--quiet {        /* Guest */
  background: transparent; border: 1px solid rgba(240, 239, 234, .25); color: var(--lp-ink); font-weight: 500;
}
.cc-landing-scope .cc-landing__btn--quiet:hover { border-color: var(--lp-gold); color: var(--lp-gold); }
.cc-landing-scope .cc-landing__btn--quiet svg { width: 14px; height: 14px; transition: transform .2s ease; }
.cc-landing-scope .cc-landing__btn--quiet:hover svg { transform: translateX(2px); }
.cc-landing-scope .cc-landing__actions .cc-landing__btn { font-size: 14px; padding: 9px 16px; }

/* hamburger + menu mobile */
.cc-landing-scope .cc-landing__burger {
  display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -10px; position: relative; z-index: 11;
}
.cc-landing-scope .cc-landing__burger span { display: block; width: 24px; height: 2px; border-radius: 1px; background: var(--lp-gold); transition: all .3s ease; transform-origin: center; }
.cc-landing-scope .cc-landing__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cc-landing-scope .cc-landing__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cc-landing-scope .cc-landing__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.cc-landing-scope .cc-landing__menu {
  position: fixed; inset: 0; z-index: 9;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 14px;
  padding: 96px 28px calc(40px + env(safe-area-inset-bottom, 0px));
  background: var(--lp-black);
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.cc-landing-scope .cc-landing__menu.is-open { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .3s ease, visibility 0s; }
.cc-landing-scope .cc-landing__menu .cc-landing__menu-about { font-size: 28px; font-weight: 600; color: var(--lp-ink); padding: 6px 0 18px; border-bottom: 1px solid var(--lp-gold-line); margin-bottom: 10px; }
.cc-landing-scope .cc-landing__menu .cc-landing__btn { font-size: 17px; padding: 14px 20px; width: 100%; }

/* ---------- hero ---------- */
.cc-landing-scope .cc-landing__hero {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 88px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
.cc-landing-scope .cc-landing__content { position: relative; z-index: 10; max-width: 580px; }
.cc-landing-scope .cc-landing__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--lp-glass); border: 1px solid var(--lp-gold-line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--lp-gold); font-size: 11px; font-weight: 600; letter-spacing: .08em; line-height: 1.3;
}
.cc-landing-scope .cc-landing__badge svg { width: 12px; height: 12px; }
.cc-landing-scope .cc-landing__title {
  margin: 18px 0 0; font-family: var(--font-body); font-weight: 700;
  font-size: clamp(34px, 4.6vw, 58px); line-height: 1.12; letter-spacing: -0.02em;
  text-wrap: balance;
}
.cc-landing-scope .cc-landing__title span { display: block; }
.cc-landing-scope .cc-landing__title .l1 { color: var(--lp-ink); }
.cc-landing-scope .cc-landing__title .l2 { color: var(--lp-gold); }
.cc-landing-scope .cc-landing__title .l3 { color: var(--lp-gold-metal); }
.cc-landing-scope .cc-landing__sub {
  margin: 16px 0 0; max-width: 500px;
  font-size: clamp(15px, 1.3vw, 18px); line-height: 1.6; color: var(--lp-text);
  text-wrap: pretty;
}
.cc-landing-scope .cc-landing__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.cc-landing-scope .cc-landing__cta .cc-landing__btn { font-size: 15px; padding: 13px 24px; }
.cc-landing-scope .cc-landing__cta .cc-landing__btn svg { width: 16px; height: 16px; }
.cc-landing-scope .cc-landing__cta .cc-landing__btn--ghost { background: rgba(14, 20, 18, .75); }
.cc-landing-scope .cc-landing__cta .cc-landing__btn--ghost:hover { background: var(--lp-gold); }
.cc-landing-scope .cc-landing__stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px; padding: 16px 0 0; border-top: 1px solid rgba(240, 239, 234, .12);
}
.cc-landing-scope .cc-landing__stat { padding: 0 8px; min-width: 0; }
.cc-landing-scope .cc-landing__stat:first-child { padding-left: 0; }
.cc-landing-scope .cc-landing__stat + .cc-landing__stat { border-left: 1px solid rgba(240, 239, 234, .12); }
.cc-landing-scope .cc-landing__stat-ic {
  width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(242, 196, 77, .14); color: var(--lp-gold); margin-bottom: 10px;
}
.cc-landing-scope .cc-landing__stat-ic svg { width: 19px; height: 19px; }
.cc-landing-scope .cc-landing__stat b { display: block; font-size: clamp(15px, 4.3vw, 20px); font-weight: 700; line-height: 1.15; color: var(--lp-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-landing-scope .cc-landing__stat small { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; color: var(--lp-label); }

/* xuất hiện lần lượt khi mount */
.cc-landing-scope [data-lp-in] { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.cc-landing-scope.is-in [data-lp-in] { opacity: 1; transform: translateY(0); }
.cc-landing-scope.is-in [data-lp-in="2"] { transition-delay: .06s; }
.cc-landing-scope.is-in [data-lp-in="3"] { transition-delay: .12s; }
.cc-landing-scope.is-in [data-lp-in="4"] { transition-delay: .18s; }
.cc-landing-scope.is-in [data-lp-in="5"] { transition-delay: .26s; }

@media (max-width: 767px) {
  /* điện thoại: nội dung ở dưới, phủ tối từ dưới lên để chữ luôn dễ đọc, nhân vật màn hình CRT vẫn lộ phía trên */
  .cc-landing-scope .cc-landing__scrim {
    background: linear-gradient(0deg, rgba(11, 15, 14, .94) 0%, rgba(11, 15, 14, .86) 45%, rgba(11, 15, 14, .25) 75%, rgba(11, 15, 14, .1) 100%);
  }
}
@media (max-width: 389px) {
  .cc-landing-scope .cc-landing__badge { font-size: 10px; letter-spacing: .05em; }
}
@media (min-width: 640px) {
  .cc-landing-scope .cc-landing__nav { padding: calc(18px + env(safe-area-inset-top, 0px)) 32px 18px; }
  .cc-landing-scope .cc-landing__hero { padding-left: 32px; padding-right: 32px; padding-bottom: 40px; }
  .cc-landing-scope .cc-landing__badge { font-size: 12px; }
  .cc-landing-scope .cc-landing__stat { padding: 0 12px; }
  .cc-landing-scope .cc-landing__stat:first-child { padding-left: 0; }
  .cc-landing-scope .cc-landing__stat-ic { width: 40px; height: 40px; }
  .cc-landing-scope .cc-landing__stat b { font-size: 24px; }
  .cc-landing-scope .cc-landing__stat small { font-size: 13px; }
}
@media (min-width: 768px) {
  .cc-landing-scope .cc-landing__about,
  .cc-landing-scope .cc-landing__actions { display: inline-flex; }
  .cc-landing-scope .cc-landing__burger,
  .cc-landing-scope .cc-landing__menu { display: none; }
  .cc-landing-scope .cc-landing__hero { justify-content: center; padding: 96px 48px 40px; }
}
@media (min-width: 1200px) {
  .cc-landing-scope .cc-landing__nav { padding-left: 56px; padding-right: 56px; }
  .cc-landing-scope .cc-landing__hero { padding-left: 72px; }
  .cc-landing-scope .cc-landing__stat b { font-size: 26px; }
}
@media (max-height: 640px) and (min-width: 768px) {
  .cc-landing-scope .cc-landing__stats { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-landing-scope,
  .cc-landing-scope [data-lp-in],
  .cc-landing-scope .cc-landing__menu,
  .cc-landing-scope .cc-landing__burger span,
  .cc-landing-scope .cc-landing__btn,
  .cc-landing-scope .cc-landing__video { transition: none; }
}
