/* =====================================================================
   Huading Child Theme — Custom Layer
   Homepage V2 (7 fixed sections) + Opening + Header + Reveal
   All custom code lives in the child theme; Astra / Core / Elementor
   are never modified.
   ===================================================================== */

/* ---------- 01 Design Tokens ---------- */
:root {
  --hd-blue: #0962A8;
  --hd-orange: #F39800;
  --hd-navy: #07141F;
  --hd-white: #FFFFFF;
  --hd-off-white: #F7F8F8;
  --hd-gray: #F0F2F3;
  --hd-text: #111820;
  --hd-text-secondary: #66717C;

  --hd-max-width: 1200px;
  --hd-radius: 16px;
  --hd-radius-lg: 20px;
  --hd-gap: clamp(28px, 4vw, 64px);
  --hd-section-pad: clamp(64px, 9vw, 140px);
  --hd-transition: 300ms cubic-bezier(.4, 0, .2, 1);

  --hd-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

/* ---------- 02 Global Typography ---------- */
body.hd-home {
  font-family: var(--hd-font);
  color: var(--hd-text);
  background: var(--hd-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hd-container {
  max-width: var(--hd-max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section-pad {
  padding: var(--hd-section-pad) 0;
}
.hd-eyebrow {
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--hd-blue);
  font-weight: 600;
  margin: 0 0 18px;
}
.hd-section-title {
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -.02em;
  font-weight: 600;
  color: var(--hd-navy);
  margin: 0 0 16px;
}
.hd-section-sub {
  font-size: clamp(15px, 1.4vw, 19px);
  color: var(--hd-text-secondary);
  max-width: 680px;
  margin: 0 0 48px;
  line-height: 1.6;
}
.hd-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform var(--hd-transition), background var(--hd-transition), color var(--hd-transition);
}
.hd-about-left .hd-btn {
  background: transparent;
  color: var(--hd-navy);
  border: 1.5px solid var(--hd-navy);
  margin-top: 28px;
}
.hd-about-left .hd-btn:hover { background: var(--hd-navy); color: #fff; }
.hd-btn-primary {
  background: var(--hd-orange);
  color: #fff;
  border: 1.5px solid var(--hd-orange);
}
.hd-btn-primary:hover { transform: translateY(-2px); }

/* ---------- 03 Header (Astra, transparent -> white on scroll) ---------- */
.hd-home .ast-masthead,
.hd-home .site-header,
.hd-home .ast-above-header {
  background: transparent !important;
  box-shadow: none !important;
}
.hd-home .ast-masthead .site-title a,
.hd-home .ast-masthead .site-logo-img,
.hd-home .ast-masthead .main-header-menu a,
.hd-home .ast-masthead .ast-mobile-menu-buttons a {
  color: #fff !important;
}
body.hd-scrolled.hd-home .ast-masthead {
  background: rgba(255, 255, 255, .88) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hd-gray);
}
body.hd-scrolled.hd-home .ast-masthead .site-title a,
body.hd-scrolled.hd-home .ast-masthead .main-header-menu a,
body.hd-scrolled.hd-home .ast-masthead .ast-mobile-menu-buttons a {
  color: var(--hd-text) !important;
}

/* ---------- 04 Opening Animation ---------- */
.hd-opening {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--hd-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1s cubic-bezier(.76, 0, .24, 1);
}
.hd-opening.is-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}
.hd-opening-inner { text-align: center; color: #fff; padding: 24px; }
.hd-opening-logo {
  font-size: clamp(40px, 7vw, 92px);
  font-weight: 600;
  letter-spacing: .12em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s ease, transform .6s ease;
}
.hd-opening-line {
  width: 0;
  height: 2px;
  background: var(--hd-blue);
  margin: 22px auto;
  transition: width .6s ease;
}
.hd-opening-sub {
  opacity: 0;
  transition: opacity .6s ease;
  font-size: clamp(12px, 1.4vw, 16px);
  letter-spacing: .24em;
  line-height: 2;
  color: rgba(255, 255, 255, .82);
}
.hd-opening.play .hd-opening-logo { opacity: 1; transform: none; }
.hd-opening.play .hd-opening-line { width: 160px; }
.hd-opening.play .hd-opening-sub { opacity: 1; }

/* ---------- 05 Hero ---------- */
.hd-hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  background: var(--hd-navy);
  overflow: hidden;
}
.hd-hero-track { position: absolute; inset: 0; }
.hd-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .9s ease;
}
.hd-hero-slide.is-active { opacity: 1; visibility: visible; }
.hd-hero-media { position: absolute; inset: 0; overflow: hidden; }
.hd-hero-img,
.hd-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hdHeroZoom 8s ease forwards;
}
@keyframes hdHeroZoom { from { transform: scale(1); } to { transform: scale(1.035); } }
.hd-hero-ph {
  width: 100%; height: 100%;
  background: radial-gradient(120% 120% at 70% 20%, #123450 0%, #07141F 60%);
}
.hd-hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7, 20, 31, .78) 0%, rgba(7, 20, 31, .15) 55%, rgba(7, 20, 31, .38) 100%);
}
.hd-hero-content {
  position: absolute;
  left: 0; bottom: 0;
  max-width: min(850px, 92%);
  padding: clamp(28px, 6vw, 84px);
  color: #fff;
  z-index: 2;
}
.hd-hero-eyebrow {
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  margin: 0 0 16px;
}
.hd-hero-title {
  font-size: clamp(40px, 6vw, 100px);
  line-height: 1.0;
  letter-spacing: -.02em;
  font-weight: 500;
  margin: 0 0 18px;
}
.hd-hero-sub {
  font-size: clamp(15px, 1.5vw, 20px);
  color: rgba(255, 255, 255, .86);
  max-width: 620px;
  margin: 0 0 28px;
  line-height: 1.5;
}
.hd-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  border-bottom: 2px solid var(--hd-orange);
  padding-bottom: 6px;
  text-decoration: none;
}
.hd-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px; height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background var(--hd-transition);
}
.hd-hero-nav:hover { background: rgba(255, 255, 255, .25); }
.hd-hero-prev { left: 24px; }
.hd-hero-next { right: 24px; }
.hd-hero-dots {
  position: absolute;
  bottom: 28px; right: 28px;
  z-index: 3;
  display: flex; gap: 10px;
}
.hd-hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .4);
  cursor: pointer;
  transition: background var(--hd-transition), transform var(--hd-transition);
}
.hd-hero-dot.is-active { background: #fff; transform: scale(1.2); }

/* ---------- 06 Vision (kept minimal / unused placeholder) ---------- */

/* ---------- 07 About ---------- */
.hd-about { background: var(--hd-off-white); }
.hd-about-grid {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: var(--hd-gap);
  align-items: center;
}
.hd-about-title {
  font-size: clamp(30px, 3.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--hd-navy);
  margin: 0 0 20px;
}
.hd-about-desc {
  color: var(--hd-text-secondary);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.7;
}
.hd-about-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 24px;
}
.hd-metric-num {
  font-size: clamp(40px, 4.5vw, 72px);
  font-weight: 600;
  color: var(--hd-navy);
  line-height: 1;
  letter-spacing: -.02em;
}
.hd-metric-suffix { color: var(--hd-blue); }
.hd-metric-label {
  margin-top: 10px;
  color: var(--hd-text-secondary);
  font-size: 14px;
  letter-spacing: .04em;
}

