:root {
  --black: #060E08;
  --deep: #0A1F12;
  --forest: #1B4332;
  --emerald: #2D6A4F;
  --mint: #52B788;
  --gold: #C9960E;
  --gold-bright: #F0B429;
  --gold-glow: #FFD166;
  --cream: #FDF8EE;
  --cream2: #F0E8D0;
  --ink: #14261C;
  --muted: rgba(253, 248, 238, 0.68);
  --line: rgba(255, 255, 255, 0.12);
  --card: rgba(255, 255, 255, 0.04);
  --r: 16px;
  --r2: 24px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  font-family: "Sarabun", sans-serif;
  background: var(--deep);
  color: var(--cream);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}

.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
#load-status.is-error { color: #fca5a5; }

/* NAV */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(6, 14, 8, 0.78);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.site-nav.scrolled { border-bottom-color: rgba(201,150,14,.25); background: rgba(6,14,8,.92); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--deep); font-size: 20px;
  box-shadow: 0 0 18px rgba(201,150,14,.35);
}
.brand-text strong {
  display: block; font-family: "Kanit", sans-serif; font-size: 16px; font-weight: 700;
}
.brand-text span { display: block; font-size: 11px; color: var(--gold-bright); letter-spacing: .4px; }
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: rgba(253,248,238,.82); transition: .2s;
}
.nav-links a:hover { color: var(--gold-bright); background: rgba(240,180,41,.08); }
.nav-cta {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright)) !important;
  color: var(--deep) !important; font-weight: 800 !important;
}
.nav-toggle {
  display: none; border: 1px solid var(--line); background: transparent; color: var(--cream);
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
.mob-panel {
  display: none; border-top: 1px solid var(--line); padding: 12px 0 18px;
}
.mob-panel.open { display: grid; gap: 8px; }
.mob-panel a {
  padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04);
  font-weight: 600;
}

/* HERO */
.hero {
  position: relative; min-height: clamp(560px, 88vh, 760px);
  display: grid; align-items: end; overflow: hidden;
}
.hero-bg, .hero-overlay {
  position: absolute; inset: 0;
}
.hero-bg {
  background: center/cover no-repeat var(--forest);
  transform: scale(1.02);
}
.hero-overlay {
  background:
    linear-gradient(90deg, rgba(6,14,8,.88) 0%, rgba(6,14,8,.62) 48%, rgba(6,14,8,.28) 100%),
    linear-gradient(180deg, rgba(6,14,8,.25) 0%, rgba(6,14,8,.78) 100%);
}
.hero-content {
  position: relative; z-index: 1; padding: 110px 0 72px;
  max-width: 720px;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(45,106,79,.55); border: 1px solid rgba(82,183,136,.35);
  color: #d8ffe8; font-size: 13px; font-weight: 700; margin-bottom: 18px;
}
.hero h1 {
  font-family: "Kanit", sans-serif;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.15; font-weight: 800; margin-bottom: 16px;
}
.hero-lead {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--muted); max-width: 58ch; margin-bottom: 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 800; border: none; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--emerald), #1B7A4A);
  color: #fff; box-shadow: 0 10px 28px rgba(45,106,79,.35);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--deep); box-shadow: 0 10px 28px rgba(201,150,14,.35);
}
.btn-ghost {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--cream);
}
.pillars {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px;
}
.pillar {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 14px 12px; text-align: center;
}
.pillar-icon { font-size: 22px; margin-bottom: 6px; }
.pillar-label { font-size: 13px; font-weight: 700; color: #e9fff2; }

/* SECTIONS */
section { padding: 72px 0; }
.sec-head { text-align: center; margin-bottom: 36px; }
.eyebrow {
  display: inline-block; margin-bottom: 12px;
  padding: 5px 14px; border-radius: 999px;
  background: rgba(201,150,14,.1); border: 1px solid rgba(201,150,14,.3);
  color: var(--gold-bright); font-size: 11px; font-weight: 800; letter-spacing: 2px;
}
.sec-title {
  font-family: "Kanit", sans-serif;
  font-size: clamp(28px, 4vw, 40px); font-weight: 800; margin-bottom: 12px;
}
.sec-title .g {
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-glow));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sec-desc { color: var(--muted); max-width: 62ch; margin: 0 auto; }
.divider {
  width: 52px; height: 3px; margin: 16px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--mint));
}

/* STATS */
.stats {
  background: linear-gradient(180deg, rgba(27,67,50,.35), transparent);
  padding-top: 28px; padding-bottom: 20px;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r2); padding: 22px 18px; text-align: center;
}
.stat-num {
  font-family: "Kanit", sans-serif; font-size: 40px; font-weight: 900;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-glow));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat-label { margin-top: 8px; font-size: 14px; color: var(--muted); font-weight: 600; }

