/* ============================================================
   BIV FLYWHEEL — RUIDI AUTO PARTS CO., LTD
   Industrial catalog aesthetic: steel white, carbon ink, BIV red.
   Signature: gauge-ring + drawing-number annotation system.
   ============================================================ */

:root {
  --ink: #16181d;
  --ink-soft: #2a2e36;
  --muted: #5c6470;
  --line: #d5d9de;
  --line-soft: #e5e8ec;
  --paper: #eceef1;
  --card: #ffffff;
  --red: #c8102e;
  --red-deep: #7a0e1e;
  --red-tint: #fbe9ec;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', 'Segoe UI', Helvetica, Arial, sans-serif;
  --wrap: 1200px;
  --header-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: var(--red); color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ---------- Type scale ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.94;
  letter-spacing: 0.01em;
}

h1.display { font-size: clamp(52px, 8vw, 108px); }
h2.display { font-size: clamp(36px, 4.5vw, 56px); }

/* ---------- Annotated eyebrow (drawing-number system) ---------- */
.dwg {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
}
.dwg::before {
  content: "";
  width: 26px;
  height: 3px;
  background: var(--red);
  flex: none;
}
.dwg .no {
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(250, 251, 252, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand img { height: 38px; width: auto; }
.brand .mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand .mark small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.main-nav a:hover { color: var(--red); }
.main-nav a[aria-current="page"] { color: var(--red); border-bottom-color: var(--red); }

.btn-quote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 22px;
  transition: background 0.15s, transform 0.15s;
}
.btn-quote:hover { background: var(--red-deep); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  width: 44px;
  height: 44px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 11px;
  width: 20px;
  height: 2px;
  background: var(--ink);
  content: "";
}
.nav-toggle span { top: 21px; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); background: #fafbfc; }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 72px;
}
.hero-lede {
  margin-top: 26px;
  max-width: 46ch;
  font-size: 17px;
  color: var(--muted);
}
.hero-lede strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 28px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-deep); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

/* gauge ring visual */
.hero-visual { position: relative; display: grid; place-items: center; }
.hero-visual svg.gauge { width: min(520px, 100%); height: auto; }
.gauge .ring { fill: none; stroke: var(--line); }
.gauge .ring-dash { stroke-dasharray: 2 7; }
.gauge .tick { stroke: var(--line); }
.gauge .tick-major { stroke: #b9bfc7; stroke-width: 2; }
.gauge .arc {
  stroke: var(--red);
  stroke-width: 3;
  fill: none;
}
.gauge .needle { fill: var(--red); }
.flywheel-photo {
  position: absolute;
  width: 56%;
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(22, 24, 29, 0.14);
}
.gauge-note {
  position: absolute;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.gauge-note b { color: var(--red); font-weight: 700; }
.gauge-note.n-top { top: -6px; left: 50%; transform: translateX(-50%); }
.gauge-note.n-left { left: -4px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.gauge-note.n-right { right: -4px; top: 50%; transform: translateY(-50%) rotate(90deg); }
.gauge-note.n-bottom { bottom: -6px; left: 50%; transform: translateX(-50%); }

@media (prefers-reduced-motion: no-preference) {
  .gauge .rotor {
    transform-origin: 50% 50%;
    animation: spin 120s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
}

/* ---------- Spec strip ---------- */
.spec-strip { border-bottom: 1px solid var(--line); background: var(--card); }
.spec-strip .wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.spec-cell {
  padding: 22px 26px;
  border-left: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.spec-cell:first-child { border-left: none; padding-left: 0; }
.spec-cell .val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  color: var(--ink);
  min-width: 72px;
}
.spec-cell .lab { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 44px; max-width: 720px; }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 17px; }

/* capability flow (real manufacturing sequence: numbered on purpose) */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--card);
}
.flow-step {
  padding: 22px 22px 20px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  position: relative;
  transition: background 0.15s;
}
.flow-step:hover { background: var(--red-tint); }
.flow-step:nth-child(-n+4) { border-top: none; }
.flow-step:nth-child(4n+1) { border-left: none; }
.flow-step .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--red);
}
.flow-step .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 6px;
}
.flow-step .zh { font-size: 13px; color: var(--muted); }

