/* Huafei Power — enterprise visual refinement
   Direction: authority, precision, global engineering, restrained technology. */
:root {
  --hf-navy-950: #071d2e;
  --hf-navy-900: #0b2b43;
  --hf-navy-800: #123f61;
  --hf-blue-700: #0c5f91;
  --hf-blue-500: #2d86b5;
  --hf-cyan-400: #62c6e7;
  --hf-red-600: #bd1f2d;
  --hf-ink: #102b40;
  --hf-muted: #5e7282;
  --hf-line: #dbe5ea;
  --hf-surface: #ffffff;
  --hf-surface-soft: #f3f7f9;
  --hf-shadow: 0 22px 60px rgba(7, 35, 53, .10);
}

html { scroll-behavior: smooth; }
body {
  color: var(--hf-ink);
  background: var(--hf-surface);
  font-family: "DM Sans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { width: min(1280px, calc(100% - 80px)); }
html, body { max-width: 100%; overflow-x: clip; }
img, svg, object { max-width: 100%; }
main, section, footer { min-width: 0; }
.two-col > *, .global-layout > *, .capability-layout > *,
.section-heading > *, .partners-heading > *, .footer-main > * { min-width: 0; }
.skip-link {
  position: fixed;
  z-index: 1000;
  left: 20px;
  top: -60px;
  padding: 12px 18px;
  color: #fff;
  background: var(--hf-blue-700);
  border-radius: 2px;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  height: 76px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid rgba(196, 211, 219, .78);
  box-shadow: 0 8px 30px rgba(7, 37, 57, .055);
  backdrop-filter: blur(14px);
}
.site-header .nav-wrap { height: 76px; }
.brand-mark-link { min-height: 76px; }
.brand-mark-link > img { width: 42px; height: 42px; }
.site-header .nav-links { gap: clamp(22px, 2.25vw, 38px); color: #3f5667; }
.site-header .nav-links a {
  position: relative;
  padding: 29px 0 26px;
  border: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .03em;
  white-space: nowrap;
}
.site-header .nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  height: 3px;
  background: var(--hf-blue-700);
  transition: left .22s ease, right .22s ease;
}
.site-header .nav-links a:hover::after,
.site-header .nav-links a.active::after { left: 0; right: 0; }
.site-header .nav-links a:hover,
.site-header .nav-links a.active { color: var(--hf-blue-700); }

.lang-switch {
  min-width: 76px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--hf-ink) !important;
  background: transparent;
  border: 1px solid var(--hf-line);
  border-radius: 2px;
  cursor: pointer;
  font: 600 12px/1 "DM Sans", "Noto Sans SC", sans-serif;
  letter-spacing: .04em;
  transition: border-color .2s ease, background .2s ease;
}
.lang-switch:hover { background: var(--hf-surface-soft); border-color: #abc3cf; }
.lang-divider { margin: 0 5px; color: #9aabb5; }
html[data-language="zh"] .lang-option-zh,
html[data-language="en"] .lang-option-en { color: var(--hf-blue-700); }
html[data-language="zh"] .lang-option-en,
html[data-language="en"] .lang-option-zh { color: #9aabb5; font-weight: 400; }
.menu-toggle { min-width: 44px; min-height: 44px; }
.menu-icon { display: grid; width: 22px; gap: 5px; }
.menu-icon i { display: block; height: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] .menu-icon i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-icon i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Shared hierarchy */
.section { padding: 102px 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .25em; }
.eyebrow span { width: 34px; height: 2px; }
.section-intro h2,
.section-heading h2,
.global-section h2,
.capability-content h2,
.partners-heading h2,
.contact-section h2 {
  font-size: clamp(36px, 3.6vw, 54px);
  line-height: 1.18;
  letter-spacing: -.045em;
  font-weight: 560;
}
.lead, .section-heading > p, .partners-heading > p {
  color: var(--hf-muted);
  font-size: 17px;
  line-height: 2;
}
.button {
  min-height: 54px;
  padding: 0 28px;
  border-radius: 1px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button-primary { background: var(--hf-red-600); border-color: var(--hf-red-600); }
.button-primary:hover { background: #a61925; box-shadow: 0 12px 30px rgba(189, 31, 45, .24); transform: translateY(-2px); }
.text-link { font-weight: 600; }

/* Hero */
.hero {
  min-height: 720px;
  background:
    linear-gradient(90deg, rgba(4, 20, 33, .30) 1px, transparent 1px),
    linear-gradient(rgba(4, 20, 33, .25) 1px, transparent 1px),
    radial-gradient(circle at 78% 35%, rgba(65, 174, 217, .30), transparent 25%),
    radial-gradient(circle at 88% 80%, rgba(19, 104, 154, .36), transparent 34%),
    linear-gradient(118deg, var(--hf-navy-950) 0%, #0b3556 54%, #165a81 100%);
  background-size: 88px 88px, 88px 88px, auto, auto, auto;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 17, 28, .7), transparent 68%);
  pointer-events: none;
}
.hero-content { padding-top: 180px; }
.hero h1 { max-width: 980px; font-size: clamp(46px, 4.2vw, 62px); line-height: 1.12; }
.hero h1 em { color: #bfe7f3; font-size: .68em; letter-spacing: -.035em; }
.hero-desc { max-width: 650px; font-size: 17px; line-height: 1.9; color: rgba(236, 246, 249, .82); }
.hero-actions { margin-top: 34px; }
.hero-meta { margin-top: 66px; color: rgba(226, 241, 246, .72); }

/* Metrics */
.stats-section {
  width: min(1280px, calc(100% - 80px));
  margin-top: -72px;
  border: 0;
  box-shadow: var(--hf-shadow);
}
.stats-grid { padding: 36px 24px; }
.stat { min-height: 94px; padding: 0 42px; }
.stat strong { color: var(--hf-blue-700); font-size: clamp(40px, 3.6vw, 54px); font-variant-numeric: tabular-nums; }
.stat p { max-width: 220px; line-height: 1.55; }

/* About */
.about-section { padding-top: 126px; }
.about-layout { gap: clamp(60px, 8vw, 130px); }
.about-story { border-left-color: #cfdce2; }
.story-line { min-height: 74px; }
.story-line > span { color: #8094a2; font-weight: 700; font-variant-numeric: tabular-nums; }
.story-line.current > span { color: var(--hf-red-600); }

/* Services */
.services-section { background: var(--hf-surface-soft); }
.section-heading { margin-bottom: 54px; }
.service-grid { gap: 12px; background: transparent; }
.service-card {
  min-height: 390px;
  padding: 34px 30px 30px;
  border: 1px solid #e1e9ed;
  border-top: 3px solid #d7e4ea;
  box-shadow: 0 1px 0 rgba(7, 35, 53, .02);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.service-card:hover { transform: translateY(-6px); border-top-color: var(--hf-red-600); box-shadow: 0 18px 42px rgba(12, 49, 72, .09); }
.service-card.featured { background: var(--hf-navy-900); border-color: var(--hf-navy-900); }
.service-card h3 { font-size: 21px; line-height: 1.45; }
.service-card p { color: var(--hf-muted); line-height: 1.85; }
.service-card.featured p { color: rgba(225, 239, 245, .72); }
.service-icon { width: 38px; height: 38px; margin-bottom: 30px; }
.service-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.card-number { font-weight: 700; letter-spacing: .08em; }

/* Global map */
.global-section {
  padding: 126px 0 110px;
  background:
    radial-gradient(circle at 74% 48%, rgba(47, 135, 176, .20), transparent 35%),
    linear-gradient(120deg, #09263b, #123f5d 70%, #164966);
}
.global-layout {
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1.32fr);
  gap: clamp(36px, 4vw, 68px);
}
.global-copy { color: rgba(228, 241, 246, .76); font-size: 16px; line-height: 1.95; }
.world-visual { min-width: 0; min-height: 540px; overflow: hidden; }
.world-svg,
.country-highlight-object { max-width: 100%; }
.world-visual .map-pin { font-size: 15px; }
.map-country-summary { color: rgba(222, 239, 245, .66); font-size: 11px; }

/* Expertise */
.capability-section { background: var(--hf-surface-soft); }
.capability-layout { gap: clamp(60px, 8vw, 130px); }
.capability-art {
  overflow: hidden;
  background:
    linear-gradient(rgba(20, 75, 105, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 75, 105, .055) 1px, transparent 1px),
    #eaf1f4;
  background-size: 34px 34px;
  box-shadow: inset 0 0 0 1px rgba(76, 117, 139, .08);
}
.capability-core {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  display: flex;
  width: 142px;
  height: 142px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--hf-navy-900);
  border: 1px solid rgba(107, 203, 232, .54);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(21, 90, 128, .07), 0 18px 40px rgba(10, 46, 70, .22);
  transform: translate(-50%, -50%);
}
.capability-core strong { font: 600 35px/1 "DM Sans", sans-serif; letter-spacing: .08em; }
.capability-core span { margin-top: 9px; color: #8dd4eb; font: 600 10px/1 "DM Sans", sans-serif; letter-spacing: .12em; }
.capability-list > div { border-color: #d5e1e6; }

/* Partners */
.partners-section { background: #fff; }
.partners-heading { margin-bottom: 52px; }
.partner-logo { border: 0 !important; box-shadow: none; transition: background .2s ease, transform .2s ease; }
.partner-logo:hover { background: var(--hf-surface-soft); transform: translateY(-3px); }

/* Careers and footer */
.contact-section {
  padding: 108px 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(115deg, var(--hf-navy-900), #15506f);
  background-size: 88px 88px, auto;
}
.contact-section h2 em { color: var(--hf-cyan-400); }
.contact-section .contact-copy { max-width: 820px; font-size: 16px; }
.contact-section .recruitment-focus { max-width: 900px; font-size: 14px; }
footer { background: var(--hf-navy-950); }
.footer-main { padding-top: 54px; padding-bottom: 42px; }
.footer-bottom { min-height: 66px; }

/* Accessibility */
a:focus-visible, button:focus-visible, object:focus-visible {
  outline: 3px solid #69cbe8;
  outline-offset: 4px;
}

/* English copy needs a little more horizontal room and tighter type. */
html[data-language="en"] .hero h1 { max-width: 1060px; font-size: clamp(41px, 3.7vw, 58px); }
html[data-language="en"] .hero h1 em { font-size: .68em; white-space: normal; }
html[data-language="en"] .service-card { padding-left: 25px; padding-right: 25px; }
html[data-language="en"] .service-card h3 { font-size: 19px; }
html[data-language="en"] .site-header .nav-links { gap: clamp(16px, 1.8vw, 30px); }

@media (max-width: 1180px) {
  .container { width: min(calc(100% - 56px), 1080px); }
  .stats-section { width: calc(100% - 56px); }
  .service-card { min-height: 350px; }
  html[data-language="en"] .site-header .nav-links a { font-size: 12px; }
}

/* Fold the navigation before it can force medium desktop widths to overflow. */
@media (max-width: 1080px) {
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .site-header .nav-links { display: none; }
  .site-header .nav-links.open {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 12px 28px 22px;
    background: rgba(255, 255, 255, .985);
    border-bottom: 1px solid var(--hf-line);
    box-shadow: 0 18px 35px rgba(7, 35, 53, .11);
  }
  .site-header .nav-links.open a { min-height: 46px; padding: 14px 2px 12px; }
  .site-header .nav-links.open .lang-switch { width: 100%; margin: 8px 0 0; }
  .global-layout { grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: 28px; }
  .world-visual { min-height: 470px; }
}

@media (max-width: 850px) {
  .container { width: calc(100% - 40px); }
  .site-header, .site-header .nav-wrap { height: 68px; }
  .site-header .nav-links.open {
    top: 68px;
    padding: 12px 20px 20px;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid var(--hf-line);
    box-shadow: 0 18px 35px rgba(7, 35, 53, .11);
  }
  .site-header .nav-links a { min-height: 46px; padding: 14px 2px 12px; }
  .lang-switch { width: 100%; margin-top: 8px; }
  .hero { min-height: 720px; background-size: 64px 64px, 64px 64px, auto, auto, auto; }
  .hero-content { padding-top: 150px; }
  .hero h1 { font-size: clamp(40px, 10vw, 58px); }
  .hero h1 em { font-size: .58em; white-space: normal; }
  .hero-meta { margin-top: 42px; }
  .stats-section { width: calc(100% - 38px); }
  .stats-grid { padding: 18px 0; }
  .stat { min-height: 84px; padding: 18px 24px; }
  .section, .about-section, .global-section { padding: 78px 0; }
  .section-intro h2, .section-heading h2, .global-section h2,
  .capability-content h2, .partners-heading h2, .contact-section h2 { font-size: clamp(34px, 8.5vw, 48px); }
  .service-card { min-height: 330px; }
  .global-layout { grid-template-columns: 1fr; gap: 34px; }
  .world-visual { width: 100%; min-height: 350px; margin: 0; }
  .world-svg,
  .country-highlight-object { transform: translateY(0) scale(1); }
  .world-svg { transform: scale(1); }
  .country-highlight-object { top: 50%; transform: translateY(-50%) scale(1); }
  .scroll-cue { display: none; }
  .contact-section { padding: 80px 0; }
  .footer-bottom { gap: 12px; padding-top: 20px; padding-bottom: 20px; }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 32px); }
  .hero { min-height: 650px; }
  .hero-content { padding-top: 132px; }
  .hero h1 { font-size: 34px; }
  .hero-desc { font-size: 15px; }
  .hero-actions .button { width: 100%; justify-content: center; }
  .stats-section { width: calc(100% - 24px); }
  .section-heading { margin-bottom: 36px; }
  .service-card { min-height: 300px; }
  .world-visual { min-height: 300px; }
  .map-country-summary { font-size: 10px; overflow-wrap: anywhere; }
  .footer-main, .footer-bottom, .footer-info { min-width: 0; }
  .footer-bottom > *, .footer-info > * { max-width: 100%; overflow-wrap: anywhere; }
  .capability-core { width: 116px; height: 116px; }
  .capability-core strong { font-size: 29px; }
  html[data-language="en"] .hero h1 { font-size: 31px; }
  .world-visual { transform: none; margin-left: 0; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
