/**
 * XuanHieu V2 — Cinematic Authority
 * Dark · amber · standalone homepage (no Foxiz chrome)
 */

:root {
  --xh-bg: #070a12;
  --xh-bg-2: #0e1524;
  --xh-bg-3: #141c2e;
  --xh-text: #f3f0ea;
  --xh-muted: rgba(243, 240, 234, 0.62);
  --xh-faint: rgba(243, 240, 234, 0.12);
  --xh-line: rgba(243, 240, 234, 0.1);
  --xh-amber: #f5b942;
  --xh-amber-2: #ffc95c;
  --xh-amber-soft: rgba(245, 185, 66, 0.14);
  --xh-max: 1160px;
  --xh-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --xh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --xh-r: 18px;
  --xh-r-lg: 28px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-xh-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

body.xh-home-v2 {
  margin: 0;
  min-height: 100vh;
  background: var(--xh-bg);
  color: var(--xh-text);
  font-family: var(--xh-font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.xh-home-v2 ::selection {
  background: var(--xh-amber-soft);
  color: var(--xh-text);
}

body.xh-home-v2 a {
  color: var(--xh-amber);
  text-underline-offset: 3px;
}

body.xh-home-v2 a:focus-visible,
body.xh-home-v2 button:focus-visible,
body.xh-home-v2 .v2-btn:focus-visible {
  outline: 2px solid var(--xh-amber);
  outline-offset: 3px;
}

/* Ambient mesh + noise */
.v2-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(245, 185, 66, 0.16), transparent 55%),
    radial-gradient(700px 480px at 90% 10%, rgba(56, 120, 255, 0.12), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, rgba(245, 185, 66, 0.06), transparent 55%),
    var(--xh-bg);
}
.v2-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.v2-wrap {
  width: min(100% - 2rem, var(--xh-max));
  margin-inline: auto;
}

/* —— Header —— */
.v2-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  transition: background 0.3s var(--xh-ease), border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
html.xh-scrolled .v2-nav {
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--xh-line);
}
.v2-nav__brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  gap: 0.05rem;
}
.v2-nav__name {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.03em;
}
.v2-nav__sub {
  font-size: 0.7rem;
  color: var(--xh-muted);
  letter-spacing: 0.04em;
}
.v2-nav__links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.v2-nav__links a:not(.v2-btn) {
  color: var(--xh-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.v2-nav__links a:not(.v2-btn):hover {
  color: var(--xh-text);
  background: rgba(255, 255, 255, 0.05);
}

/* —— Buttons —— */
.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.78rem 1.25rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--xh-ease), background 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.v2-btn:active {
  transform: translateY(1px);
}
.v2-btn--amber {
  background: var(--xh-amber);
  color: #0b0e14 !important;
  box-shadow: 0 0 0 1px rgba(245, 185, 66, 0.25), 0 12px 40px rgba(245, 185, 66, 0.18);
}
.v2-btn--amber:hover {
  background: var(--xh-amber-2);
  color: #0b0e14 !important;
  box-shadow: 0 16px 48px rgba(245, 185, 66, 0.28);
}
.v2-btn--ghost {
  background: transparent;
  color: var(--xh-text) !important;
  border-color: var(--xh-line);
}
.v2-btn--ghost:hover {
  border-color: rgba(245, 185, 66, 0.45);
  background: var(--xh-amber-soft);
  color: var(--xh-text) !important;
}
.v2-btn--sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.82rem;
}

