/* ============================================================
   Farmer Auto Trading — Corporate Website
   Design system: corporate green & blue (brand logo palette)
   ============================================================ */

:root {
  --green: #1e7a3a;
  --green-dark: #14572a;
  --green-light: #e8f4ec;
  --blue: #2b4ea2;
  --blue-dark: #16294d;
  --navy: #0e1c36;
  --ink: #1c2430;
  --gray: #5b6470;
  --gray-light: #f4f6f8;
  --white: #ffffff;
  --gold: #c9a24b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(14, 28, 54, 0.10);
  --shadow-lg: 0 20px 50px rgba(14, 28, 54, 0.16);
  --font: "Manrope", "Noto Sans SC", "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

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

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

a { color: inherit; text-decoration: none; }

/* ---------- Language toggle ----------
   html[data-lang="en"] shows .tr-en, html[data-lang="zh"] shows .tr-zh */
html[data-lang="en"] .tr-zh { display: none !important; }
html[data-lang="zh"] .tr-en { display: none !important; }
html[data-lang="zh"] body { font-family: "Noto Sans SC", var(--font); }

/* ---------- Layout helpers ---------- */
.container { width: min(1180px, 92%); margin: 0 auto; }

section { padding: 84px 0; }

.section-alt { background: var(--gray-light); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
}

h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); font-weight: 800; }

h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 18px; }

h3 { font-size: 1.25rem; margin-bottom: 10px; }

.lead { font-size: 1.08rem; color: var(--gray); max-width: 760px; }