/* ---------- Product grid ---------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.prod-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.15s, transform 0.15s;
}
.prod-card:hover { border-color: var(--red); transform: translateY(-3px); }
.prod-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #f4f5f7;
  transition: transform 0.5s ease;
}
.prod-card:hover img { transform: scale(1.04); }
.prod-card .tag {
  position: absolute;
  left: 0;
  bottom: 0;
  background: rgba(22, 24, 29, 0.88);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.16em;
  padding: 5px 12px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 17, 20, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(1000px, 92vw);
  max-height: 78vh;
  border: 1px solid #3a3e46;
}
.lightbox .lb-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  color: #c9cdd4;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.16em;
}
.lightbox button {
  background: transparent;
  border: 1px solid #4a4f58;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
  padding: 8px 20px;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
}
.lightbox button:hover { border-color: var(--red); color: #fff; }

.below-note { margin-top: 46px; color: var(--muted); font-size: 15.5px; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--red); color: #fff; }
.cta-band .wrap {
  padding-top: 58px;
  padding-bottom: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.02;
  max-width: 21ch;
}
.cta-band p { margin-top: 10px; color: #ffdfe4; font-size: 16px; max-width: 52ch; }
.cta-band .btn { background: #fff; color: var(--red-deep); border-color: #fff; }
.cta-band .btn:hover { background: transparent; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b7bcc4; }
.site-footer .wrap {
  padding-top: 64px;
  padding-bottom: 28px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-brand img { height: 34px; filter: grayscale(1) brightness(3); margin-bottom: 16px; }
.footer-brand p { font-size: 14.5px; max-width: 42ch; }
.site-footer h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { text-decoration: none; color: #b7bcc4; transition: color 0.15s; }
.site-footer a:hover { color: #ff5c74; }
.footer-meta {
  grid-column: 1 / -1;
  border-top: 1px solid #2c3038;
  margin-top: 48px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #7d848f;
}

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  padding: 72px 0 60px;
}
.page-hero h1 { margin-top: 18px; }
.page-hero .lede { margin-top: 16px; max-width: 60ch; color: var(--muted); font-size: 17px; }

/* ---------- About ---------- */
.about-body { max-width: 72ch; }
.about-body p { margin-bottom: 18px; font-size: 17px; color: var(--ink-soft); }
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.value-card {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 26px 24px;
}
.value-card .kw {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--red);
}
.value-card p { margin-top: 8px; color: var(--muted); font-size: 15px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}
.contact-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-item .lab {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}
.contact-item .val { margin-top: 4px; font-size: 18px; font-weight: 500; }
.contact-item a.val { text-decoration: none; }
.contact-item a.val:hover { color: var(--red); }
.contact-item .sub { color: var(--muted); font-size: 14px; }

.form-card {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 34px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafbfc;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--red); background: var(--red-tint); }
.field .err { display: none; color: var(--red); font-size: 13px; margin-top: 4px; }
.field.invalid .err { display: block; }

.notice {
  display: none;
  margin-top: 18px;
  border: 1px solid var(--red);
  background: var(--red-tint);
  color: var(--red-deep);
  padding: 14px 16px;
  font-size: 14.5px;
}
.notice.show { display: block; }
.notice .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.local-meta { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ---------- Video ---------- */
.video-frame {
  border: 1px solid var(--line);
  background: var(--ink);
  padding: 10px;
}
.video-frame video { width: 100%; display: block; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 44px; padding-bottom: 52px; }
  .hero-visual { order: -1; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow-step:nth-child(4n+1) { border-left: 1px solid var(--line); }
  .flow-step:nth-child(2n+1) { border-left: none; }
  .flow-step:nth-child(-n+2) { border-top: none; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 8px 28px 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
  .main-nav a[aria-current="page"] { border-bottom-color: var(--red); }
  .header-cta { display: none; }

  .spec-strip .wrap { grid-template-columns: 1fr; }
  .spec-cell { border-left: none; border-top: 1px solid var(--line); padding: 16px 0; }
  .spec-cell:first-child { border-top: none; }
  .spec-cell .val { font-size: 30px; min-width: 58px; }

  .prod-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 30px; }
  .section { padding: 56px 0; }
}

/* focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ============================================================
   Quote popover (header) + 3-channel send panel (contact form)
   ============================================================ */
.quote-cta { position: relative; }
.quote-cta .btn-quote { cursor: pointer; }
.quote-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  min-width: 252px;
  background: var(--card);
  border: 1px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(22, 24, 29, 0.14);
  padding: 6px;
}
.quote-menu[hidden] { display: none; }
.quote-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.quote-menu a:hover { background: #fafbfc; border-left-color: var(--red); color: var(--red); }
.quote-menu a svg { width: 17px; height: 17px; flex: none; }
.quote-menu #quoteWa svg { color: #1faa53; }

/* WhatsApp entry inside mobile nav */
.nav-mobile-quote { display: none; }

/* ---------- Contact: 3-channel send panel ---------- */
.send-actions {
  margin-top: 20px;
  border: 1px solid var(--ink);
  background: #fff;
  padding: 18px;
}
.send-actions[hidden] { display: none; }
.send-actions .sa-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.send-actions .sa-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.send-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.send-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 16px 10px;
  border: 1px solid var(--line);
  background: #fafbfc;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.send-btn:hover { transform: translateY(-2px); border-color: var(--ink); }
.send-btn svg { width: 22px; height: 22px; }
.send-btn small {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}
.send-wa { background: #e8f8ee; border-color: #bfe8cf; color: #0b7a3d; }
.send-wa svg { color: #1faa53; }
.send-wa:hover { border-color: #0b7a3d; background: #dcf6e6; }
.send-copy.copied { border-color: #0b7a3d; background: #dcf6e6; color: #0b7a3d; }
.send-actions .sa-hint { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- Home CTA band action row ---------- */
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.cta-band .btn-wa { background: #25d366; border-color: #25d366; color: #05331b; }
.cta-band .btn-wa:hover { background: #1faa53; border-color: #1faa53; color: #fff; }

@media (max-width: 760px) {
  .nav-mobile-quote {
    display: block;
    margin-top: 10px;
    padding: 13px 6px !important;
    text-align: center;
    background: var(--red);
    color: #fff;
    border-bottom: none !important;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
  }
  .nav-mobile-quote:hover { color: #fff; background: var(--red-deep); }
  .send-grid { grid-template-columns: 1fr; }
  .quote-menu { right: -60px; }
}
