@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800;900&family=Sarabun:wght@300;400;500;600&family=JetBrains+Mono:wght@500&display=swap');

:root {
  /* ── Backgrounds ── */
  --white:      #FFFFFF;
  --bg:         #F7F6F4;
  --bg-2:       #F0EDE8;
  --surface:    #FFFFFF;
  --surface-2:  #FAFAF9;

  /* ── Accent ── */
  --accent:     #D4703A;
  --accent-dk:  #B85E2A;
  --accent-lt:  #F0E6DD;
  --accent-xlt: #FBF4EF;

  /* ── Text ── */
  --ink:        #1A1714;
  --ink-md:     #52504C;
  --ink-lt:     #8C8880;
  --ink-xlt:    #C4C0BA;

  /* ── Borders ── */
  --border:      #E8E4DE;
  --border-md:   #D4CFC8;
  --border-dk:   #B8B2A8;

  /* ── Shadows ── */
  --shadow-sm:  0 1px 3px rgba(26,23,20,.06), 0 1px 2px rgba(26,23,20,.04);
  --shadow-md:  0 4px 16px rgba(26,23,20,.08), 0 1px 4px rgba(26,23,20,.04);
  --shadow-lg:  0 12px 40px rgba(26,23,20,.10), 0 2px 8px rgba(26,23,20,.05);
  --shadow-xl:  0 24px 64px rgba(26,23,20,.12), 0 4px 16px rgba(26,23,20,.06);

  /* ── Radii ── */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* ── Easing ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ── Typography ── */
  --font-display: 'Kanit', sans-serif;
  --font-body: 'Sarabun', sans-serif;

  /* ── Type scale ── */
  --text-hero: clamp(44px, 5.5vw, 78px);
  --text-section-title: clamp(28px, 3vw, 42px);
  --text-card-title: 22px;
  --text-why-title: 19px;
  --text-step-title: 18px;
  --text-body: 15px;
  --text-body-sm: 14px;
  --text-caption: 13px;
  --text-label: 11px;
  --text-tag: 10px;

  /* ── Spacing ── */
  --space-stack-xl: 120px;
  --space-stack-md: 64px;
  --space-margin-desktop: 80px;
  --space-margin-mobile: 24px;

  /* ── Backward-compat aliases for Phase 2C components ── */
  --color-copper: var(--accent);
  --color-charcoal: var(--ink);
  --color-white: var(--white);
  --color-slate: var(--ink-lt);
  --color-concrete: #D1D1D1;
  --color-off-white: var(--surface-2);
  --surface-container: var(--bg-2);
  --on-surface: var(--ink);
  --on-surface-variant: var(--ink-md);
  --outline: var(--border-md);
  --outline-variant: var(--border);
  --font-mono: 'JetBrains Mono', monospace;
  --border-radius: var(--radius-sm);
  --border-width: 1px;
  --border-width-ghost: 2px;
  --border-color: var(--border-md);
  --shadow-card: var(--shadow-md);
  --shadow-card-hover: var(--shadow-lg);
}

/* ── Mobile token overrides ── */
@media (max-width: 768px) {
  :root {
    --space-stack-xl: 72px;
    --space-margin-desktop: var(--space-margin-mobile);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: var(--text-hero);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.02em;
}

h2 {
  font-size: var(--text-section-title);
  font-weight: 800;
  line-height: 1.15;
}

h3 {
  font-size: var(--text-card-title);
  font-weight: 700;
  line-height: 1.3;
}

p {
  font-size: var(--text-body);
  line-height: 1.75;
  color: var(--ink-md);
}

/* ── Container ── */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

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

/* ── Reveal animation (IntersectionObserver) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ── Eyebrow label ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent);
}

/* ── Section title ── */
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-section-title);
  line-height: 1.15;
  color: var(--ink);
}

/* ── Pill / tag ── */
.pill {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--border-md);
  color: var(--ink-md);
  background: white;
  transition: all .2s;
  cursor: default;
  display: inline-block;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-xlt);
}

/* ── Buttons ── */
.btn-fill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  background: var(--accent);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(212,112,58,.35);
  transition: background .2s, transform .2s, box-shadow .2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-fill:hover {
  background: var(--accent-dk);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,112,58,.4);
}

.btn-fill svg,
.btn-line svg {
  flex-shrink: 0;
}

.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  border: 1.5px solid var(--border-md);
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  background: white;
  transition: border-color .2s, color .2s, transform .2s;
  cursor: pointer;
  text-decoration: none;
}

.btn-line:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ── Chip (technical label, backward-compat with Phase 2C TechnicalChip.astro) ── */
.chip {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--color-charcoal);
  color: var(--color-white);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.chip--copper {
  background: var(--accent);
  color: white;
}

