/* ============================================================
   Thiên Cơ Đổi Vận — Landing (Cổ Phong theme)
   Palette lấy trực tiếp từ app: đỏ son + vàng kim trên nền maroon
   ============================================================ */

/* Font thương hiệu — chính file app đang dùng cho wordmark "Thiên Cơ Đổi Vận" */
@font-face {
  font-family: "Beau Rivage";
  src: url("../assets/fonts/beau-rivage-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Nền */
  --bg-0: #0a0505;
  --bg-1: #140a0a;
  --bg-2: #1c1010;
  --surface: #2b1616;
  --surface-high: #361e1b;
  --surface-hi: #452822;
  --line: rgba(242, 181, 68, 0.14);
  --line-strong: rgba(242, 181, 68, 0.32);

  /* Thương hiệu */
  --red: #e4543a;
  --red-deep: #7a1f16;
  --gold: #f2b544;
  --gold-bright: #ffe3aa;
  --gold-deep: #cb8e2b;

  /* Chữ */
  --ink: #f6ecd9;
  --ink-soft: #d8c2a4;
  --ink-mute: #a68b6f;

  /* Ngũ hành (accent feature) */
  --kim: #f2b544;
  --moc: #6fbf7a;
  --thuy: #4f8fd6;
  --hoa: #e4543a;
  --tho: #c88a3c;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.75);
  --shadow-gold: 0 20px 60px -20px rgba(242, 181, 68, 0.32);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;

  --font-display: "Playfair Display", "Noto Serif", Georgia, serif;
  --font-body: "Be Vietnam Pro", "Inter", system-ui, -apple-system, sans-serif;
  --font-brand: "Beau Rivage", "Playfair Display", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Nền huyền thuật xuyên suốt */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1000px 700px at 82% -8%, rgba(242, 181, 68, 0.10), transparent 60%),
    radial-gradient(900px 650px at 6% 12%, rgba(228, 84, 58, 0.12), transparent 58%),
    radial-gradient(1200px 900px at 50% 108%, rgba(122, 31, 22, 0.22), transparent 62%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(242, 181, 68, 0.25) 0.6px, transparent 0.7px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.gold {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold) 45%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.serif { font-family: var(--font-display); }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(16, 8, 8, 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo-mark {
  width: 38px; height: 38px; flex: none;
  border-radius: 11px; object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-strong), 0 6px 18px -8px rgba(242, 181, 68, 0.5);
}
.brand .brand-name {
  font-family: var(--font-brand);
  font-size: 1.62rem; font-weight: 400; line-height: 1;
  color: var(--gold-bright);
  padding-bottom: 2px; /* script font có phần chân chữ */
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 0.92rem; color: var(--ink-soft); transition: color 0.2s; }
.nav-links a:hover { color: var(--gold-bright); }
.nav-cta {
  padding: 9px 20px; border-radius: 999px;
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  color: #2b1616 !important; font-weight: 700; font-size: 0.9rem;
  box-shadow: 0 8px 22px -10px rgba(242, 181, 68, 0.7);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(242, 181, 68, 0.8); }
.nav-toggle { display: none; background: none; border: 0; color: var(--gold); font-size: 1.5rem; cursor: pointer; }

/* ============ HERO ============ */
.hero { position: relative; padding: 150px 0 90px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 40px; align-items: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(242, 181, 68, 0.06);
  color: var(--gold-bright); font-size: 0.82rem; font-weight: 500;
  margin-bottom: 24px;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--moc); box-shadow: 0 0 10px var(--moc); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.5px;
  margin-bottom: 22px;
}
.hero-sub { font-size: clamp(1rem, 1.6vw, 1.16rem); color: var(--ink-soft); max-width: 540px; margin-bottom: 34px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: 14px;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s, border-color 0.22s;
}
.btn-primary {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold) 40%, var(--gold-deep));
  color: #2b1616;
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 26px 60px -18px rgba(242, 181, 68, 0.55); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--gold-bright); }

.hero-stats { display: flex; align-items: center; gap: 26px; }
.stat .num { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--gold-bright); line-height: 1; }
.stat .lbl { font-size: 0.8rem; color: var(--ink-mute); }
.stat-sep { width: 1px; height: 38px; background: var(--line-strong); }

/* Hero visual — la bàn + điện thoại */
.hero-visual { position: relative; display: grid; place-items: center; min-height: 480px; }
.compass {
  position: absolute; width: 460px; height: 460px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--line);
}
.ring.r1 { width: 100%; height: 100%; border: 1px dashed var(--line-strong); animation: spin 60s linear infinite; }
.ring.r2 { width: 78%; height: 78%; border-width: 1px; animation: spin 42s linear infinite reverse; }
.ring.r3 { width: 56%; height: 56%; border: 1px dashed var(--line); animation: spin 30s linear infinite; }
.ring.glow { width: 90%; height: 90%; border: none; box-shadow: inset 0 0 90px rgba(242, 181, 68, 0.12); }
@keyframes spin { to { transform: rotate(360deg); } }
/* 8 quẻ trên vòng */
.trigram {
  position: absolute; top: 50%; left: 50%;
  font-size: 1.1rem; color: var(--gold); opacity: 0.7;
  transform-origin: 0 0;
}

