/* ===== Variables ===== */
:root {
  --primary: #1b3a6b;
  --primary-dark: #122850;
  --primary-light: #e8eef7;
  --secondary: #e87722;
  --secondary-light: #fff3e8;
  --accent: #e87722;
  --green: #4a9e3f;
  --green-light: #e8f5e9;
  --blue-bright: #2d6cc0;
  --dark: #111827;
  --gray-900: #1f2937;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --font-th: 'Sarabun', sans-serif;
  --font-en: 'Poppins', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-th);
  color: var(--dark);
  line-height: 1.7;
  background: var(--white);
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 12px rgba(27,58,107,0.08);
  transition: var(--transition);
}
.navbar.scrolled { box-shadow: 0 4px 20px rgba(27,58,107,0.12); }
.nav-container {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 70px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-en); font-weight: 700; font-size: 1.5rem;
  color: var(--primary);
}
.nav-logo img { height: 48px; width: auto; }
.nav-logo i { font-size: 1.3rem; }
.nav-menu {
  display: flex; gap: 4px;
}
.nav-link {
  padding: 8px 16px; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  color: var(--gray-700); transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--white); background: var(--accent);
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  background: var(--primary); color: var(--white);
  border: none; padding: 8px 16px; border-radius: 24px;
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
  font-family: var(--font-en); transition: var(--transition);
  letter-spacing: 1px;
}
.lang-toggle:hover { background: var(--accent); }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  width: 24px; height: 2.5px; background: var(--dark);
  border-radius: 2px; transition: var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 100px 24px 60px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #3470b8 0%, #1b5a9e 30%, #1b3a6b 70%, #0f2040 100%);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content {
  position: relative; z-index: 1; text-align: center;
  max-width: 900px; color: var(--white);
}
.hero-company {
  font-family: var(--font-en); font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700; margin-bottom: 8px; letter-spacing: 2px;
  color: var(--white);
  text-shadow: 0 3px 20px rgba(0,0,0,0.3);
}
.hero-me {
  color: var(--white);
  position: relative;
}
.hero-me::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 4px; background: var(--white); border-radius: 2px;
}
.hero-eng {
  color: var(--accent);
}
.hero-title {
  font-family: var(--font-en); font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 400; letter-spacing: 6px; margin-bottom: 20px;
  line-height: 1.4;
  text-transform: uppercase;
  opacity: 0.85;
  text-shadow: 0 1px 10px rgba(0,0,0,0.2);
}
.hero-desc {
  font-size: 1.2rem; opacity: 0.95; margin-bottom: 40px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.2);
}
.hero-stats {
  display: flex; justify-content: center; gap: 40px;
  margin-bottom: 40px; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num {
  font-family: var(--font-en); font-size: 2.5rem; font-weight: 700;
  color: var(--accent); display: inline;
}
.stat-plus, .stat-unit {
  font-family: var(--font-en); font-size: 1.5rem; font-weight: 600;
  color: var(--accent);
}
.stat-label {
  display: block; font-size: 0.85rem; opacity: 0.85; margin-top: 4px;
}
.hero-cta { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 10px; font-size: 1rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
  border: 2px solid transparent; font-family: var(--font-th);
}
.btn-primary {
  background: var(--accent); color: var(--white); border-color: var(--accent);
}
.btn-primary:hover {
  background: #d06a1a; border-color: #d06a1a;
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232,119,34,0.35);
}
.btn-outline {
  background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.15); border-color: var(--white);
}

/* ===== Sections ===== */
.section { padding: 80px 24px; }
.container { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 {
  font-size: 2rem; font-weight: 700; color: var(--primary);
  margin-bottom: 8px;
}
.section-sub { color: var(--gray-500); font-size: 1.05rem; }

/* ===== About ===== */
.about { background: var(--white); }
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  align-items: start;
}
.vision-box {
  background: linear-gradient(135deg, var(--primary-light), #d4e4f7);
  border: 2px solid var(--blue-bright);
  color: var(--dark); padding: 28px 32px; border-radius: var(--radius);
  margin-bottom: 24px;
}
.vision-box h3 { margin-bottom: 12px; font-size: 1.2rem; color: var(--accent); font-weight: 700; }
.vision-box p { font-size: 1.05rem; line-height: 1.9; color: var(--primary-dark); font-weight: 500; }
.about-text p { margin-bottom: 16px; color: var(--gray-700); }
.about-info {
  background: var(--white); padding: 32px; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-100);
}
.about-info h3 { margin-bottom: 20px; color: var(--accent); font-weight: 700; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--gray-300);
  font-size: 0.9rem; vertical-align: top;
}
.info-table td:first-child {
  font-weight: 600; color: var(--primary); white-space: nowrap; width: 40%;
}
.cert-badge {
  display: flex; align-items: flex-start; gap: 16px;
  margin-top: 24px; padding: 16px; border-radius: var(--radius);
  background: var(--green-light); border-left: 4px solid var(--green);
}
.cert-badge i { font-size: 2rem; color: var(--green); flex-shrink: 0; margin-top: 4px; }
.cert-badge strong { display: block; color: var(--green); margin-bottom: 4px; }
.cert-badge p { font-size: 0.85rem; color: var(--gray-700); }

