/* ===== SAP Agro Intertrade — blue-grey theme ===== */
:root {
  --navy-900: #0e1a2e;
  --navy-800: #14243f;
  --navy-700: #1d3456;
  --blue-600: #2c4a73;
  --slate-500: #5d6b7e;
  --slate-400: #637084;
  --grey-200: #d7dde5;
  --grey-100: #e9edf2;
  --grey-50: #f4f6f9;
  --ink: #1b2330;
  --brass: #b8925a;

  --font-sans: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif Thai", Georgia, "Times New Roman", serif;

  --container: 1180px;
  --radius: 6px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  color: var(--navy-800);
  letter-spacing: -0.005em;
}
h3 { font-size: 1.15rem; font-weight: 600; color: var(--navy-800); }
p { margin: 0 0 1em; }

.container { width: min(var(--container), 100% - 48px); margin-inline: auto; }
.section { padding: clamp(72px, 10vw, 128px) 0; }

.section-label {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--blue-600);
  margin-bottom: 18px;
}
.section-label::before { content: ""; width: 28px; height: 1px; background: var(--brass); }
.section-label.on-dark { color: var(--grey-200); }

.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p:last-child { color: var(--slate-500); }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 14px 28px;
  font: 500 1rem/1.2 var(--font-sans);
  text-decoration: none; border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-light { background: #fff; color: var(--navy-800); }
.btn-light:hover { background: var(--grey-100); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-dark { background: var(--navy-800); color: #fff; }
.btn-dark:hover { background: var(--blue-600); }

/* ===== Brand ===== */
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700; font-size: 1.15rem; letter-spacing: 0.06em;
  padding: 3px 10px 2px; border: 2px solid currentColor; line-height: 1.25;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-en { font-weight: 600; font-size: 0.82rem; letter-spacing: 0.12em; }
.brand-th { font-size: 0.78rem; opacity: .75; }

/* ===== Header ===== */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  color: #fff;
  transition: background .3s, box-shadow .3s, color .3s;
}
.site-header.scrolled {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  color: var(--navy-800);
  box-shadow: 0 1px 0 var(--grey-200);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.site-nav { display: flex; align-items: center; gap: 34px; }
.site-nav a { text-decoration: none; font-size: 0.97rem; opacity: .9; transition: opacity .2s; }
.site-nav a:hover { opacity: 1; }
.nav-cta { padding: 9px 20px; border: 1px solid currentColor; border-radius: var(--radius); }
.site-header.scrolled .nav-cta { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: inherit; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: currentColor; transition: transform .25s, opacity .25s; }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  color: #fff; overflow: hidden;
  padding: calc(var(--header-h) + 40px) 0 clamp(64px, 10vw, 120px);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; z-index: -2; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14,26,46,.55) 0%, rgba(14,26,46,.15) 30%, rgba(14,26,46,.55) 62%, rgba(14,26,46,.92) 100%),
    linear-gradient(90deg, rgba(20,36,63,.55) 0%, rgba(20,36,63,0) 65%);
}
.hero-content { max-width: var(--container); }
.eyebrow { font-size: 0.95rem; letter-spacing: 0.02em; color: var(--grey-200); margin-bottom: 20px; }
.hero h1 {
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.22;
  max-width: 20ch; margin-bottom: 26px;
}
.hero h1 em { font-style: normal; color: #c9d6e8; border-bottom: 3px solid var(--brass); }
.hero .lead { max-width: 560px; font-size: 1.08rem; color: rgba(255,255,255,.85); margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ===== Pillars ===== */
.pillars { background: var(--navy-800); color: #fff; }
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.pillar { padding: 44px 36px 40px; border-left: 1px solid rgba(255,255,255,.12); }
.pillar:first-child { border-left: 0; padding-left: 0; }
.pillar-num { display: block; font-family: Georgia, serif; font-size: 0.9rem; color: var(--brass); margin-bottom: 14px; letter-spacing: .1em; }
.pillar h3 { color: #fff; font-size: 1.2rem; margin-bottom: 10px; }
.pillar p { color: rgba(255,255,255,.7); font-size: 0.96rem; margin: 0; }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 7vw, 96px); align-items: center; }
.about-media { position: relative; margin: 0 0 60px; }
.about-media img:first-child { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); filter: saturate(.85); }
.about-media-inset {
  position: absolute; right: -24px; bottom: -60px;
  width: 46%; aspect-ratio: 3/4; object-fit: cover; object-position: center 45%;
  border: 8px solid #fff; border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(20,36,63,.18);
}
.about-text h2 { margin-bottom: 24px; }
.about-text p { color: #3c4757; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 36px 0 0; border-top: 1px solid var(--grey-200); }
.facts div { padding: 18px 16px 0 0; }
.facts dt { font-size: 0.8rem; color: var(--slate-400); letter-spacing: .06em; }
.facts dd { margin: 4px 0 0; font-weight: 600; color: var(--navy-800); }

/* ===== Vision ===== */
.vision {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(44,74,115,.55), transparent 60%),
    var(--navy-900);
  color: #fff;
  padding: clamp(88px, 12vw, 150px) 0;
}
.vision-inner { text-align: center; }
.vision blockquote {
  margin: 0 auto 72px; max-width: 900px;
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 3.1rem); line-height: 1.45;
}
.mission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: left; border-top: 1px solid rgba(255,255,255,.14); padding-top: 40px; }
.mission-grid h3 { color: #fff; margin-bottom: 8px; }
.mission-grid p { color: rgba(255,255,255,.66); font-size: 0.96rem; margin: 0; }

/* ===== Products ===== */
.products { background: var(--grey-50); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card {
  background: #fff; padding: 34px 28px 30px;
  border: 1px solid var(--grey-200); border-radius: var(--radius);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.product-card:hover { border-color: var(--slate-400); box-shadow: 0 14px 40px rgba(20,36,63,.08); transform: translateY(-3px); }
.product-icon {
  width: 56px; height: 56px; display: grid; place-items: center;
  background: var(--grey-100); border-radius: 50%; margin-bottom: 24px;
}
.product-icon svg { width: 30px; height: 30px; fill: none; stroke: var(--blue-600); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.product-card h3 { margin-bottom: 10px; }
.product-card p { color: var(--slate-500); font-size: 0.95rem; margin: 0; }
.products-cta {
  margin-top: 48px; padding: 30px 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--grey-200); border-radius: var(--radius);
}
.products-cta p { margin: 0; font-size: 1.08rem; font-weight: 500; color: var(--navy-800); }

/* ===== Facility gallery ===== */
.gallery {
  display: grid; gap: 14px;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 280px 280px;
  grid-template-areas:
    "a a a a b b"
    "c c d d e e";
}
.gallery figure { margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--grey-100); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.gallery figure:hover img { transform: scale(1.04); }
.g-a { grid-area: a; } .g-b { grid-area: b; } .g-c { grid-area: c; } .g-d { grid-area: d; } .g-e { grid-area: e; }

/* ===== Contact ===== */
.contact { background: var(--grey-50); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(40px, 6vw, 80px); align-items: stretch; }
.contact-info h2 { margin-bottom: 24px; }
.contact-company { font-weight: 600; color: var(--navy-800); }
.contact-company span { font-weight: 400; color: var(--slate-500); font-size: .92rem; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 36px; border-top: 1px solid var(--grey-200); }
.contact-list li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--grey-200); }
.c-label { color: var(--slate-400); font-size: .9rem; }
.contact-list a { text-decoration: none; color: var(--blue-600); }
.contact-list a:hover { text-decoration: underline; }
.contact-map { min-height: 440px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--grey-200); }
.contact-map iframe { width: 100%; height: 100%; min-height: 440px; border: 0; filter: grayscale(.35) contrast(1.02); }