/* ---------- 08 Business ---------- */
.hd-core-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.hd-core-card {
  display: block;
  background: var(--hd-off-white);
  border-radius: var(--hd-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--hd-transition), box-shadow var(--hd-transition);
}
.hd-core-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(7, 20, 31, .08); }
.hd-core-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--hd-gray); }
.hd-core-img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; display: block; }
.hd-core-card:hover .hd-core-img { transform: scale(1.04); }
.hd-core-body { padding: 22px; }
.hd-core-name { font-size: 20px; font-weight: 600; color: var(--hd-navy); margin: 0 0 4px; }
.hd-core-cn { color: var(--hd-text-secondary); font-size: 13px; margin: 0 0 10px; }
.hd-core-desc { color: var(--hd-text-secondary); font-size: 14px; line-height: 1.6; margin: 0 0 14px; }
.hd-core-link, .hd-ext-link, .hd-cap-link {
  color: var(--hd-blue);
  font-weight: 600;
  font-size: 14px;
}
.hd-ext-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 28px;
}
.hd-ext-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-radius: var(--hd-radius-lg);
  overflow: hidden;
  background: var(--hd-navy);
  color: #fff;
  text-decoration: none;
  min-height: 300px;
  transition: transform var(--hd-transition);
}
.hd-ext-card:hover { transform: translateY(-4px); }
.hd-ext-media { overflow: hidden; background: #0b2236; }
.hd-ext-img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; display: block; }
.hd-ext-card:hover .hd-ext-img { transform: scale(1.04); }
.hd-ext-body { padding: 36px; display: flex; flex-direction: column; justify-content: center; }
.hd-ext-title { font-size: clamp(22px, 2vw, 30px); margin: 0 0 12px; }
.hd-ext-desc { color: rgba(255, 255, 255, .8); font-size: 14px; line-height: 1.6; margin: 0 0 16px; }

/* ---------- 09 Capabilities ---------- */
.hd-cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.hd-cap-card {
  display: block;
  background: #fff;
  border: 1px solid var(--hd-gray);
  border-radius: var(--hd-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--hd-transition), border-color var(--hd-transition);
}
.hd-cap-card:hover { transform: translateY(-4px); border-color: var(--hd-blue); }
.hd-cap-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--hd-gray); }
.hd-cap-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hd-cap-body { padding: 24px; }
.hd-cap-title { font-size: 20px; font-weight: 600; color: var(--hd-navy); margin: 0 0 6px; }
.hd-cap-sub { color: var(--hd-blue); font-size: 13px; margin: 0 0 10px; letter-spacing: .03em; }
.hd-cap-desc { color: var(--hd-text-secondary); font-size: 14px; line-height: 1.6; margin: 0 0 14px; }