/* ===== Services ===== */
.services { background: var(--gray-100); }
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-bottom: 48px;
}
.service-card {
  background: var(--white); padding: 32px 24px; border-radius: var(--radius);
  box-shadow: var(--shadow); border-top: 4px solid transparent;
  transition: var(--transition); position: relative; overflow: hidden;
}
.service-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-lg);
  border-top-color: var(--accent);
}
.service-icon {
  width: 60px; height: 60px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #f5a623);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 20px;
}
.service-card h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--primary); font-weight: 700; }
.service-card p { font-size: 0.9rem; color: var(--gray-500); line-height: 1.7; }
.service-tag {
  display: inline-block; margin-top: 16px;
  padding: 4px 14px; border-radius: 20px; font-size: 0.75rem;
  font-weight: 700; background: var(--primary); color: var(--white);
}

/* Carbon Journey */
.carbon-journey {
  background: linear-gradient(135deg, var(--primary) 0%, var(--blue-bright) 100%);
  color: var(--white); padding: 40px; border-radius: var(--radius);
}
.carbon-journey h3 { text-align: center; margin-bottom: 32px; font-size: 1.2rem; }
.journey-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.journey-step {
  text-align: center; background: rgba(255,255,255,0.12);
  padding: 20px 16px; border-radius: var(--radius); min-width: 140px;
  backdrop-filter: blur(4px);
}
.journey-step span {
  display: block; width: 40px; height: 40px; line-height: 40px;
  border-radius: 50%; background: var(--accent); color: var(--white);
  font-family: var(--font-en); font-weight: 700; margin: 0 auto 10px;
  font-size: 1.1rem;
}
.journey-step p { font-size: 0.85rem; }
.journey-arrow { color: var(--accent); font-size: 1.2rem; }

/* ===== Projects ===== */
.projects { background: var(--white); }
.projects-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-bottom: 48px;
}
.project-card {
  background: var(--white); padding: 24px; border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; transition: var(--transition);
  border: 2px solid var(--gray-100);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--secondary-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin: 0 auto 16px;
}
.project-card h4 {
  font-family: var(--font-en); font-size: 1.1rem; margin-bottom: 8px;
  color: var(--primary); font-weight: 700;
}
.project-card p { font-size: 0.85rem; color: var(--gray-500); }

/* Active Projects */
.active-projects {
  margin-bottom: 48px;
}
.active-projects h3 {
  text-align: center; margin-bottom: 24px; color: var(--primary);
  font-size: 1.3rem; font-weight: 700;
}
.active-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.active-item {
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--white); padding: 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 5px solid var(--accent);
  transition: var(--transition);
}
.active-item:hover { transform: translateX(4px); box-shadow: var(--shadow-lg); }
.active-item i { font-size: 1.5rem; color: var(--accent); margin-top: 2px; }
.active-item strong { display: block; margin-bottom: 4px; color: var(--primary); }
.active-item p { font-size: 0.85rem; color: var(--gray-500); }

