/* ============================================
   CHN Automation — Vibrant Redesign
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-bg: #0a0e1a;
  --color-bg-lighter: #111827;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-accent-1: #06b6d4;  /* Cyan */
  --color-accent-2: #8b5cf6;  /* Violet */
  --color-accent-3: #f97316;  /* Orange */
  --color-accent-4: #10b981;  /* Emerald */
  --gradient-vibrant: linear-gradient(135deg, #06b6d4, #8b5cf6, #f97316);
  --gradient-hero: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15), rgba(249, 115, 22, 0.1));
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow-glow: 0 0 60px rgba(6, 182, 212, 0.15), 0 0 120px rgba(139, 92, 246, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

a {
  color: var(--color-accent-1);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--color-accent-2);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 16px 0;
  transition: all 0.4s ease;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  background: rgba(10, 14, 26, 0.95);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 0;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header .logo-img {
  height: 38px;
  width: auto;
}

.header .sitename {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.navmenu ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

.navmenu a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 100px;
  transition: all 0.3s;
}

.navmenu a:hover,
.navmenu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-toggle {
  display: none;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
}

@media (max-width: 768px) {
  .navmenu ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
  }
  .navmenu ul.show {
    display: flex;
  }
  .navmenu a {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
  }
  .mobile-nav-toggle {
    display: block;
  }
}

/* --- Gradient Text Utility --- */
.gradient-text {
  background: var(--gradient-vibrant);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-accent-1);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 6px 20px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-2));
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.3);
  color: #fff;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--color-accent-1);
  background: rgba(6, 182, 212, 0.1);
  color: #fff;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) saturate(1.2);
}

.hero-bg-video + .hero-fallback {
  display: none;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4) saturate(1.2);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 26, 0.3) 0%, rgba(10, 14, 26, 0.6) 50%, var(--color-bg) 100%),
    var(--gradient-hero);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 850px;
  padding: 0 24px;
  animation: fadeInUp 1s ease-out;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--color-accent-1);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 8px 24px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero-content p {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--color-text-muted);
  margin-bottom: 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero-scroll a {
  color: rgba(255, 255, 255, 0.4);
  font-size: 24px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-12px); }
  60% { transform: translateY(-6px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   ABOUT SECTION
   ============================================= */
.about-section {
  padding: 120px 0;
  background: var(--color-bg);
  position: relative;
}

.about-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-lead {
  font-size: 20px;
  font-weight: 400;
  color: #fff;
  line-height: 1.7;
  margin-bottom: 16px;
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.8;
}

.about-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  background: var(--gradient-vibrant);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.img-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.img-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
  opacity: 0;
  transition: opacity 0.4s;
}

.img-card:hover::after {
  opacity: 1;
}

.img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.img-card:hover img {
  transform: scale(1.05);
}

.img-card-large {
  grid-column: 1 / -1;
}

.img-card-large img {
  height: 260px;
}

.img-card:not(.img-card-large) img {
  height: 180px;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-stats {
    gap: 24px;
  }
}

/* =============================================
   SERVICES SECTION
   ============================================= */
.services-section {
  padding: 120px 0;
  background: var(--color-bg-lighter);
  position: relative;
}

.services-section::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s ease;
  position: relative;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: var(--shadow-glow);
}

.service-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.service-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.service-card:hover .service-img img {
  transform: scale(1.08);
}

.service-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(10, 14, 26, 0.9) 100%);
}

.service-body {
  padding: 28px;
  position: relative;
}

.service-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-2));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  margin-top: -48px;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.service-icon i {
  font-size: 22px;
  color: #fff;
}

.service-body h4 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.service-body p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.service-body ul {
  list-style: none;
}

.service-body ul li {
  padding: 6px 0 6px 24px;
  position: relative;
  font-size: 13px;
  color: var(--color-text-muted);
}

.service-body ul li::before {
  content: "\F26A";
  font-family: 'bootstrap-icons';
  color: var(--color-accent-4);
  position: absolute;
  left: 0;
  font-size: 12px;
}

@media (max-width: 991px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   PROJECTS SECTION
   ============================================= */
.projects-section {
  padding: 120px 0;
  background: var(--color-bg);
  position: relative;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 260px;
  gap: 16px;
}

.project-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.project-wide {
  grid-column: span 2;
  grid-row: span 1;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover img {
  transform: scale(1.08);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 14, 26, 0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  transition: background 0.4s;
}

.project-card:hover .project-overlay {
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.1) 0%, rgba(10, 14, 26, 0.95) 100%);
}

.project-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent-1);
  margin-bottom: 8px;
}

.project-overlay h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  transform: translateY(10px);
  opacity: 0.8;
  transition: all 0.4s;
}

.project-card:hover .project-overlay h3 {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 200px;
  }
  .project-wide {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .project-wide {
    grid-column: span 1;
  }
}

/* =============================================
   CONTACT SECTION
   ============================================= */
.contact-section {
  padding: 120px 0;
  background: var(--color-bg-lighter);
  position: relative;
}

.contact-section::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.04));
  pointer-events: none;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 48px;
  align-items: start;
}

.contact-intro p {
  font-size: 18px;
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: 40px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.info-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-icon i {
  font-size: 20px;
  color: var(--color-accent-1);
}

.info-item h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.info-item p {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* Contact Form */
.contact-form .php-email-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 36px;
  border-radius: var(--radius);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  font-size: 14px;
  font-family: var(--font-body);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.3s;
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

.form-control:focus {
  border-color: var(--color-accent-1);
  background: rgba(6, 182, 212, 0.05);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

textarea.form-control {
  min-height: 130px;
  resize: vertical;
}

.form-messages {
  margin-top: 10px;
}

.form-messages .loading,
.form-messages .error-message,
.form-messages .sent-message {
  display: none;
  text-align: center;
  padding: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.form-messages .loading {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.form-messages .error-message {
  color: #fff;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.form-messages .sent-message {
  color: #fff;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent-1), var(--color-accent-2));
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 8px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.3);
}

.btn-submit i {
  transition: transform 0.3s;
}

.btn-submit:hover i {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   FOOTER
   ============================================= */
#footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 48px 0 32px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.footer-logo {
  height: 32px;
  width: auto;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--color-text-muted);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--color-accent-1);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  width: 100%;
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.footer-bottom .credits a {
  color: var(--color-accent-1);
}

/* =============================================
   ANIMATIONS (Scroll-triggered via JS)
   ============================================= */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   SELECTION & SCROLLBAR
   ============================================= */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}