@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600&display=swap');

:root {
  /* Colors — Primary */
  --forest-900: #1E2517;
  --forest-800: #2C3520;
  --forest-700: #3D4A2E;
  --forest-600: #5C6B40;
  --forest-500: #7A8B5A;
  --forest-400: #A8B88A;
  --forest-300: #D4DBC5;
  --forest-200: #F0EDE4;
  --forest-100: #F8F6F1;

  /* Colors — Neutral */
  --stone-900: #2E2B27;
  --stone-600: #5A5650;
  --stone-400: #9A9589;
  --stone-200: #DDD8CC;
  --stone-100: #F0EDE4;
  --stone-50:  #F8F6F1;

  /* Colors — Accent */
  --earth-700: #8B7355;
  --earth-400: #C4A882;
  --earth-100: #E8DCC8;

  /* Semantic */
  --color-primary:       var(--forest-700);
  --color-primary-hover: var(--forest-800);
  --color-secondary:     var(--forest-600);
  --color-text-heading:  var(--stone-900);
  --color-text-body:     var(--stone-600);
  --color-text-muted:    var(--stone-400);
  --color-bg-page:       var(--stone-50);
  --color-bg-card:       #FFFFFF;
  --color-bg-surface:    var(--forest-200);
  --color-border:        var(--stone-200);
  --color-on-dark:       #F5F2E8;
  --color-on-dark-muted: var(--forest-400);

  /* Typography */
  --font-main:    'Noto Sans Thai', sans-serif;
  --text-display: clamp(36px, 5vw, 56px);
  --text-h1:      clamp(28px, 4vw, 40px);
  --text-h2:      clamp(22px, 3vw, 28px);
  --text-h3:      18px;
  --text-body:    16px;
  --text-caption: 14px;
  --text-small:   12px;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-card: 12px;
  --radius-lg:   16px;
  --radius-pill: 9999px;

  /* Animation */
  --duration-fast:  150ms;
  --duration-base:  200ms;
  --duration-slow:  300ms;
  --duration-enter: 600ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg-page);
  color: var(--color-text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-heading);
  line-height: 1.25;
}

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

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

/* =========================================
   Layout & Container
   ========================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 80px;
}

@media (max-width: 1024px) {
  .container { padding: 0 40px; }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
}

.section {
  padding: var(--space-20) 0;
}

@media (max-width: 768px) {
  .section { padding: var(--space-12) 0; }
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  font-size: var(--text-h1);
  font-weight: 600;
  color: var(--color-text-heading);
}

.section-header .en {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* =========================================
   Components: Buttons
   ========================================= */
.btn {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background var(--duration-fast) var(--ease-default),
              transform 80ms var(--ease-in),
              color var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-dark);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-primary:active, .btn:active {
  transform: scale(0.97);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--stone-100);
}

.btn-outline-dark {
  background: transparent;
  color: var(--forest-300);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-outline-dark:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--color-secondary);
  border-color: transparent;
  padding: var(--space-2) 0;
  font-size: var(--text-caption);
}

.btn-ghost:hover {
  color: var(--color-primary);
}

.btn-white {
  background: var(--forest-100);
  color: var(--color-primary);
  border-color: var(--forest-100);
}

.btn-white:hover {
  background: #FFFFFF;
}

/* =========================================
   Navbar
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  border-bottom: none;
  height: 100px;
  padding: 0 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--duration-base) var(--ease-default),
              border-color var(--duration-base) var(--ease-default),
              backdrop-filter var(--duration-base) var(--ease-default);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
}

.navbar-brand img {
  height: 60px;
  width: auto;
}

@media (max-width: 768px) {
  .navbar-brand img {
    height: 40px;
  }
}

/* Language toggling for logos */
html[lang="en"] .logo-th { display: none !important; }
html[lang="th"] .logo-en { display: none !important; }

/* Scrolled state for navbar logos */
.navbar-brand img.logo-dark { display: none; }
.navbar-brand img.logo-white { display: block; }

.navbar.scrolled .navbar-brand img.logo-dark { display: block; }
.navbar.scrolled .navbar-brand img.logo-white { display: none; }

.nav-links {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

.nav-link {
  font-size: var(--text-caption);
  color: var(--color-on-dark);
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-default);
  position: relative;
  text-decoration: none;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-fast) var(--ease-default);
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}
.navbar.scrolled .nav-link {
  color: var(--color-text-body);
}

.nav-link:hover,
.nav-link.active {
  color: var(--forest-300);
}
.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active {
  color: var(--color-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Button styles specifically for navbar */
.btn-navbar {
  background: transparent;
  color: var(--color-on-dark);
  border-color: rgba(255,255,255,0.5);
}
.btn-navbar:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--color-on-dark);
}