.chip--outline {
  background: transparent;
  color: var(--color-charcoal);
  border: 1.5px solid var(--color-slate);
}

/* ── Form styles ── */
.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-md);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.form-input::placeholder {
  color: var(--ink-xlt);
}

.form-input:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(212,112,58,.12);
}

select.form-input {
  cursor: pointer;
}

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

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

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

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent);
  transform: translateY(-4px);
}

/* ── Section background banding ── */
.section-light {
  background: var(--bg);
}

.section-white {
  background: var(--white);
}

/* ── NAV ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--white);
  transition: box-shadow .3s;
}
#nav.scrolled {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}
.nav-inner {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
}
.nav-logo img { height: 28px; width: auto; }
.nav-logo-label {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  letter-spacing: .04em; color: var(--ink);
}
.nav-logo-label em { font-style: normal; color: var(--accent); }
.nav-links {
  display: flex; align-items: center; gap: 32px;
}
.nav-links a {
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  color: var(--ink-md); letter-spacing: .02em;
  transition: color .15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  padding: 9px 20px; border-radius: var(--radius-sm);
  transition: all .2s;
}
.nav-btn-ghost {
  border: 1.5px solid var(--border-md); color: var(--ink-md);
  background: transparent;
}
.nav-btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-xlt); }
.nav-btn-solid {
  background: var(--accent); color: white;
  box-shadow: 0 2px 8px rgba(212,112,58,.3);
}
.nav-btn-solid:hover { background: var(--accent-dk); box-shadow: 0 4px 16px rgba(212,112,58,.4); }
.lang-switch { min-width: 44px; text-align: center; font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

/* ── FOOTER ── */
#footer {
  background: var(--ink); color: rgba(255,255,255,.75);
  padding: 72px 0 36px;
}
.footer-grid {
  display: grid; grid-template-columns: 2.5fr 1fr 1fr 1fr; gap: 64px;
  margin-bottom: 56px;
}
.footer-logo-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer-logo-wrap img { height: 26px; width: auto; }
.footer-logo-name {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: white; letter-spacing: .04em;
}
.footer-desc { font-size: 14px; line-height: 1.75; color: rgba(255,255,255,.55); max-width: 300px; margin-bottom: 24px; }
.footer-socials { display: flex; gap: 8px; }
.footer-social {
  width: 36px; height: 36px; border-radius: var(--radius-xs);
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.55); transition: all .2s;
}
.footer-social:hover { border-color: var(--accent); background: var(--accent); color: white; }
.footer-col-title {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase;
  color: white; margin-bottom: 20px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,.5); transition: color .15s; }
.footer-links a:hover { color: white; }
.footer-addr { font-size: 14px; color: rgba(255,255,255,.5); line-height: 1.8; }
.footer-addr-sm { font-size: 13px; color: rgba(255,255,255,.38); line-height: 1.9; margin-top: 0; }
.footer-addr-sm a { color: inherit; text-decoration: none; }
.footer-addr-sm a:hover { color: rgba(255,255,255,.7); }
.footer-service-area { margin-top: 20px; }
.footer-service-area .footer-col-title { margin-bottom: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.footer-copy { font-size: 13px; color: rgba(255,255,255,.35); }
.footer-badges { display: flex; gap: 8px; }
.footer-badge {
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-xs);
  border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.4);
}

/* ── BACK TO TOP ── */
#backtop {
  position: fixed; bottom: 28px; right: 28px; z-index: 99;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(212,112,58,.4);
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
}
#backtop.show { opacity: 1; pointer-events: all; }
#backtop:hover { transform: translateY(-3px); }

/* ── Nav toggle (hamburger) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s;
}

/* ── Nav drawer ── */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 80vw;
  height: 100vh;
  background: var(--white);
  z-index: 210;
  transform: translateX(100%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-shadow: -4px 0 24px rgba(0,0,0,.1);
  overflow-y: auto;
}
.nav-drawer.open {
  transform: translateX(0);
}
.nav-drawer-close {
  align-self: flex-end;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-md);
  margin-bottom: 24px;
}
.nav-drawer-close:hover {
  color: var(--ink);
}
.nav-drawer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-drawer-links a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  transition: color .15s;
}
.nav-drawer-links a:hover {
  color: var(--accent);
}
.nav-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-drawer-actions .nav-btn {
  text-align: center;
}

/* ── Nav overlay ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 205;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.nav-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* ── Responsive nav / footer ── */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-actions .nav-btn-ghost { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ── Animation keyframes ── */
@keyframes up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