.center { text-align: center; }
.center .lead { margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--green); color: var(--white); box-shadow: 0 8px 20px rgba(30, 122, 58, 0.35); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-2px); }
.btn-outline { border: 2px solid rgba(255,255,255,0.8); color: var(--white); background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }
.btn-blue { background: var(--blue); color: var(--white); box-shadow: 0 8px 20px rgba(43, 78, 162, 0.35); }
.btn-blue:hover { background: var(--blue-dark); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(14, 28, 54, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.brand img {
  height: 46px;
  width: auto;
  max-width: 52px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}
.brand-name strong {
  font-size: 1.02rem;
  color: var(--navy);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-name span {
  font-size: 0.68rem;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 13px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.main-nav a:hover { color: var(--green); background: var(--green-light); }
.main-nav a.active { color: var(--green); background: var(--green-light); }

.main-nav .lang-switch { margin-left: 10px; }

.lang-switch {
  display: flex;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  width: fit-content;
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-switch button.active { background: var(--blue); color: var(--white); }

.nav-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.7rem;
  color: var(--navy);
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  margin-right: -4px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  padding: 120px 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(9, 24, 48, 0.92) 0%, rgba(14, 46, 32, 0.78) 55%, rgba(9, 24, 48, 0.45) 100%);
  z-index: -1;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 4.8vw, 3.6rem);
  max-width: 820px;
  margin-bottom: 20px;
}
.hero .lead { color: rgba(255, 255, 255, 0.88); font-size: 1.15rem; margin-bottom: 34px; }
.hero .eyebrow { color: #7fd39a; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Page hero (inner pages) */
.page-hero {
  position: relative;
  padding: 110px 0 90px;
  color: var(--white);
  overflow: hidden;
}
.page-hero .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: -2; }
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(9, 24, 48, 0.93) 0%, rgba(14, 46, 32, 0.82) 60%, rgba(9, 24, 48, 0.55) 100%);
  z-index: -1;
}
.page-hero h1 { color: var(--white); font-size: clamp(1.9rem, 4vw, 3rem); max-width: 780px; }
.page-hero .lead { color: rgba(255, 255, 255, 0.88); margin-top: 14px; }
.page-hero .eyebrow { color: #7fd39a; }

/* ---------- Stats bar ---------- */
.stats-bar { background: var(--navy); color: var(--white); padding: 44px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 28px;
  text-align: center;
}
.stat-num { font-size: 2.5rem; font-weight: 800; color: #7fd39a; }
.stat-num .plus { color: var(--gold); }
.stat-label { font-size: 0.88rem; color: rgba(255, 255, 255, 0.75); margin-top: 4px; }

/* ---------- Brand logo strip ---------- */
.logo-strip { padding: 48px 0; border-bottom: 1px solid rgba(14, 28, 54, 0.07); }
.logo-strip-title { text-align: center; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gray); margin-bottom: 28px; }
.logo-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 48px;
}
.logo-row img {
  height: 44px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.25s, transform 0.25s;
}
.logo-row img:hover { opacity: 1; transform: scale(1.08); }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  margin-top: 48px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-img { height: 220px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 24px 26px 28px; flex: 1; }
.card-body p { color: var(--gray); font-size: 0.95rem; }
.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(43, 78, 162, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.card-tag.green { color: var(--green); background: var(--green-light); }

/* ---------- Split sections ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split.reverse > .split-img { order: 2; }
.split-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.split-img img { width: 100%; height: 100%; object-fit: cover; }
.split-text p { color: var(--gray); margin-bottom: 16px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: 56px; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: linear-gradient(var(--green), var(--blue));
  border-radius: 3px;
}
.timeline-item { position: relative; padding-bottom: 44px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 7px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--green);
  box-shadow: 0 0 0 4px rgba(30, 122, 58, 0.15);
}
.timeline-year { font-size: 1.05rem; font-weight: 800; color: var(--green); letter-spacing: 0.04em; }
.timeline-item h3 { margin: 4px 0 6px; }
.timeline-item p { color: var(--gray); max-width: 720px; }

/* ---------- Quote block ---------- */
.quote-block {
  background: linear-gradient(120deg, var(--navy) 0%, #12331f 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 56px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}
.quote-block img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.25);
}
.quote-mark { font-size: 3.4rem; color: #7fd39a; line-height: 0.6; font-family: Georgia, serif; }
.quote-text { font-size: 1.15rem; line-height: 1.75; margin: 14px 0 20px; color: rgba(255, 255, 255, 0.94); }
.quote-name { font-weight: 800; font-size: 1.05rem; }
.quote-role { font-size: 0.88rem; color: #7fd39a; font-weight: 600; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px;
  margin-top: 48px;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}
.gallery-item img { width: 100%; height: 250px; object-fit: cover; transition: transform 0.4s; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-caption { padding: 16px 20px; }
.gallery-caption strong { display: block; color: var(--navy); font-size: 0.98rem; }
.gallery-caption span { font-size: 0.85rem; color: var(--gray); }

/* ---------- Feature list ---------- */
.feature-list { list-style: none; margin-top: 20px; }
.feature-list li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 14px;
  color: var(--gray);
}
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-list li strong { color: var(--ink); }

/* ---------- Coverage / location pills ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.pill {
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--white);
  border: 1.5px solid rgba(43, 78, 162, 0.25);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(14, 28, 54, 0.06);
}
.pill.green { border-color: rgba(30, 122, 58, 0.3); color: var(--green-dark); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(110deg, var(--green-dark) 0%, var(--blue-dark) 100%);
  color: var(--white);
  text-align: center;
  padding: 84px 0;
}
.cta-band h2 { color: var(--white); }
.cta-band .lead { color: rgba(255, 255, 255, 0.85); margin: 0 auto 34px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; margin-top: 48px; }
.contact-info-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
}
.contact-line { display: flex; gap: 16px; margin-bottom: 24px; }
.contact-line:last-child { margin-bottom: 0; }
.contact-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
.contact-line strong { display: block; color: var(--navy); font-size: 0.95rem; }
.contact-line span { color: var(--gray); font-size: 0.92rem; }

.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--navy); margin-bottom: 7px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid rgba(14, 28, 54, 0.15);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--gray-light);
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--green); background: var(--white); }
.form-group textarea { resize: vertical; min-height: 130px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255, 255, 255, 0.75); padding: 64px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 44px;
  padding-bottom: 48px;
}
.footer-brand img { height: 52px; margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; max-width: 300px; }
.site-footer h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 18px; letter-spacing: 0.06em; text-transform: uppercase; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 0.92rem; transition: color 0.15s; }
.footer-links a:hover { color: #7fd39a; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 0;
  font-size: 0.82rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Never leave content invisible on small screens / if JS stalls */
@media (max-width: 860px) {
  .reveal { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .main-nav {
    position: fixed;
    top: 76px;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    width: min(320px, 84vw);
    height: calc(100vh - 76px);
    padding: 24px;
    gap: 6px;
    box-shadow: -12px 0 30px rgba(14, 28, 54, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 120;
  }
  .main-nav.open { transform: none; }
  .main-nav a { padding: 13px 16px; font-size: 1rem; }
  .main-nav .lang-switch {
    margin: 18px 0 0;
    align-self: flex-start;
  }
  .main-nav .lang-switch button {
    padding: 10px 18px;
    font-size: 0.9rem;
  }
  .nav-toggle { display: block; flex-shrink: 0; }
  .brand-name { display: none; }
  .brand { flex: 0 0 auto; overflow: visible; }
  .brand img { height: 44px; max-width: 48px; }
  .header-actions { margin-left: auto; }
}

@media (max-width: 860px) {
  section { padding: 60px 0; }
  .split, .split.reverse { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse > .split-img { order: 0; }
  .quote-block { grid-template-columns: 1fr; padding: 40px 30px; text-align: center; }
  .quote-block img { margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .card-img { height: 200px; }
  .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .logo-row { gap: 22px; }
  .logo-row img { height: 36px; max-width: 96px; }
  .hero { min-height: 70vh; padding: 96px 0 72px; }
  .header-inner { gap: 8px; }
}