/* ---------- 10 Global Projects (reserved) ---------- */
.hd-projects-track { min-height: 40px; }

/* ---------- 11 News ---------- */
.hd-news-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}
.hd-news-feature {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--hd-radius);
  overflow: hidden;
  background: var(--hd-off-white);
}
.hd-news-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.hd-news-body { padding: 26px; }
.hd-news-date { color: var(--hd-text-secondary); font-size: 13px; letter-spacing: .04em; margin: 0 0 8px; }
.hd-news-title { font-size: clamp(20px, 1.8vw, 28px); font-weight: 600; color: var(--hd-navy); margin: 0 0 10px; line-height: 1.2; }
.hd-news-excerpt { color: var(--hd-text-secondary); font-size: 14px; line-height: 1.6; margin: 0; }
.hd-news-list { display: flex; flex-direction: column; }
.hd-news-item { padding: 18px 0; border-top: 1px solid var(--hd-gray); text-decoration: none; color: inherit; }
.hd-news-item:last-child { border-bottom: 1px solid var(--hd-gray); }
.hd-news-title-sm { font-size: 17px; font-weight: 600; color: var(--hd-navy); margin: 6px 0 0; }
.hd-news-empty { color: var(--hd-text-secondary); }

/* ---------- 12 CTA ---------- */
.hd-cta { background: var(--hd-navy); color: #fff; text-align: center; }
.hd-cta-inner { max-width: 820px; margin: 0 auto; }
.hd-cta-title { font-size: clamp(30px, 3.6vw, 56px); line-height: 1.08; margin: 0 0 18px; }
.hd-cta-desc { color: rgba(255, 255, 255, .82); margin: 0 0 28px; }

/* ---------- 13 Free Content ---------- */
.hd-free-content { background: #fff; }

/* ---------- 14 Footer (Astra, untouched) ---------- */

/* ---------- 15 Animations (reveal) ---------- */
.js-reveal .hd-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
}
.js-reveal .hd-reveal.is-visible { opacity: 1; transform: none; }

/* ---------- 16 Responsive ---------- */
@media (max-width: 1024px) {
  .hd-about-grid { grid-template-columns: 1fr; gap: 40px; }
  .hd-core-grid { grid-template-columns: repeat(2, 1fr); }
  .hd-cap-grid { grid-template-columns: repeat(2, 1fr); }
  .hd-news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hd-core-grid,
  .hd-cap-grid,
  .hd-ext-grid { grid-template-columns: 1fr; }
  .hd-ext-card { grid-template-columns: 1fr; min-height: 0; }
  .hd-ext-media { aspect-ratio: 16 / 10; }
  .hd-hero-nav { display: none; }
  .hd-hero-dots { left: 28px; right: auto; }
  .hd-hero-content { max-width: 100%; }
}
@media (max-width: 390px) {
  .hd-container { padding: 0 18px; }
  .hd-about-right { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .js-reveal .hd-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hd-hero-img, .hd-hero-video { animation: none !important; }
  .hd-hero-slide { transition: opacity .2s ease !important; }
  .hd-core-img, .hd-ext-img, .hd-cap-img { transition: none !important; }
  .hd-opening { transition: opacity .2s ease !important; }
}
/* =========================================================
   Huading V2.1 — Hero / About / Business visual fixes
   (appended; safe to keep alongside the base layer)
   ========================================================= */

/* --- Hero: break out of Astra .ast-container, span full viewport --- */
body.hd-home { overflow-x: clip; }
.hd-hero {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

/* --- Hero text contrast on dark media (override Astra h1 color) --- */
.hd-hero-eyebrow { color: rgba(255, 255, 255, .72); }
.hd-hero-title   { color: #FFFFFF; }
.hd-hero-sub     { color: rgba(255, 255, 255, .82); }
.hd-hero-cta     { color: #ffffff; }

/* --- Hero fallback: clean deep-navy with a very subtle blue depth --- */
.hd-hero-ph {
  background:
    radial-gradient(140% 120% at 78% 18%, rgba(9, 98, 168, .26) 0%, rgba(9, 98, 168, 0) 46%),
    linear-gradient(135deg, #0b2236 0%, #07141F 62%);
}

/* --- Business / Extended placeholder media (no image set yet) --- */
.hd-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #e9eef3 0%, #d6e1ea 100%); }
.hd-ext-media .hd-ph { background: linear-gradient(135deg, #103150 0%, #0b2236 100%); }

/* --- About metrics: subtle top rule for structure (not a card border) --- */
.hd-metric { padding-top: 16px; border-top: 1px solid rgba(7, 20, 31, .10); }

/* --- Hero content stays contained inside the full-bleed background --- */
.hd-hero-content { max-width: min(850px, 92%); }