/* Partners */
.partners h3 {
  text-align: center; margin-bottom: 24px; color: var(--secondary);
  font-size: 1.3rem;
}
.partners-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.partner-card {
  background: var(--white); padding: 24px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.partner-card h4 { color: var(--secondary); margin-bottom: 12px; }
.partner-card h4 span {
  font-size: 0.85rem; color: var(--primary); font-weight: 400;
}
.partner-card p { font-size: 0.9rem; color: var(--gray-500); }

/* ===== Carbon Calculator ===== */
.calculator { background: var(--gray-100); }
.calc-dashboard {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-bottom: 40px;
}
.dash-card {
  background: var(--white); padding: 28px 20px; border-radius: var(--radius);
  text-align: center; transition: var(--transition);
  border: 2px solid var(--gray-100);
}
.dash-card:hover { border-color: var(--accent); }
.dash-card.highlight {
  background: linear-gradient(135deg, var(--green), #2d8a30);
  color: var(--white); border-color: var(--green);
}
.dash-card i { font-size: 2rem; margin-bottom: 12px; color: var(--accent); }
.dash-card.highlight i { color: #ffd54f; }
.dash-num {
  display: block; font-family: var(--font-en); font-size: 2.5rem;
  font-weight: 700; color: var(--primary);
}
.dash-card.highlight .dash-num { color: var(--white); }
.dash-unit { font-size: 0.9rem; font-weight: 600; }
.dash-label { display: block; font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; }
.dash-card.highlight .dash-label { color: rgba(255,255,255,0.85); }

/* Form */
.calc-form {
  background: var(--white); padding: 32px; border-radius: var(--radius);
  margin-bottom: 32px; box-shadow: var(--shadow);
  border: 2px solid var(--gray-100);
}
.calc-form h3 { margin-bottom: 20px; color: var(--primary); font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px; font-size: 0.9rem;
  font-weight: 600; color: var(--primary);
}
.form-group input, .form-group select {
  width: 100%; padding: 12px 14px; border: 2px solid var(--gray-300);
  border-radius: 10px; font-size: 1rem; font-family: var(--font-th);
  transition: var(--transition); background: var(--gray-100);
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,119,34,0.15);
  background: var(--white);
}

/* Table */
.calc-table-wrap { overflow-x: auto; }
.calc-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.calc-table th {
  background: var(--primary); color: var(--white);
  padding: 14px 16px; font-size: 0.85rem; text-align: left;
  font-weight: 600;
}
.calc-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
}
.calc-table tr:hover td { background: var(--secondary-light); }
.calc-table .del-btn {
  background: #ef4444; color: var(--white); border: none;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: 0.8rem; font-weight: 600; transition: var(--transition);
}
.calc-table .del-btn:hover { background: #dc2626; transform: scale(1.05); }
.empty-msg {
  text-align: center; padding: 40px; color: var(--gray-500);
  font-size: 0.95rem;
}

/* ===== Contact ===== */
.contact { background: var(--white); }
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.contact-item {
  display: flex; gap: 16px; margin-bottom: 24px;
}
.contact-item i {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--secondary-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.contact-item strong { display: block; margin-bottom: 4px; color: var(--primary); font-weight: 700; }
.contact-item p { font-size: 0.9rem; color: var(--gray-500); }
.contact-item a { color: var(--blue-bright); font-weight: 600; }
.contact-item a:hover { text-decoration: underline; color: var(--accent); }
.contact-cta {
  margin-top: 32px; padding: 28px; text-align: center;
  background: linear-gradient(135deg, var(--accent), #f5a623);
  color: var(--white); border-radius: var(--radius);
}
.contact-cta p { margin-bottom: 16px; font-size: 1.15rem; font-weight: 600; color: #ffffff; }
.contact-cta .btn-primary {
  background: var(--white); color: var(--accent); border-color: var(--white);
  font-weight: 700;
}
.contact-cta .btn-primary:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.contact-map iframe { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ===== Footer ===== */
.footer {
  background: var(--primary-light); color: var(--gray-700); padding: 60px 24px 24px;
}
.footer-content {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px;
  margin-bottom: 40px;
}
.footer-brand h3 {
  color: var(--primary); font-family: var(--font-en); font-size: 1.5rem;
  margin-bottom: 8px;
}
.footer-brand h3 img { height: 40px; display: inline-block; vertical-align: middle; }
.footer h4 { color: var(--primary); margin-bottom: 16px; }
.footer ul li { padding: 4px 0; font-size: 0.9rem; }
.footer p { font-size: 0.9rem; margin-bottom: 6px; }
.footer i { margin-right: 8px; color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--gray-300);
  padding-top: 20px; text-align: center; font-size: 0.85rem;
  color: var(--gray-500);
}

/* ===== Scroll Animation ===== */
.fade-in {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-menu {
    position: fixed; top: 70px; left: 0; right: 0;
    background: var(--white); flex-direction: column;
    padding: 16px; gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-120%); transition: var(--transition);
  }
  .nav-menu.active { transform: translateY(0); }
  .about-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .active-grid { grid-template-columns: 1fr; }
  .partners-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .calc-dashboard { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; gap: 32px; }
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 2rem; }
  .journey-steps { flex-direction: column; }
  .journey-arrow { transform: rotate(90deg); }
  .hero { padding-top: 90px; }
  .hero-company { font-size: 2rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .calc-dashboard { grid-template-columns: 1fr; }
  .hero-stats { gap: 16px; }
  .stat-item { min-width: 45%; }
}