.navbar.scrolled .btn-navbar {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.navbar.scrolled .btn-navbar:hover {
  background: var(--stone-100);
}

.lang-toggle {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-default);
}
.lang-toggle .active {
  color: var(--color-on-dark);
  font-weight: 600;
}

.navbar.scrolled .lang-toggle {
  color: var(--color-text-muted);
}
.navbar.scrolled .lang-toggle .active {
  color: var(--color-text-heading);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-on-dark);
  transition: color var(--duration-fast) var(--ease-default);
}
.navbar.scrolled .mobile-menu-btn {
  color: var(--color-text-heading);
}

@media (max-width: 1024px) {
  .navbar { padding: 0 40px; }
  .nav-links { display: none; }
  .nav-actions .btn-navbar, .lang-toggle { display: none; }
  .mobile-menu-btn { display: block; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 24px; height: 56px; }
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('images/hero_desktop.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.65);
}

.hero-topo {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  /* Topographic pattern placeholder SVG or simple CSS pattern */
  background-image: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  padding-bottom: var(--space-12);
}

.hero-heading {
  font-size: var(--text-display);
  font-weight: 600;
  color: var(--color-on-dark);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.hero-body-th {
  font-size: 18px;
  color: var(--color-on-dark);
  margin-bottom: 44px;
}

.hero-cta-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  right: 80px;
  color: var(--color-on-dark);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.hero-scroll-icon {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .hero {
    padding: 100px 24px 60px;
    align-items: flex-start;
    min-height: auto;
  }
  .hero-bg {
    background-image: url('images/hero_mobile.png');
    background-position: top center;
  }
  .hero-content {
    padding-bottom: 0;
  }
  .hero-scroll-indicator {
    display: none;
  }
}

/* =========================================
   Pain Points Section
   ========================================= */
.section-pain {
  background: var(--color-bg-page);
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.pain-card {
  background: transparent;
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 32px 20px 24px;
  text-align: center;
  transition: border-color var(--duration-base) var(--ease-default);
}
.pain-card:hover {
  border-color: var(--forest-400);
}

.pain-image {
  width: 100%;
  max-width: 160px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
}

.pain-title {
  font-size: var(--text-caption);
  font-weight: 500;
  color: var(--color-text-heading);
  margin-bottom: var(--space-2);
}

.pain-desc {
  font-size: 13px;
  color: var(--color-text-body);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .pain-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media (max-width: 480px) {
  .pain-card {
    padding: var(--space-4) var(--space-2);
  }
}

/* =========================================
   Process Steps Section
   ========================================= */
.process-section {
  background-color: #FFFFFF;
  position: relative;
  z-index: 1;
}

.process-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('images/contour_bg.png');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 50% auto;
  opacity: 0.1;
  z-index: -1;
}

.process-layout {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 40px;
  align-items: center;
}

.process-text h2 {
  font-size: var(--text-h2);
  margin-bottom: var(--space-4);
}

.process-text p {
  color: var(--color-text-body);
  margin-bottom: var(--space-6);
}

.process-visual {
  position: relative;
  width: 100%;
  padding-bottom: 80px;
}

.process-images {
  display: flex;
  align-items: flex-end;
  gap: var(--space-6);
  position: relative;
  z-index: 2;
}

.process-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.step-image-wrap {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stone-200);
}

.step-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.step-height-1 { height: 200px; }
.step-height-2 { height: 260px; }
.step-height-3 { height: 320px; }
.step-height-4 { height: 380px; }

.step-label {
  position: absolute;
  bottom: -60px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.step-dot {
  width: 12px;
  height: 12px;
  background: var(--forest-700);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--color-bg-page);
  z-index: 3;
}

.step-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-heading);
  text-align: center;
  white-space: nowrap;
}

.process-curve {
  position: absolute;
  bottom: 50px;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 1;
}

@media (max-width: 768px) {
  .process-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .step-card {
    flex: 0 0 80vw;
  }
}

/* =========================================
   How We Help Section
   ========================================= */
.section-help {
  background: var(--color-bg-page);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: var(--space-12);
}

.help-card {
  background: transparent;
  border: none;
  border-right: 0.5px solid var(--color-border);
  border-radius: 0;
  padding: 0 var(--space-4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.help-card:last-child {
  border-right: none;
}

.help-image {
  height: 160px;
  width: auto;
  margin-bottom: var(--space-4);
}

.help-title {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--color-text-heading);
  margin-bottom: var(--space-3);
}

.help-desc {
  font-size: 13px;
  color: var(--color-text-body);
  line-height: 1.8;
  margin-bottom: var(--space-6);
}

.help-link {
  font-size: 13px;
  color: var(--forest-600);
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 768px) {
  .help-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8) 0;
  }
  .help-card {
    padding: 0 var(--space-2);
  }
  .help-card:nth-child(even) {
    border-right: none;
  }
  .help-card:nth-child(odd) {
    border-right: 0.5px solid var(--color-border);
  }
}