.phone {
  position: relative; z-index: 2;
  width: 268px; border-radius: 38px;
  padding: 12px;
  background: linear-gradient(160deg, #3a221d, #160c0c);
  box-shadow: var(--shadow), 0 0 0 1px var(--line-strong);
}
.phone-screen {
  border-radius: 28px; overflow: hidden;
  background: linear-gradient(180deg, #1c0f0f, #120909);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 16px 14px 12px;
  min-height: 500px;
  display: flex; flex-direction: column; gap: 12px;
}
.ph-top { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; color: var(--ink-mute); }
.ph-brand { display: flex; align-items: center; gap: 6px; color: var(--gold-bright); font-weight: 600; }
.ph-date {
  text-align: center; padding: 16px 12px;
  border-radius: 16px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(242,181,68,0.12), transparent 70%), var(--surface);
  border: 1px solid var(--line);
}
.ph-weekday { font-size: 0.72rem; color: var(--ink-mute); letter-spacing: 2px; text-transform: uppercase; }
.ph-day { font-family: var(--font-display); font-size: 3rem; font-weight: 900; color: var(--gold-bright); line-height: 1; margin: 2px 0; }
.ph-month { font-size: 0.8rem; color: var(--ink-soft); }
.ph-lunar { font-size: 0.76rem; color: var(--gold); margin-top: 4px; }
.ph-card {
  border-radius: 14px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.ph-card-title { font-size: 0.78rem; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.ph-hours { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-hours span {
  font-size: 0.68rem; padding: 4px 8px; border-radius: 7px; font-weight: 600;
}
.ph-hours .g { background: rgba(111,191,122,0.16); color: var(--moc); }
.ph-hours .b { background: rgba(228,84,58,0.14); color: #f0917f; }
.ph-nav { margin-top: auto; display: flex; justify-content: space-around; padding-top: 8px; border-top: 1px solid var(--line); font-size: 1rem; }
.ph-nav span { opacity: 0.4; }
.ph-nav .on { opacity: 1; filter: drop-shadow(0 0 6px var(--gold)); }

.float-chip {
  position: absolute; z-index: 3;
  background: rgba(28, 16, 16, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 10px 13px;
  display: flex; align-items: center; gap: 9px;
  font-size: 0.8rem; box-shadow: var(--shadow);
  animation: floaty 5s ease-in-out infinite;
}
.float-chip .fi { font-size: 1.15rem; }
.float-chip small { color: var(--ink-mute); font-size: 0.68rem; display: block; }
.float-chip b { color: var(--gold-bright); font-weight: 700; }
.chip-1 { top: 34px; left: 0; animation-delay: 0s; }
.chip-2 { bottom: 48px; right: -6px; animation-delay: 1.5s; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }

/* ============ Section chung ============ */
.section { padding: 92px 0; position: relative; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 14px;
  padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px;
}
.section-head h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.15; letter-spacing: -0.4px; }
.section-head p { color: var(--ink-soft); margin-top: 16px; font-size: 1.05rem; }

/* ============ FEATURES ============ */
.feat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.feat {
  position: relative; overflow: hidden;
  padding: 26px 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), rgba(20,10,10,0.6));
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.feat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--acc, var(--gold)); opacity: 0.8;
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.feat:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.feat:hover::before { transform: scaleX(1); }
.feat.span2 { grid-column: span 2; }
.feat-ic {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.5rem; margin-bottom: 16px;
  background: color-mix(in srgb, var(--acc, var(--gold)) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc, var(--gold)) 30%, transparent);
}
.feat h3 { font-size: 1.12rem; margin-bottom: 8px; }
.feat p { font-size: 0.92rem; color: var(--ink-soft); }
.feat-tag {
  display: inline-block; margin-top: 14px; font-size: 0.72rem; font-weight: 600;
  color: var(--acc, var(--gold)); padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--acc, var(--gold)) 12%, transparent);
}

