/* ==========================================================================
   HMS Vision Beijing — global styles
   Mobile-first. Breakpoints: 768px (tablet), 1024px (desktop).
   ========================================================================== */

/* ---------- Fonts (self-hosted; Google Fonts is blocked in mainland China) ---------- */
/* Montserrat variable font, weights 100–900. License: assets/fonts/OFL.txt */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  --color-text: #1a1a1a;
  --color-text-light: #ffffff;
  --color-muted: #9aa7b8;
  --color-bg: #ffffff;
  --color-navy: #061e36;
  --color-navy-dark: #03111f;
  --color-blue: #0a72c2;
  --color-black: #000000;
  --color-placeholder: #c9d1db;
  --color-placeholder-dark: #8a99ab;

  --accent-gradient: linear-gradient(90deg, #f6b51e 0%, #ee6a22 100%);
  /* Full overlay on small screens (text spans the photo). Desktop uses the fade baked into hero-image.jpg. */
  --hero-overlay: linear-gradient(rgba(36, 56, 84, 0.8), rgba(36, 56, 84, 0.8));

  --font-latin: "Montserrat", "Helvetica Neue", Arial;
  --font-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  /* Latin first in every language: Montserrat has no CJK glyphs, so Chinese characters
     fall through to the CJK fonts while English text (e.g. the brand name) stays identical. */
  --font-body: var(--font-latin), var(--font-zh);

  --container: 1280px;
  --gutter: 16px;
  --header-height: 72px;
  --radius: 8px;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 64px;
    --header-height: 110px;
    --hero-overlay: linear-gradient(transparent, transparent);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

/* Avoid flashing raw keys before i18n runs */
body:not(.is-ready) [data-i18n] { visibility: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Logo / brand ---------- */
/* PNG has a transparent background; the white fill keeps it readable on the navy footer */
.logo {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
}
.logo--lg { width: 64px; height: 64px; }

@media (min-width: 1024px) {
  .logo { width: 80px; height: 80px; }
  .logo--lg { width: 84px; height: 84px; }
}

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.brand__name { font-weight: 500; font-size: 14px; letter-spacing: 0.02em; }

@media (min-width: 1024px) {
  .brand { gap: 18px; }
  .brand__name { font-size: 24px; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  min-height: var(--header-height);
}

.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-height);
}

.lang-switch { position: relative; flex-shrink: 0; }

.lang-switch__button {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 92px; /* same width for "EN" and "中文" so the header doesn't shift */
  padding: 12px 18px;
  background: var(--color-black); color: #fff;
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer;
}
@media (min-width: 1024px) {
  .lang-switch__button { font-size: 16px; }
}

.lang-switch__menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 10;
  min-width: 140px;
  background: #fff; border: 1px solid #e3e3e3; border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.lang-switch__menu button {
  display: block; width: 100%; padding: 12px 16px;
  background: none; border: 0; text-align: left;
  font: inherit; cursor: pointer;
}
.lang-switch__menu button:hover { background: #f3f4f6; }

/* ---------- Hero ---------- */
/*
 * Set the image per page with a modifier class (e.g. .hero--home below).
 * Keep the url() in this file: a url() inside a custom property resolves against the
 * stylesheet that uses it, so an inline style="--hero-image: url(...)" breaks the path.
 * Without one, a neutral placeholder gradient is shown.
 */
.hero {
  position: relative;
  display: flex; align-items: center;
  min-height: 520px;
  padding: 64px 0;
  background-color: var(--color-placeholder-dark);
  background-image: var(--hero-overlay), var(--hero-image, linear-gradient(135deg, #8a99ab, #c9d1db));
  background-size: cover;
  background-position: center right;
  color: var(--color-text-light);
}

@media (min-width: 1024px) {
  .hero { min-height: 710px; padding: 96px 0; }

  /* Photo fits the hero's height (hero-image.jpg is 1440×720, so 710px tall = 1420px wide), pinned
     right, so nothing is cut off top or bottom. On wider screens the gap to its left is filled with the
     photo's own edge colour, and an eased 135px fade (dense at the edge, soft tail) hides the seam.
     If the photo changes, re-measure its left-edge colour and its width at 710px tall. */
  .hero--home {
    --hero-overlay: linear-gradient(90deg,
      rgb(4, 38, 78) calc(100% - 1420px),
      rgba(4, 38, 78, 0.85) calc(100% - 1392px),
      rgba(4, 38, 78, 0.5) calc(100% - 1356px),
      rgba(4, 38, 78, 0.2) calc(100% - 1321px),
      rgba(4, 38, 78, 0) calc(100% - 1285px));
    background-color: rgb(4, 38, 78);
    background-size: 100% 100%, auto 100%;
    background-position: 0 0, right center;
    background-repeat: no-repeat;
  }
}

.hero--home { --hero-image: url("../assets/images/hero-image.jpg"); }

.hero__content { max-width: 620px; }

.hero__title {
  font-size: clamp(26px, 4.4vw, 48px);
  font-weight: 500;
  line-height: 1.25;
  color: #e6ecf5;
}
.hero__title span { display: block; }
/* English title in capitals, per the design. Not in Chinese, so Latin names there (HelpMeSee) keep their spelling. */
html[lang="en"] .hero__title { text-transform: uppercase; }

.accent-bar {
  width: 76px; height: 6px;
  margin: 24px 0 32px;
  background: var(--accent-gradient);
  border: 0;
}

.hero__body { font-weight: 400; font-size: clamp(16px, 1.7vw, 22px); line-height: 1.5; white-space: pre-line; } /* pre-line: \n in the content makes a line break */

/* ---------- Intro (text left, photo right) ---------- */
/* Desktop from design: text ~60% / photo ~40%, vertically centred. Stacks on phones, photo below. */
.intro { padding: 48px 0; background: #fff; }

.intro__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }

@media (min-width: 768px) {
  .intro { padding: 64px 0; }
  .intro__inner { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 48px; }
}
@media (min-width: 1024px) {
  .intro__inner { gap: 80px; }
}

.intro__eyebrow {
  margin-bottom: 12px;
  color: var(--color-blue);
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 500;
  letter-spacing: 0.04em;
}
/* Capitals in English only, as with the hero title */
html[lang="en"] .intro__eyebrow { text-transform: uppercase; }

.intro__title {
  margin-bottom: 24px;
  color: var(--color-navy);
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 600;
  line-height: 1.2;
  white-space: pre-line; /* \n in the content makes a line break */
}

.intro__body {
  max-width: 640px;
  color: #5b6470;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.intro__image { width: 100%; height: auto; }

/* ---------- Footer ---------- */
.site-footer { color: var(--color-text-light); }

.footer__main {
  position: relative;
  background: var(--color-navy);
  padding: 36px 0;
}
.footer__main::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: url("../assets/images/yellow-orange-gradient-banner.jpg") center / 100% 100%;
}

.footer__inner {
  display: flex; flex-direction: column; gap: 28px;
}

.brand--footer .brand__name { font-size: 18px; }
.brand--footer .logo--lg { width: 54px; height: 54px; }

.footer__contact { display: flex; flex-direction: column; gap: 12px; }
.footer__contact a {
  display: inline-flex; align-items: center; gap: 18px;
  text-decoration: none;
  font-weight: 600; font-size: 14px;
}
.footer__contact a:hover { text-decoration: underline; }
.footer__contact img { width: 24px; height: 24px; }

@media (min-width: 768px) {
  .footer__inner { flex-direction: row; justify-content: space-between; align-items: center; }
  .footer__contact { padding-right: 64px; }
}

@media (min-width: 1024px) {
  .footer__main { padding: 44px 0; }
  .brand--footer .brand__name { font-size: 22px; }
  .footer__contact { padding-right: 96px; }
}

.footer__bar {
  background: var(--color-navy-dark);
  padding: 26px 0 30px;
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
}

.footer__bar-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.footer__legal,
.footer__filings { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.footer__legal li + li::before { content: "|"; margin: 0 12px; opacity: 0.6; }
.footer__legal a,
.footer__filings a { text-decoration: none; }
.footer__legal a:hover,
.footer__filings a:hover { color: #fff; }

/* Filing numbers as text, emblem and text centred on one line */
.footer__filings { gap: 6px 0; color: #fff; font-weight: 500; }
.footer__filings li { display: flex; align-items: center; }
.footer__filings li + li::before { content: "|"; margin: 0 12px; }
.footer__filings a { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.footer__filings img { height: 16px; width: auto; transform: translateY(-1px); } /* centres the emblem on the text, not the line box */

.footer__copyright { font-size: 11px; }

/* Phones: legal links and badges stack one per line, without separators */
@media (max-width: 767px) {
  .footer__legal,
  .footer__filings { flex-direction: column; gap: 6px; }
  .footer__legal li + li::before,
  .footer__filings li + li::before { content: none; }
}

/* ---------- Legal pages ---------- */
.legal {
  padding: 48px 0 80px;
}
.legal__content { max-width: 820px; }
.legal h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 500; }
.legal .accent-bar { margin: 16px 0 24px; }
.legal h2 { font-size: 16px; font-weight: 600; margin: 32px 0 12px; }
.legal p { margin-bottom: 16px; }
.legal h2 + h2 { margin-top: -4px; } /* Chinese/English heading pair: keep together, as in the PDFs */
.legal h3 { font-size: 15px; font-weight: 600; margin: 28px 0 10px; }
.legal h4 { font-size: 14px; font-weight: 600; margin: 24px 0 10px; }
.legal ul { list-style: disc; padding-left: 1.5em; margin-bottom: 16px; }
.legal li { margin-bottom: 8px; }
/* List markers as printed in the source PDF: • (default disc), ➢ arrow, or numbers already in the text */
.legal ul.legal__list--arrow { list-style-type: "➢  "; }
.legal ul.legal__list--plain { list-style: none; }
.legal a { color: var(--color-blue); }
.legal h2, .legal h3 { scroll-margin-top: calc(var(--header-height) + 16px); } /* keep TOC targets clear of the sticky header */

.legal h1 span { display: block; }
.legal__note {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f3f4f6; border-left: 4px solid #ee6a22;
  font-size: 13px; color: #444;
}
.legal__note p:last-child { margin-bottom: 0; font-style: italic; }
.legal__toc { margin: 24px 0 8px; }
.legal__toc-title { font-weight: 600; margin-bottom: 8px; }
.legal__toc ol { list-style: none; padding: 0; margin: 0; }
.legal__toc li { margin-bottom: 6px; }
.legal__toc-h3 { padding-left: 1.5em; }
.legal__toc a { text-decoration: none; }
.legal__toc a:hover { text-decoration: underline; }