/* ===== Footer ===== */
.site-footer { background: var(--navy-900); color: rgba(255,255,255,.75); padding: 56px 0 40px; }
.footer-inner { display: grid; gap: 14px; }
.brand-footer { color: #fff; margin-bottom: 8px; }
.footer-addr { margin: 0; font-size: .95rem; }
.footer-copy { margin: 18px 0 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: rgba(255,255,255,.5); }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}
.no-js .reveal { opacity: 1; transform: none; }

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

@media (max-width: 860px) {
  :root { --header-h: 66px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; color: var(--navy-800);
    padding: 8px 24px 24px;
    box-shadow: 0 20px 40px rgba(14,26,46,.15);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--grey-100); }
  .site-nav .nav-cta { margin-top: 16px; text-align: center; background: var(--navy-800); color: #fff; border: 0; }
  .site-header.open { background: #fff; color: var(--navy-800); }
  .site-header.open .site-nav { opacity: 1; transform: none; pointer-events: auto; }
  .site-header.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .pillars-grid { grid-template-columns: 1fr; }
  .pillar, .pillar:first-child { padding: 30px 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .pillar:first-child { border-top: 0; }

  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-media-inset { right: 12px; }
  .mission-grid { grid-template-columns: 1fr; gap: 24px; }
  .hide-sm { display: none; }

  .gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 240px 200px 200px;
    grid-template-areas: "a a" "b c" "d e";
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand-th { display: none; }
  .product-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts div { padding: 14px 0; border-bottom: 1px solid var(--grey-200); }
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: 230px; grid-template-areas: "a" "b" "c" "d" "e"; }
  .products-cta { padding: 24px; }
}