/* =========================================
   CTA Dark Section (Living Legacy)
   ========================================= */
.cta-dark-split {
  display: flex;
  background: var(--forest-700);
  min-height: 500px;
}

.cta-dark-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: max(80px, calc(50vw - 520px));
  padding-right: 40px;
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.cta-dark-content {
  max-width: 460px;
  width: 100%;
}

@media (max-width: 1024px) {
  .cta-dark-left {
    padding-left: max(40px, calc(50vw - 520px));
  }
}

.cta-dark-right {
  flex: 1;
  position: relative;
}

.cta-dark-right img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cta-dark-eyebrow {
  font-size: 12px;
  color: var(--forest-300);
  margin-bottom: var(--space-3);
}

.cta-dark-title {
  font-size: var(--text-h1);
  font-weight: 600;
  color: var(--color-on-dark);
  line-height: 1.25;
  margin-bottom: var(--space-4);
}

.cta-dark-desc {
  font-size: 15px;
  color: #FFFFFF;
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

@media (max-width: 768px) {
  .cta-dark-split {
    flex-direction: column;
  }
  .cta-dark-left {
    justify-content: flex-start;
    padding: var(--space-12) 24px;
  }
  .cta-dark-right {
    min-height: 300px;
  }
}

/* =========================================
   Video CTA Section
   ========================================= */
.video-section {
  background: var(--color-bg-page);
}

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

.video-thumbnail {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 16/9;
  cursor: pointer;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  transition: background var(--duration-base) var(--ease-default);
}

.video-thumbnail:hover .video-play-btn {
  background: rgba(0,0,0,0.2);
}

.video-play-circle {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest-700);
  transition: transform var(--duration-fast) var(--ease-default);
}

.video-thumbnail:hover .video-play-circle {
  transform: scale(1.05);
}

.video-caption {
  font-size: 12px;
  color: var(--stone-400);
  text-align: center;
  margin-top: var(--space-2);
}

@media (max-width: 768px) {
  .video-layout {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* =========================================
   Blog & Knowledge Section
   ========================================= */
.section-blog {
  background: #FFFFFF;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.blog-card {
  background: #FFFFFF;
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-default);
}

.blog-card:hover {
  border-color: var(--forest-400);
}

.blog-thumbnail {
  height: 180px;
  overflow: hidden;
}

.blog-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

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

.blog-body {
  padding: 16px 20px;
}

.blog-badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.badge-article { background: var(--stone-100); color: var(--forest-600); }
.badge-knowledge { background: var(--earth-100); color: var(--earth-700); }
.badge-event { background: var(--stone-200); color: var(--stone-600); }

.blog-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-heading);
  line-height: 1.5;
  margin-bottom: 12px;
}

.blog-date {
  font-size: 12px;
  color: var(--stone-400);
  margin-bottom: 8px;
}

.blog-readmore {
  font-size: 13px;
  color: var(--forest-600);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

/* =========================================
   Footer
   ========================================= */
.footer {
  background: var(--stone-900);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
}

.footer-logo {
  height: 60px;
  width: auto;
  margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
  .footer-logo {
    height: 40px;
  }
}

.footer-brand-desc {
  font-size: 13px;
  color: var(--stone-400);
  line-height: 1.7;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.footer-social a {
  color: var(--stone-400);
  font-size: 20px;
  transition: color var(--duration-fast) var(--ease-default);
}

.footer-social a:hover {
  color: var(--color-on-dark);
}

.footer-col-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--forest-300);
  margin-bottom: 14px;
}

.footer-link {
  display: block;
  font-size: 13px;
  color: var(--stone-400);
  margin-bottom: 8px;
  transition: color var(--duration-fast) var(--ease-default);
}

.footer-link:hover {
  color: var(--forest-300);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.footer-contact-icon {
  font-size: 16px;
  color: var(--forest-500);
  flex-shrink: 0;
  margin-top: 1px;
}

.footer-contact-text {
  font-size: 13px;
  color: var(--stone-400);
  line-height: 1.5;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--stone-600);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .footer-brand-col {
    grid-column: 1 / -1;
  }
  .footer-contact-col {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

/* =========================================
   Animations (Scroll Reveal)
   ========================================= */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

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

/* Stagger children for grid items */
.stagger-1 { transition-delay: 100ms; }
.stagger-2 { transition-delay: 200ms; }
.stagger-3 { transition-delay: 300ms; }
.stagger-4 { transition-delay: 400ms; }

/* Language Toggle Styles */
html[lang="en"] .hide-on-en {
  display: none !important;
}

/* Adjust max-width for English Hero */
html[lang="en"] .hero-content {
  max-width: 800px;
}
