/*
 * hero.css — homepage opening section: brand lockup + taglines +
 *            application/compliance pill rows + the "选择型号 →" CTA.
 *
 * Coupled with: <header class="hero"> in templates/index.template.html.
 * Not loaded on datasheets.html.
 *
 * The brand lockup (M-mark + MATLEX wordmark with 迈特力 row underneath)
 * uses an inline-flex column wrapper so the 迈特力 row can width:100%
 * to exactly the lockup bounding box — see .hero-brand-group below for
 * the geometry rationale.
 */

.hero {
  padding: 80px 0 120px;
  position: relative;
  overflow: hidden;
}

/* Brand lockup group wraps the horizontal M+wordmark row AND the 迈特力
   row underneath. `inline-flex` makes the group shrink to fit the widest
   child (the lockup) so the 迈特力 row below can `width: 100%` and land
   on exactly the same left+right edges. */
.hero-brand-group {
  display: inline-flex;
  flex-direction: column;
  gap: clamp(10px, 1.4vw, 18px);
  margin: 0 0 32px;
  align-items: stretch;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 32px);
}

.hero-brand-mark {
  /* The M shield is the primary brand moment — deliberately larger than
     the wordmark so the icon reads first on scan. Aspect ratio ~2.18:1. */
  width: clamp(132px, 16vw, 232px);
  height: auto;
  flex-shrink: 0;
  display: block;
}

.hero-brand-wordmark {
  /* MATLEX wordmark ratio ~7.8:1 — sized noticeably shorter than the
     M mark's rendered height so the visual hierarchy reads
     "icon is the hero, wordmark labels it". */
  height: clamp(32px, 4.1vw, 58px);
  width: auto;
  display: block;
}

/* 迈特力 row — sits directly under the lockup and centres across the
   lockup width (since the group is inline-flex, the row's width equals
   the lockup width, so text-align:center puts the 3 glyphs square in
   the middle). */
.hero-brand-cn-row {
  font-family: 'Noto Sans SC', var(--font-display), sans-serif;
  font-weight: 900;
  font-size: clamp(56px, 9vw, 118px);
  line-height: 0.95;
  color: var(--text);
  letter-spacing: 0.02em;
  text-align: center;
}

/* In English mode the wordmark image already says MATLEX — showing 迈特力
   below would be noise. CSS-level hide keeps the data-en module simple. */
body[data-lang="en"] .hero-brand-cn-row { display: none; }

/* Material descriptor — the "what material do we make" line. Reads as
   the primary product signal directly under the brand name. Stronger
   weight + darker color than the "since 2021" subtitle below it. */
.hero-brand-material {
  font-size: clamp(15px, 1.35vw, 21px);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
  margin: 8px 0 0;
  text-align: center;
  width: 100%;
}

/* Company-since descriptor — muted, sits below the material line. */
.hero-brand-sub {
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  margin: 4px 0 0;
  text-align: center;
  width: 100%;
}

/* em pill styling defined in base.css */

.hero-lead {
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  max-width: 52ch;
  margin: 0 0 24px;
}

/* Info pill rows — structured replacement for the old wall-of-text paragraph */
.hero-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.hero-pill-row:last-of-type {
  margin-bottom: 44px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.hero-pill-app {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
}

.hero-pill-cert {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.hero-pill-label {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 500;
  margin-left: 6px;
}

/* Leading label that sits BEFORE the pill group — e.g. "原料可用于".
   Visually distinct from the pills themselves (slightly heavier,
   accent-dark color) so users read it as a clause header rather than
   another chip. Makes it explicit that we sell the raw material, not
   the finished parts. */
.hero-pill-label-lead {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-left: 0;
  margin-right: 4px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Trailing soft hint — e.g. "等注塑件" — reads as a neutral continuation
   of the list, reinforcing that the pills are application *scenarios*,
   not SKUs we ship. */
.hero-pill-label-hint {
  color: var(--text-faint);
  font-weight: 500;
  margin-left: 2px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .hero { padding: 40px 0 64px; }
  .hero-brand-group { gap: 10px; margin-bottom: 28px; }
  .hero-brand { gap: 14px; }
  .hero-title { letter-spacing: -0.02em; }
  .hero-lead { font-size: 17px; margin-bottom: 20px; }
  .hero-pill-row { gap: 6px; margin-bottom: 12px; }
  .hero-pill-row:last-of-type { margin-bottom: 32px; }
  .hero-pill { font-size: 12px; padding: 6px 12px; }
  .hero-pill-label, .hero-pill-label-lead, .hero-pill-label-hint { font-size: 12px; }
  .hero-ctas { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
}

@media (max-width: 520px) {
  /* Keep the lockup on a single line as long as possible so the brand feels
     intentional rather than awkwardly wrapped. M stays visibly bigger
     than the wordmark next to it. */
  .hero-brand { flex-wrap: nowrap; gap: 14px; }
  .hero-brand-mark { width: clamp(100px, 32vw, 150px); }
  .hero-brand-wordmark { height: clamp(24px, 7.6vw, 40px); }
  /* 迈特力 scales to fill the lockup width on small screens too — three
     glyphs spread across the M+wordmark bounding box as a second-line
     emphasis of the Chinese brand. */
  .hero-brand-cn-row {
    font-size: clamp(48px, 16vw, 96px);
    line-height: 0.9;
  }
  /* Phone-sized hero: material line is the "what material we make"
     signal — kept big enough to read at arm's length. The company-since
     line drops to tiny caption-size so it doesn't compete. */
  .hero-brand-material {
    font-size: 15px;
    margin: 16px 0 0;
    line-height: 1.4;
  }
  .hero-brand-sub {
    font-size: 12px;
    margin: 6px 0 0;
    line-height: 1.4;
  }
}

/* Phone-only simplification: drop the two pill rows (applications +
   compliance) so the hero reduces to brand lockup + 迈特力 + CTA —
   customers on a small screen don't need the sidebar of qualifiers.
   Desktop and tablet keep the full pill grid. */
@media (max-width: 720px) {
  .hero-pill-row { display: none; }
}