/* ============ SCREENSHOTS ============ */
.shots {
  display: flex; gap: 22px; overflow-x: auto; padding: 10px 4px 26px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent;
}
.shot { flex: 0 0 240px; scroll-snap-align: center; text-align: center; }
.shot-frame {
  border-radius: 28px; padding: 10px; margin-bottom: 16px;
  background: linear-gradient(160deg, #3a221d, #160c0c);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease);
}
.shot:hover .shot-frame { transform: translateY(-8px); }
.shot-frame img { border-radius: 20px; aspect-ratio: 9/19.5; object-fit: cover; width: 100%; background: var(--surface); }
.shot h4 { font-size: 1rem; margin-bottom: 4px; }
.shot p { font-size: 0.85rem; color: var(--ink-mute); }

/* ============ CANH GIỜ TIMELINE ============ */
.canhgio { background: linear-gradient(180deg, transparent, rgba(122,31,22,0.14), transparent); }
.cg-track {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px;
  max-width: 980px; margin: 0 auto;
}
.cg {
  text-align: center; padding: 16px 6px; border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.cg:hover { transform: translateY(-5px); border-color: var(--line-strong); }
.cg.good { background: linear-gradient(180deg, rgba(111,191,122,0.16), var(--surface)); border-color: rgba(111,191,122,0.4); }
.cg .zi { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--gold-bright); }
.cg .hr { font-size: 0.66rem; color: var(--ink-mute); margin-top: 3px; }
.cg .mk { font-size: 0.72rem; margin-top: 6px; font-weight: 700; }
.cg.good .mk { color: var(--moc); }
.cg .mk.x { color: #f0917f; }
.cg-legend { display: flex; justify-content: center; gap: 24px; margin-top: 24px; font-size: 0.85rem; color: var(--ink-soft); }
.cg-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ============ WHY / differentiators ============ */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.why-points { display: flex; flex-direction: column; gap: 22px; }
.why-pt { display: flex; gap: 16px; }
.why-pt .pi {
  flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.3rem; background: rgba(242,181,68,0.1); border: 1px solid var(--line-strong);
}
.why-pt h4 { font-size: 1.08rem; margin-bottom: 4px; }
.why-pt p { font-size: 0.93rem; color: var(--ink-soft); }
.why-visual { display: grid; place-items: center; min-height: 360px; position: relative; }
.seal {
  width: 300px; height: 300px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 40%, rgba(242,181,68,0.14), transparent 65%);
}
.seal .sring { position: absolute; border-radius: 50%; border: 1px solid var(--line-strong); }
.seal .s1 { inset: 0; border-style: dashed; animation: spin 50s linear infinite; }
.seal .s2 { inset: 34px; }
.seal .s3 { inset: 70px; border-style: dotted; animation: spin 26s linear infinite reverse; }
.seal .yin-big {
  width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center;
  font-size: 3.4rem; color: #2b1616;
  background: radial-gradient(circle at 36% 30%, var(--gold-bright), var(--gold-deep));
  box-shadow: 0 0 50px rgba(242,181,68,0.4);
}
.wuxing { position: absolute; font-size: 0.9rem; font-weight: 700; }
.wuxing.k { top: 4px; left: 50%; transform: translateX(-50%); color: var(--kim); }
.wuxing.m { top: 33%; right: 2px; color: var(--moc); }
.wuxing.t { bottom: 6px; right: 20%; color: var(--thuy); }
.wuxing.h { bottom: 6px; left: 20%; color: var(--hoa); }
.wuxing.o { top: 33%; left: 2px; color: var(--tho); }

/* ============ DOWNLOAD ============ */
.download { padding: 40px 0 100px; }
.dl-box {
  position: relative; overflow: hidden;
  text-align: center; padding: 64px 32px; border-radius: 28px;
  background: linear-gradient(160deg, var(--surface-high), var(--bg-1));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.dl-box::before {
  content: ""; position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,181,68,0.16), transparent 62%);
}
.dl-box > * { position: relative; }
.dl-box h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.2; }
.dl-box p { color: var(--ink-soft); max-width: 560px; margin: 18px auto 30px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 28px; border-radius: 14px;
  background: linear-gradient(120deg, var(--gold-bright), var(--gold) 40%, var(--gold-deep));
  color: #2b1616; box-shadow: var(--shadow-gold);
  transition: transform 0.22s var(--ease);
}
.store-btn:hover { transform: translateY(-3px); }
.store-btn svg { width: 30px; }
.store-btn small { display: block; font-size: 0.72rem; font-weight: 500; opacity: 0.85; }
.store-btn strong { font-size: 1.15rem; }
.dl-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin-top: 30px; }
.dl-links a { font-size: 0.88rem; color: var(--ink-soft); transition: color 0.2s; }
.dl-links a:hover { color: var(--gold-bright); }

/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--line); padding: 54px 0 34px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.footer-brand { max-width: 320px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { color: var(--ink-mute); font-size: 0.9rem; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 44px; }
.fcol h5 { font-size: 0.8rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.fcol a { display: block; color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 9px; transition: color 0.2s; }
.fcol a:hover { color: var(--gold-bright); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 22px; text-align: center; color: var(--ink-mute); font-size: 0.84rem; }

/* ============ Reveal on scroll ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-visual { order: -1; min-height: 420px; margin-bottom: 10px; }
  .compass { width: 380px; height: 380px; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .feat.span2 { grid-column: span 2; }
  .why-grid { grid-template-columns: 1fr; }
  .why-visual { order: -1; }
  .cg-track { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 620px) {
  .wrap { padding: 0 18px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: rgba(16,8,8,0.97); backdrop-filter: blur(14px);
    padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--line);
  }
  .nav-toggle { display: block; }
  .hero { padding-top: 120px; }
  .hero-stats { gap: 16px; }
  .stat .num { font-size: 1.4rem; }
  .feat-grid { grid-template-columns: 1fr; }
  .feat.span2 { grid-column: span 1; }
  .cg-track { grid-template-columns: repeat(4, 1fr); }
  .compass { width: 320px; height: 320px; }
  .phone { width: 232px; }
  .chip-1 { left: -8px; } .chip-2 { right: -8px; }
  .section { padding: 68px 0; }
  .footer-top { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