/* TOOLBAR */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  align-items: center; margin-bottom: 22px;
}
.search-box {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.28); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 16px;
}
.search-box:focus-within {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(240,180,41,.15);
}
.search-box input {
  flex: 1; background: transparent; border: none; color: var(--cream); outline: none;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: rgba(253,248,238,.85); border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; cursor: pointer; transition: .2s;
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(240,180,41,.14);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

/* CARDS */
.works-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px;
}
.work-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: transform .25s, border-color .25s;
}
.work-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--cc) 55%, white 10%); }
.work-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #123; }
.work-media img { width: 100%; height: 100%; object-fit: cover; }
.work-num {
  position: absolute; top: 12px; left: 12px;
  min-width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px;
}
.work-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.work-title {
  font-family: "Kanit", sans-serif; font-size: 20px; font-weight: 700; line-height: 1.3;
}
.work-audience { font-size: 12px; font-weight: 700; color: var(--gold-bright); }
.work-desc { color: var(--muted); font-size: 14.5px; flex: 1; }
.work-tasks { list-style: none; display: grid; gap: 6px; }
.work-tasks li {
  position: relative; padding-left: 18px; font-size: 13.5px; color: rgba(253,248,238,.82);
}
.work-tasks li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--cc);
}
.work-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.work-actions .btn { padding: 10px 16px; font-size: 13px; }

/* STORIES */
.stories-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px;
}
.story-card {
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; transition: transform .2s;
}
.story-card:hover { transform: translateY(-3px); }
.story-card img { aspect-ratio: 16/11; width: 100%; object-fit: cover; }
.story-body { padding: 16px 18px 20px; }
.story-date { font-size: 12px; color: var(--gold-bright); font-weight: 700; margin-bottom: 6px; }
.story-title { font-family: "Kanit", sans-serif; font-size: 18px; margin-bottom: 8px; }
.story-summary { color: var(--muted); font-size: 14px; }

/* DOCS */
.docs-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px;
}
.doc-card {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px;
}
.doc-type {
  display: inline-block; margin-bottom: 10px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  background: rgba(82,183,136,.15); color: #9af0c2;
}
.doc-card h3 { font-family: "Kanit", sans-serif; font-size: 17px; margin-bottom: 8px; }
.doc-card p { color: var(--muted); font-size: 14px; }

/* CONTACT */
.contact-wrap {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px;
}
.contact-card, .contact-aside {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 24px;
}
.contact-list { display: grid; gap: 12px; margin-top: 16px; }
.contact-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.2);
}
.contact-item span { font-size: 20px; }
.contact-item strong { display: block; font-size: 13px; color: var(--gold-bright); }
.contact-aside h3 { font-family: "Kanit", sans-serif; margin-bottom: 10px; }
.contact-aside p { color: var(--muted); margin-bottom: 16px; }
.socials { display: grid; gap: 10px; }
.socials a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px; font-weight: 700;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
.socials a:hover { border-color: var(--gold-bright); color: var(--gold-bright); }

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--line); padding: 28px 0 40px; text-align: center;
  color: rgba(253,248,238,.55); font-size: 14px;
}
.site-footer strong { color: var(--cream); }
.site-footer a { color: var(--gold-bright); }

/* MODAL */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
  width: min(920px, 100%); max-height: min(88vh, 900px);
  overflow: auto; background: #0d2418; border: 1px solid rgba(240,180,41,.25);
  border-radius: 22px; box-shadow: var(--shadow);
}
.modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: rgba(13,36,24,.96);
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-family: "Kanit", sans-serif; font-size: 20px; }
.modal-close {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: #fff; font-size: 22px; cursor: pointer;
}
.modal-body { padding: 18px; }
.modal-cover {
  border-radius: 16px; overflow: hidden; margin-bottom: 16px; aspect-ratio: 21/9;
  background: #123;
}
.modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
}
.modal-desc { color: var(--muted); margin-bottom: 18px; }
.modal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px;
}
.panel {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.panel h4 { font-family: "Kanit", sans-serif; margin-bottom: 10px; color: var(--gold-bright); }
.panel ul { padding-left: 18px; display: grid; gap: 6px; color: rgba(253,248,238,.88); }
.act-grid { display: grid; gap: 12px; }
.act-item {
  display: grid; grid-template-columns: 160px 1fr; gap: 14px;
  background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.act-item img { width: 100%; height: 100%; min-height: 110px; object-fit: cover; }
.act-info { padding: 12px 12px 14px; }
.act-info h5 { font-family: "Kanit", sans-serif; font-size: 16px; margin-bottom: 4px; }
.act-info .date { font-size: 12px; color: var(--gold-bright); font-weight: 700; margin-bottom: 6px; }
.act-info p { color: var(--muted); font-size: 14px; }
.empty {
  text-align: center; padding: 28px 16px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 14px;
}

/* REVEAL */
.reveal { opacity: 0; transform: translateY(18px); transition: .6s ease; }
.reveal.up { opacity: 1; transform: none; }

/* PRINT */
@media print {
  .site-nav, .nav-toggle, .hero-actions, .toolbar, .modal, .btn { display: none !important; }
  body { background: #fff; color: #111; }
  .hero { min-height: auto; }
  .hero-overlay { background: rgba(0,0,0,.35); }
  .work-card, .story-card, .doc-card, .contact-card, .contact-aside {
    break-inside: avoid; box-shadow: none; border-color: #ddd; background: #fff; color: #111;
  }
  .work-desc, .sec-desc, .story-summary, .doc-card p { color: #333; }
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .works-grid, .stories-grid, .docs-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pillars { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .contact-wrap, .modal-grid { grid-template-columns: 1fr; }
  .act-item { grid-template-columns: 120px 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .works-grid, .stories-grid, .docs-grid, .stats-grid { grid-template-columns: 1fr; }
  .hero-content { padding: 96px 0 56px; }
  .act-item { grid-template-columns: 1fr; }
  .act-item img { aspect-ratio: 16/10; min-height: 0; }
}
