/* ============================================================
   DEXIN Automotive Engineering - Global Stylesheet
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Brand Colors */
  --primary:    #1a365d;   /* Deep Navy */
  --primary-l:  #2c5282;   /* Lighter Navy */
  --accent:     #3182ce;   /* Tech Blue */
  --accent-l:   #4299e1;
  --dark:       #1a202c;
  --gray-900:   #2d3748;
  --gray-700:   #4a5568;
  --gray-500:   #718096;
  --gray-300:   #e2e8f0;
  --gray-100:   #f7fafc;
  --white:      #ffffff;
  --orange:     #dd6b20;   /* Robot Orange accent */

  /* Typography */
  --font-body:  'Inter', 'Noto Sans SC', sans-serif;
  --font-head:  'Inter', 'Noto Sans SC', sans-serif;

  /* Spacing */
  --section-py: 100px;
  --container:  1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--gray-900);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }

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

/* --- Section Headings --- */
.section-title {
  text-align: center;
  margin-bottom: 60px;
}
.section-title h2 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.section-title p {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 640px;
  margin: 0 auto;
}
.section-title .divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: background 0.3s, box-shadow 0.3s;
}
.navbar.scrolled {
  background: rgba(255,255,255,0.98);
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
}
.navbar-brand img {
  height: 40px;
}
.navbar-brand .brand-en {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gray-500);
  display: block;
  line-height: 1.2;
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 4px;
}
.navbar-nav a {
  display: block;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-700);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--accent);
  background: rgba(49,130,206,0.06);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: 0.3s;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--dark);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,54,93,0.85) 0%, rgba(26,32,44,0.7) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.2;
}
.hero h1 span { color: var(--accent-l); }
.hero .subtitle {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
}
.hero .tagline {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 36px;
}
.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-l);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(49,130,206,0.3);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
}
.btn-outline:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.1);
}

/* Stats bar */
.stats-bar {
  position: relative;
  z-index: 2;
  margin-top: 80px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
}
.stat-item {
  padding: 28px 20px;
  text-align: center;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(4px);
}
.stat-item .number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent-l);
  line-height: 1;
}
.stat-item .label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-intro {
  padding: var(--section-py) 0;
  background: var(--gray-100);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-text h3 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 20px;
}
.about-text p {
  color: var(--gray-700);
  margin-bottom: 16px;
}
.about-image img {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* Team */
.team-section {
  padding: var(--section-py) 0;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.team-card {
  text-align: center;
  padding: 40px 24px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
.team-card .icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(49,130,206,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
}
.team-card h4 {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.team-card .count {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.team-card p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services-section {
  padding: var(--section-py) 0;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.service-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
.service-card .card-img {
  height: 200px;
  overflow: hidden;
}
.service-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.service-card:hover .card-img img {
  transform: scale(1.05);
}
.service-card .card-body {
  padding: 28px;
}
.service-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.service-card h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 12px;
}
.service-card p {
  color: var(--gray-500);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Process Flow */
.process-section {
  padding: var(--section-py) 0;
  background: var(--dark);
  color: var(--white);
}
.process-section .section-title h2 { color: var(--white); }
.process-section .section-title p  { color: rgba(255,255,255,0.6); }
.process-section .section-title .divider { background: var(--orange); }

.process-flow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
}
.process-step {
  flex: 0 0 160px;
  text-align: center;
  position: relative;
}
.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 32px;
  right: -40px;
  width: 40px;
  height: 2px;
  background: var(--orange);
}
.process-step .step-num {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(221,107,32,0.15);
  border: 2px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--orange);
}
.process-step h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.process-step p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-section {
  padding: var(--section-py) 0;
  background: var(--gray-100);
}

/* Year filter */
.year-filter {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.year-btn {
  padding: 8px 20px;
  border: 2px solid var(--gray-300);
  border-radius: 24px;
  background: var(--white);
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.year-btn:hover,
.year-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 40px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gray-300);
  border-radius: 2px;
}
.timeline-year {
  position: relative;
  margin-bottom: 48px;
}
.timeline-year .year-label {
  position: absolute;
  left: -40px;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  z-index: 2;
}
.timeline-year h3 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 16px;
  padding-left: 12px;
}
.project-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.project-item {
  background: var(--white);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.project-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.project-item .client {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}
.project-item .desc {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-top: 4px;
}
.project-item .tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.project-item .tag {
  padding: 3px 10px;
  background: rgba(49,130,206,0.08);
  color: var(--accent);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ============================================================
   CLIENTS
   ============================================================ */
.clients-section {
  padding: var(--section-py) 0;
}
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 24px;
  align-items: center;
}
.client-logo {
  height: 60px;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s;
  object-fit: contain;
}
.client-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-section {
  padding: var(--section-py) 0;
  background: var(--gray-100);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.contact-info h3 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 24px;
}
.info-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.info-item .icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(49,130,206,0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.info-item h4 {
  font-size: 0.95rem;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.info-item p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.contact-form {
  background: var(--white);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 60px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}
.footer-brand .brand-en {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  display: block;
}
.footer p {
  font-size: 0.9rem;
  line-height: 1.7;
}
.footer h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 16px;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer ul a:hover { color: var(--accent-l); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.section-padding { padding: var(--section-py) 0; }
.bg-gray { background: var(--gray-100); }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --section-py: 60px; }

  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .nav-toggle { display: flex; }

  .hero h1 { font-size: 2rem; }
  .hero .subtitle { font-size: 1rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-item .number { font-size: 1.8rem; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .services-grid { grid-template-columns: 1fr; }
  .team-grid     { grid-template-columns: 1fr; }

  .project-list  { grid-template-columns: 1fr; }
  .process-flow  { flex-direction: column; align-items: center; }
  .process-step:not(:last-child)::after { display: none; }

  .footer-grid { grid-template-columns: 1fr; }
  .clients-grid { grid-template-columns: repeat(3, 1fr); }
}