/* —— Hero —— */
.v2-hero {
  padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(3rem, 8vw, 5.5rem);
  position: relative;
}
.v2-hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .v2-hero__grid {
    grid-template-columns: 1fr;
  }
  .v2-hero__visual {
    order: -1;
    max-width: 340px;
    margin: 0 auto;
  }
}
.v2-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--xh-amber);
  margin: 0 0 1rem;
}
.v2-kicker::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: var(--xh-amber);
  border-radius: 2px;
}
.v2-hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: var(--xh-text);
}
.v2-hero__role {
  margin: 0 0 1.15rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 500;
  color: var(--xh-amber);
  letter-spacing: -0.02em;
}
.v2-hero__sub {
  margin: 0 0 1.6rem;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--xh-muted);
}
.v2-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.75rem;
}
.v2-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.v2-metrics li {
  font-size: 0.84rem;
  color: var(--xh-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.v2-metrics li strong {
  color: var(--xh-text);
  font-weight: 650;
}
.v2-metrics li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--xh-amber);
  box-shadow: 0 0 12px var(--xh-amber);
}

/* Portrait cinematic */
.v2-portrait {
  position: relative;
}
.v2-portrait__ring {
  position: absolute;
  inset: -12%;
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  background: conic-gradient(from 180deg, rgba(245, 185, 66, 0.35), transparent 40%, rgba(80, 140, 255, 0.25), transparent 75%, rgba(245, 185, 66, 0.3));
  filter: blur(28px);
  opacity: 0.85;
  animation: v2-spin 18s linear infinite;
  z-index: 0;
}
@keyframes v2-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .v2-portrait__ring {
    animation: none;
  }
}
.v2-portrait__frame {
  position: relative;
  z-index: 1;
  border-radius: var(--xh-r-lg);
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  background: var(--xh-bg-2);
}
.v2-portrait__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.v2-portrait__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(7, 10, 18, 0.75) 100%);
  pointer-events: none;
}
.v2-portrait__cap {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1rem;
  z-index: 2;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(243, 240, 234, 0.9);
}

/* —— Sections —— */
.v2-section {
  padding: clamp(3.2rem, 7vw, 5.5rem) 0;
}
.v2-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.v2-h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.v2-lede {
  margin: 0;
  max-width: 36rem;
  color: var(--xh-muted);
  font-size: 0.98rem;
  line-height: 1.65;
}
.v2-link {
  color: var(--xh-amber) !important;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
}
.v2-link:hover {
  text-decoration: underline !important;
}

/* Proof rail */
.v2-proof {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}
@media (max-width: 800px) {
  .v2-proof {
    grid-template-columns: repeat(2, 1fr);
  }
}
.v2-proof__item {
  padding: 1.15rem 1.1rem;
  border-radius: var(--xh-r);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--xh-line);
  backdrop-filter: blur(8px);
}
.v2-proof__num {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--xh-amber);
  margin-bottom: 0.25rem;
}
.v2-proof__label {
  font-size: 0.84rem;
  color: var(--xh-muted);
  line-height: 1.4;
}

