/* ===================================================================
   Hebei Xiangming Conveyor Machinery — responsive landing page
   Mobile-first, no external dependencies, accessible & SEO friendly
   =================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f4f7fb;
  --color-ink: #0f172a;
  --color-muted: #475569;
  --color-primary: #1f6feb;
  --color-primary-dark: #0f3d75;
  --color-accent: #f59e0b;
  --color-border: #e2e8f0;
  --color-focus: #1f6feb;
  --max-width: 1120px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
/* Hide body briefly while the IP-based language redirect is decided (index.html only) */
html.lang-loading body { visibility: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 64px 0; }
.section-alt { background: var(--color-bg-alt); }

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 8px;
}
.section-lead {
  color: var(--color-muted);
  max-width: 60ch;
  margin: 0 0 32px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 16px; }

/* ---- Skip link (a11y) ---- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-ghost:hover { background: var(--color-primary); color: #fff; }
.btn-block { width: 100%; text-align: center; }

/* ---- Focus visibility (a11y) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* ============ HEADER / NAV ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 800;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 0.95rem; }
.brand-text small { font-weight: 500; color: var(--color-muted); font-size: 0.72rem; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-menu a {
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-menu a:hover { color: var(--color-primary); }
.nav-cta { color: #fff !important; }

/* Language switch (EN / RU) */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 700;
}
.lang-switch a {
  color: var(--color-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-switch a:hover { color: var(--color-primary); }
.lang-switch a.is-active {
  color: var(--color-primary);
  background: rgba(31, 111, 235, 0.12);
}
.lang-switch .sep { color: var(--color-border); font-weight: 400; }

/* Hamburger */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
  padding: 72px 0 56px;
  background: linear-gradient(180deg, #eef4ff 0%, #ffffff 100%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3.1rem);
  margin-bottom: 16px;
}
.lead { color: var(--color-muted); font-size: 1.05rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 28px; }
.hero-stats {
  list-style: none;
  display: flex;
  gap: 28px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.7rem; color: var(--color-primary-dark); }
.hero-stats span { font-size: 0.85rem; color: var(--color-muted); }
.hero-art { display: none; }
.hero-art img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============ PRODUCTS ============ */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12); }
.card-media {
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-media svg { width: 56px; height: 56px; }
.card p { color: var(--color-muted); margin: 0; font-size: 0.95rem; }

/* ============ WHY US ============ */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.feature {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature h3 { color: var(--color-primary-dark); }
.feature p { color: var(--color-muted); margin: 0; }

/* ============ CERTIFICATIONS ============ */
.cert-inner { text-align: center; }
.cert-inner h2 { margin-bottom: 28px; }

/* ============ FACTORY TOUR ============ */
.factory-inner { text-align: center; }
.factory-inner h2 { margin-bottom: 16px; }
.factory-inner .section-lead { margin: 0 auto 24px; }
.factory-inner .btn { margin-top: 4px; }
.badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 0;
  margin: 0;
}
.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  padding: 18px 22px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  background: #fff;
}
.badge strong { font-size: 1.2rem; color: var(--color-primary-dark); }
.badge span { font-size: 0.82rem; color: var(--color-muted); }

/* ============ CONTACT ============ */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}
.contact-list { list-style: none; padding: 0; margin: 18px 0 0; }
.contact-list li { display: flex; flex-direction: column; margin-bottom: 14px; }
.contact-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  font-weight: 700;
}
.contact-list a { color: var(--color-primary); text-decoration: none; font-weight: 600; }
.contact-list a:hover { text-decoration: underline; }

.inquiry-form {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; }
.field label { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field input,
.field select,
.field textarea {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  color: var(--color-ink);
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--color-primary); }
.field-full { grid-column: 1 / -1; }
.form-note { margin: 0; font-size: 0.9rem; min-height: 1.2em; }
.form-note.ok { color: #15803d; font-weight: 600; }
.form-note.err { color: #b91c1c; font-weight: 600; }
/* Honeypot: off-screen, keyboard-inaccessible, invisible to real users */
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ============ FOOTER ============ */
.site-footer {
  background: var(--color-ink);
  color: #cbd5e1;
  padding: 36px 0;
}
.footer-inner { text-align: center; }
.footer-brand { font-weight: 800; color: #fff; margin: 0 0 6px; }
.footer-meta { font-size: 0.9rem; margin: 0 0 10px; }
.footer-copy { font-size: 0.82rem; color: #94a3b8; margin: 0; }

/* ===================================================================
   RESPONSIVE BREAKPOINTS
   =================================================================== */

/* Tablet + */
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-art { display: block; }
}

/* Desktop + */
@media (min-width: 920px) {
  .section { padding: 88px 0; }
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-inner { grid-template-columns: 1fr 1fr; }
  .inquiry-form { grid-template-columns: 1fr 1fr; }
}

/* Mobile nav (below 820px) */
@media (max-width: 819px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 8px 20px 16px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a {
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-menu a:last-child { border-bottom: none; }
  .nav-cta { text-align: center; margin-top: 10px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Use dynamic viewport height on mobile where supported */
@supports (height: 100dvh) {
  .hero { min-height: auto; }
}

/* ============ FAQ ============ */
.faq-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.faq-item h3 { color: var(--color-primary-dark); font-size: 1.05rem; margin-bottom: 8px; }
.faq-item p { color: var(--color-muted); margin: 0; font-size: 0.95rem; }

/* ============ FOOTER LINK COLUMNS ============ */
.footer-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  text-align: left;
  margin-bottom: 26px;
}
.footer-col h3 {
  color: #fff;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #cbd5e1; text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col span { color: #cbd5e1; font-size: 0.9rem; }

/* ============ BLOG ============ */
.breadcrumb { font-size: 0.85rem; color: var(--color-muted); margin: 0 0 18px; }
.breadcrumb a { color: var(--color-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.article-list { display: grid; grid-template-columns: 1fr; gap: 18px; }
.article-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12); }
.article-card h3 { color: var(--color-primary-dark); margin-bottom: 8px; }
.article-card p { color: var(--color-muted); font-size: 0.95rem; margin: 0 0 14px; }
.article-card .read-more { color: var(--color-primary); font-weight: 700; text-decoration: none; }
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); margin-bottom: 12px; }
.article .post-meta { color: var(--color-muted); font-size: 0.9rem; margin-bottom: 24px; }
.article h2 { color: var(--color-primary-dark); margin-top: 32px; font-size: 1.4rem; }
.article p, .article li { color: var(--color-muted); font-size: 1.02rem; line-height: 1.75; }
.article ul { padding-left: 22px; margin: 0 0 16px; }
.article .back-link { display: inline-block; margin-top: 28px; color: var(--color-primary); font-weight: 700; text-decoration: none; }

@media (min-width: 640px) {
  .faq-list { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .article-list { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 920px) {
  .footer-cols { grid-template-columns: repeat(4, 1fr); }
}
