/*
 * styles.css — visual design for the Muyi Machinery demo landing (v2).
 * Palette: deep navy night-shift + construction amber; atmospheric hero scene.
 * System font stack only — no external fonts (mainland-China hosting friendly).
 */

:root {
  --navy-950: #060d19;
  --navy-900: #0a1526;
  --navy-800: #101f38;
  --navy-700: #1c3355;
  --amber: #f2a541;
  --amber-dark: #b06a10;   /* darkened for 4.5:1 contrast on paper (UX audit) */
  --amber-soft: rgba(242, 165, 65, 0.14);
  --ink: #182233;
  --paper: #f4f6f9;
  --white: #ffffff;
  --muted: #5b6675;
  --green: #177a2c;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(10, 21, 38, 0.13);
  --shadow-hover: 0 18px 44px rgba(10, 21, 38, 0.20);
}

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

html { scroll-behavior: smooth; }

/* Anchored sections must clear the sticky header (46px phone / 61px tablet+)
   — verified by the device-matrix audit: without this, headings land hidden */
section[id] { scroll-margin-top: 78px; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy-800);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 13, 25, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(242, 165, 65, 0.18);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0.75rem 1.2rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand {
  color: var(--white); text-decoration: none; font-size: 1.15rem;
  display: flex; align-items: center; gap: 0.6rem;
  min-height: 44px;                                /* ≥44px tap target (mobile audit) */
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: var(--navy-900); font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.brand-name strong { color: var(--amber); }
.nav-links { display: flex; gap: 1.2rem; margin-left: auto; }
.nav-links a {
  color: #cdd6e4; text-decoration: none; font-size: 0.92rem;
  border-bottom: 2px solid transparent; padding-bottom: 2px; transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover { color: var(--amber); border-bottom-color: var(--amber); }
.nav-actions { display: flex; align-items: center; gap: 0.7rem; }
.lang-toggle {
  background: transparent; color: var(--amber); border: 1px solid var(--amber);
  border-radius: 8px; padding: 0.25rem 0.7rem; cursor: pointer; font-weight: 700;
  transition: background 0.15s, color 0.15s;
  /* ≥44px tap target (mobile audit) without enlarging the visual pill */
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.lang-toggle:hover { background: var(--amber); color: var(--navy-900); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  border-radius: 12px; padding: 0.8rem 1.7rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: var(--navy-900);
  box-shadow: 0 8px 22px rgba(242, 165, 65, 0.40);
}
.btn-primary:hover { box-shadow: 0 12px 28px rgba(242, 165, 65, 0.5); }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.55); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.section .btn-ghost, .footer .btn-ghost { border-color: var(--navy-700); color: var(--navy-700); }
.section-dark .btn-ghost { border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.9rem; }
.btn-block { display: block; text-align: center; margin-top: 0.9rem; }
/* Secondary CTA on light cards — primary amber is reserved for hero/contact (UX audit) */
.btn-ghost-dark { border: 1px solid var(--navy-700); color: var(--navy-800); background: transparent; cursor: pointer; font-family: inherit; }
.btn-ghost-dark:hover { background: var(--navy-800); color: var(--amber); }

/* Hamburger menu (≤860px): toggle button + dropdown panel (UX audit P0) */
.menu-toggle {
  display: none; background: none; border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white); border-radius: 8px; cursor: pointer;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}
.menu-toggle svg { width: 22px; height: 22px; }

/* ---------- Hero — corporate industrial ---------- */
.hero {
  position: relative; min-height: min(88vh, 860px);   /* capped: no dead zone at 1920px */
  display: flex; align-items: center;
  overflow: hidden;
  /* Steel gradient + blueprint grid (pure CSS texture, no images) */
  background:
    linear-gradient(160deg, rgba(6, 13, 25, 0.35), rgba(6, 13, 25, 0.55)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 56px),
    linear-gradient(155deg, #0c1728 0%, #14263f 45%, #0a1526 100%);
}
/* Large technical watermark anchored right — abstract line art, not an illustration */
.hero-bg {
  position: absolute; top: 50%; right: -6%;
  width: min(58vw, 760px); transform: translateY(-50%);
  opacity: 0.10;
}
.hero-bg svg { width: 100%; height: auto; display: block; }

.hero-content {
  position: relative; z-index: 2;
  max-width: 720px;
  padding: 6rem 1.5rem 7rem;
  margin-left: max(1.5rem, calc((100% - 1150px) / 2));
  text-align: left; color: var(--white);
}
.hero-kicker {
  display: inline-block;
  text-transform: uppercase; letter-spacing: 0.24em;
  color: var(--amber); font-weight: 700; font-size: 0.82rem;
  border-left: 3px solid var(--amber);
  padding: 0.25rem 0 0.25rem 0.9rem; margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  line-height: 1.08; margin: 0 0 1.2rem;
  letter-spacing: -0.015em; font-weight: 800;
}
.hero-sub {
  font-size: 1.12rem; color: #c6d2e4; max-width: 580px;
  margin-bottom: 2.2rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 2.2rem; align-items: center; margin-top: 3.2rem; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 1.6rem;
  width: fit-content;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 1.5rem; font-weight: 800; color: var(--amber); letter-spacing: -0.01em;
}
.stat-label { font-size: 0.82rem; color: #9fb0c8; max-width: 170px; }
.stat-divider { width: 1px; height: 42px; background: rgba(255, 255, 255, 0.16); }

/* Hazard-stripe accent at the hero bottom edge (classic industrial cue) */
.hazard-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background: repeating-linear-gradient(
    -45deg, var(--amber) 0 18px, var(--navy-950) 18px 36px
  );
}

/* ---------- Sections ---------- */
.section { max-width: 1150px; margin: 0 auto; padding: 4.5rem 1.5rem; }
.section-alt {
  max-width: none; background: var(--white);
  border-top: 1px solid #e8ecf2; border-bottom: 1px solid #e8ecf2;
}
.section-alt > * { max-width: 1150px; margin-left: auto; margin-right: auto; }
.section-dark {
  max-width: none; color: var(--white);
  background:
    radial-gradient(1000px 400px at 85% -10%, rgba(242, 165, 65, 0.14), transparent 60%),
    linear-gradient(160deg, var(--navy-900), var(--navy-800) 60%, var(--navy-950));
}
.section-dark > * { max-width: 1150px; margin-left: auto; margin-right: auto; }
.section-dark h2 { color: var(--white); }
.section-kicker {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.3em;
  color: var(--amber-dark); margin-bottom: 0.4rem;
}
.section-dark .section-kicker { color: var(--amber); }
.section-lead { color: var(--muted); font-size: 1.08rem; max-width: 760px; margin-bottom: 2.2rem; }
.section-dark .section-lead { color: #b9c6da; }
.footnote { font-size: 0.82rem; color: var(--muted); margin-top: 1.4rem; }
.section-dark .footnote { color: #8fa1bd; }

/* ---------- Cards ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.card {
  background: var(--white); border-radius: var(--radius); padding: 1.9rem;
  box-shadow: var(--shadow); border-top: 4px solid var(--amber);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-icon { font-size: 2rem; margin-bottom: 0.7rem; }
/* Numbered marker replaces emojis — sober corporate look */
.card-num {
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--navy-900); background: var(--amber);
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 6px;
  margin-bottom: 0.9rem;
}
.card h3 { color: var(--navy-800); margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.96rem; }

/* ---------- Machine grid ---------- */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.4rem; }
.machine-card {
  background: var(--paper); border: 1px solid #e4e8ef; border-radius: var(--radius);
  padding: 1.6rem; display: flex; flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.machine-card:hover {
  box-shadow: var(--shadow-hover); transform: translateY(-4px);
  border-color: rgba(242, 165, 65, 0.55);
}
.machine-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--navy-800); color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.9rem;
}
.machine-icon svg { width: 30px; height: 30px; }
.machine-card h3 { color: var(--navy-800); }
.machine-model { font-size: 0.78rem; color: var(--amber-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.machine-desc { font-size: 0.9rem; color: var(--muted); margin: 0.6rem 0 1rem; flex: 1; }
.machine-prices {
  display: flex; justify-content: space-between; gap: 0.5rem;
  border-top: 1px dashed #dfe4ec; padding-top: 0.8rem;
}
.price-label { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }
.price { font-weight: 800; color: var(--navy-800); white-space: nowrap; }
.price-accent { color: var(--amber-dark); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid #e4e8ef;
  /* Scroll affordance: right-edge mask fade fixed to the visible frame (mobile audit) */
  -webkit-mask-image: linear-gradient(90deg, #000 93%, transparent);
  mask-image: linear-gradient(90deg, #000 93%, transparent);
}
.compare-table { width: 100%; border-collapse: collapse; background: var(--white); min-width: 680px; }
/* Numeric cells never wrap ("USD / 4,800" two-line wrap fix); ref text may wrap */
.compare-table td { white-space: nowrap; }
.compare-table td:first-child, .compare-table td small { white-space: normal; }
.compare-table td:first-child strong { white-space: normal; }
/* Sticky first column keeps the machine name visible while scrolling (mobile) */
.compare-table th:first-child, .compare-table td:first-child {
  position: sticky; left: 0; z-index: 2;
  background: inherit; box-shadow: 2px 0 0 rgba(10, 21, 38, 0.06);
}
.compare-table thead th:first-child { background: var(--navy-800); }
.compare-table tbody td:first-child { background: var(--white); }
.rental-table tbody td:first-child { background: #152a46; }
.compare-table th {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: var(--white); text-align: left;
  padding: 0.95rem 1.15rem; font-size: 0.88rem; letter-spacing: 0.02em;
}
.compare-table td { padding: 0.95rem 1.15rem; border-bottom: 1px solid #edf0f5; font-size: 0.95rem; vertical-align: top; }
.compare-table tbody tr { transition: background 0.15s ease; }
.compare-table tbody tr:hover { background: #faf7f0; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table small { color: var(--muted); }
.western-price { color: #b03a3a; text-decoration: line-through; }
.save-badge {
  background: linear-gradient(135deg, #e5f6e8, #d2f0d8);
  color: var(--green); font-weight: 800;
  padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.88rem; white-space: nowrap;
}
.save-bar {
  display: block; margin-top: 0.5rem; height: 6px; width: 120px;
  background: #edf0f5; border-radius: 999px; overflow: hidden;
}
.save-bar-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--green));
  border-radius: 999px;
}

/* Rental table on dark section */
.rental-table { background: rgba(255, 255, 255, 0.04); }
.rental-table th { background: rgba(6, 13, 25, 0.75); }
.rental-table td { border-bottom-color: rgba(255, 255, 255, 0.08); color: #dbe4f2; }
.rental-table tbody tr:hover { background: rgba(242, 165, 65, 0.06); }
.rental-table .save-badge { background: var(--amber-soft); color: var(--amber); }

/* ---------- Process steps ---------- */
.steps { list-style: none; display: grid; gap: 1.1rem; max-width: 800px; counter-reset: step; }
.steps li {
  background: var(--paper); border-left: 5px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 1.15rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.steps li:hover { transform: translateX(4px); }
.steps strong { color: var(--navy-800); }
.steps p { color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.3rem; }
.team-card {
  background: var(--white); border-radius: var(--radius); padding: 1.6rem;
  text-align: center; box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.team-avatar {
  width: 66px; height: 66px; margin: 0 auto 0.9rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: var(--amber); font-weight: 800; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}
.team-role { color: var(--amber-dark); font-weight: 700; font-size: 0.85rem; margin: 0.2rem 0 0.5rem; }
.team-desc { color: var(--muted); font-size: 0.85rem; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-950); color: #b9c6da; text-align: center; padding: 2.2rem 1.5rem; }
.footer .footnote { margin-top: 0.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .nav-links { gap: 0.8rem; }
  .nav-links a { font-size: 0.85rem; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  /* Dropdown nav panel under the header */
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0.2rem;
    background: var(--navy-950); padding: 0.8rem 1.2rem 1.1rem;
    border-bottom: 1px solid rgba(242, 165, 65, 0.25);
    box-shadow: 0 18px 34px rgba(6, 13, 25, 0.5);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.7rem 0.2rem; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .hero { min-height: 78vh; }
  .hero-content { margin-left: 0; padding: 4rem 1.5rem 5rem; }
  .hero-stats { gap: 1.2rem; padding-top: 1.2rem; }
  .stat-divider { display: none; }
}
@media (max-width: 560px) {
  /* Phone header: single-line brand + language toggle; the nav CTA is redundant
     (hero provides the same action) so it is hidden to prevent wrapping */
  .nav-inner { padding: 0.6rem 0.9rem; gap: 0.7rem; position: relative; }
  .brand { font-size: 0.98rem; white-space: nowrap; }
  .brand-mark { width: 26px; height: 26px; font-size: 0.88rem; border-radius: 7px; }
  .nav-actions { margin-left: auto; }
  .nav-actions .btn-primary { display: none; }
  .hero h1 { font-size: clamp(1.7rem, 8.4vw, 2.2rem); }
  .hero-sub { font-size: 1rem; }
  .hero-kicker { letter-spacing: 0.14em; }              /* avoids awkward wrap (UX audit) */
  .hero-cta .btn { width: 100%; text-align: center; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; }
  .stat-num { font-size: 1.25rem; }
  .section { padding: 3.2rem 1.1rem; }
}
/* Tablet grids: symmetric 2-col cards (UX audit) */
@media (min-width: 561px) and (max-width: 1020px) {
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Phone: tables become stacked cards (no hidden columns) ----------
 * A phone reader must see ALL data without discovering horizontal scroll.
 * Each row becomes a labeled card; labels come from data-label attributes
 * injected by applyTableLabels() (i18n.js) from the localized thead texts. */
@media (max-width: 640px) {
  .table-wrap {
    overflow: visible; border: none; box-shadow: none; border-radius: 0;
    -webkit-mask-image: none; mask-image: none;        /* no scroll → no mask needed */
  }
  .compare-table { min-width: 0; background: transparent; }
  .compare-table thead { display: none; }              /* labels move into the cards */
  .compare-table, .compare-table tbody { display: block; }
  .compare-table tr {
    display: block; background: var(--white);
    border: 1px solid #e4e8ef; border-radius: 12px;
    margin-bottom: 1rem; padding: 0.9rem 1.05rem;
    box-shadow: var(--shadow);
  }
  .compare-table td {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1rem; padding: 0.45rem 0; white-space: normal;
    border-bottom: 1px dashed #edf0f5; position: static; box-shadow: none;
  }
  .compare-table td:last-child { border-bottom: none; }
  .compare-table td::before {
    content: attr(data-label);
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--muted); flex-shrink: 0; max-width: 46%;
  }
  /* First cell = card title (machine name), full width, no label */
  .compare-table td:first-child {
    display: block; font-size: 1.02rem;
    border-bottom: 1px solid #e8ecf2; margin-bottom: 0.35rem; padding-bottom: 0.55rem;
  }
  .compare-table td:first-child::before { content: none; }
  .compare-table .save-bar { width: 90px; }

  /* Dark-section variant (rental table) */
  .rental-table { background: transparent; }
  .rental-table tr {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }
  .rental-table td { border-bottom-color: rgba(255, 255, 255, 0.10); }
  .rental-table td:first-child { border-bottom: 1px solid rgba(255,255,255,0.14); }
  .rental-table td::before { color: #8fa1bd; }
  .rental-table td:first-child { background: transparent; }
}