/* Asymmetric bento */
.v2-bento {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.9rem;
}
.v2-bento__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 200px;
  padding: 1.4rem 1.35rem;
  border-radius: var(--xh-r);
  text-decoration: none !important;
  color: inherit !important;
  border: 1px solid var(--xh-line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  overflow: hidden;
  transition: transform 0.35s var(--xh-ease), border-color 0.25s, box-shadow 0.35s;
}
.v2-bento__card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 185, 66, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.v2-bento__card--lg {
  grid-row: span 2;
  min-height: 420px;
  background:
    radial-gradient(500px 280px at 80% 20%, rgba(245, 185, 66, 0.18), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}
@media (max-width: 800px) {
  .v2-bento {
    grid-template-columns: 1fr;
  }
  .v2-bento__card--lg {
    grid-row: auto;
    min-height: 260px;
  }
}
.v2-bento__tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--xh-amber);
  margin-bottom: 0.5rem;
}
.v2-bento__title {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.v2-bento__card--lg .v2-bento__title {
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
}
.v2-bento__desc {
  margin: 0;
  color: var(--xh-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 28rem;
}
.v2-bento__go {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--xh-amber);
}

/* Featured mosaic */
.v2-mosaic {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0.9rem;
}
@media (max-width: 800px) {
  .v2-mosaic {
    grid-template-columns: 1fr;
  }
}
.v2-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--xh-r);
  overflow: hidden;
  border: 1px solid var(--xh-line);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none !important;
  color: inherit !important;
  transition: transform 0.35s var(--xh-ease), border-color 0.25s;
}
.v2-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 185, 66, 0.3);
}
.v2-card__media {
  aspect-ratio: 16 / 10;
  background: var(--xh-bg-3);
  overflow: hidden;
}
.v2-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--xh-ease);
}
.v2-card:hover .v2-card__media img {
  transform: scale(1.04);
}
.v2-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.v2-chip {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--xh-amber);
}
.v2-card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.v2-card--hero .v2-card__title {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}
.v2-card__meta {
  margin-top: auto;
  padding-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--xh-muted);
}
.v2-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.v2-card--row {
  flex-direction: row;
  min-height: 110px;
}
.v2-card--row .v2-card__media {
  width: 38%;
  aspect-ratio: auto;
  min-height: 100%;
}
.v2-card--row .v2-card__body {
  width: 62%;
}
@media (max-width: 520px) {
  .v2-card--row {
    flex-direction: column;
  }
  .v2-card--row .v2-card__media {
    width: 100%;
    aspect-ratio: 16 / 10;
  }
  .v2-card--row .v2-card__body {
    width: 100%;
  }
}

/* Services numbered */
.v2-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
@media (max-width: 800px) {
  .v2-services {
    grid-template-columns: 1fr;
  }
}
.v2-svc {
  padding: 1.45rem 1.3rem;
  border-radius: var(--xh-r);
  border: 1px solid var(--xh-line);
  background: rgba(255, 255, 255, 0.03);
}
.v2-svc__n {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--xh-amber);
  margin-bottom: 0.65rem;
}
.v2-svc h3 {
  margin: 0 0 0.45rem;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
}
.v2-svc p {
  margin: 0;
  color: var(--xh-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Latest 3 */
.v2-latest {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
@media (max-width: 800px) {
  .v2-latest {
    grid-template-columns: 1fr;
  }
}

/* Community band */
.v2-band {
  border-radius: var(--xh-r-lg);
  border: 1px solid rgba(245, 185, 66, 0.22);
  background:
    radial-gradient(500px 200px at 0% 50%, rgba(245, 185, 66, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.03);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
}

/* FAQ */
.v2-faq {
  display: grid;
  gap: 0.65rem;
  max-width: 44rem;
}
.v2-faq details {
  border: 1px solid var(--xh-line);
  border-radius: var(--xh-r);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.95rem 1.15rem;
}
.v2-faq summary {
  cursor: pointer;
  font-weight: 650;
  letter-spacing: -0.015em;
  list-style: none;
}
.v2-faq summary::-webkit-details-marker {
  display: none;
}
.v2-faq details[open] summary {
  color: var(--xh-amber);
  margin-bottom: 0.45rem;
}
.v2-faq p {
  margin: 0;
  color: var(--xh-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.v2-faq a {
  color: var(--xh-amber);
}

/* Footer */
.v2-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--xh-line);
  margin-top: 1rem;
}
.v2-footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: start;
}
.v2-footer p {
  margin: 0.25rem 0;
  color: var(--xh-muted);
  font-size: 0.86rem;
}
.v2-footer a {
  color: var(--xh-muted);
  text-decoration: none;
}
.v2-footer a:hover {
  color: var(--xh-amber);
}
.v2-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  font-size: 0.86rem;
}

/* Reveal */
[data-xh-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--xh-ease), transform 0.5s var(--xh-ease);
  transition-delay: var(--xh-delay, 0ms);
}
[data-xh-reveal].xh-in {
  opacity: 1;
  transform: none;
}

/* Admin bar offset */
body.admin-bar .v2-nav {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .v2-nav {
    top: 46px;
  }
}
