:root {
  --transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
img { max-width: 100%; }
body.lang-th, body.lang-th * { font-family: 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  transition: var(--transition);
  overflow-x: hidden;
  max-width: 100vw;
}

/* ============ THEME A: LIGHT, BLUE ACCENT (unused by default, kept for reference) ============ */
[data-theme="a"] {
  --bg: #fbfbfd; --bg2: #f5f5f7; --text: #1d1d1f; --muted: #6e6e73; --muted2: #86868b;
  --line: #d2d2d7; --accent: #0071e3; --accent-text: #ffffff; --card: #ffffff;
}
/* ============ THEME B: DARK, WHITE ACCENT ============ */
[data-theme="b"] {
  --bg: #000000; --bg2: #111113; --text: #f5f5f7; --muted: #a1a1a6; --muted2: #86868b;
  --line: #2a2a2c; --accent: #ff4d1c; --accent-text: #ffffff; --card: #0a0a0c;
}
/* ============ THEME C: LIGHT, ORANGE ACCENT (default) ============ */
[data-theme="c"] {
  --bg: #ffffff; --bg2: #f7f6f4; --text: #111111; --muted: #6e6e73; --muted2: #86868b;
  --line: #e2e2e2; --accent: #ff4d1c; --accent-text: #ffffff; --card: #ffffff;
}

/* ============ HEADER / NAV ============ */
header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 20px 48px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; color: var(--text); text-decoration: none; }
.logo-img { height: 46px; width: auto; display: block; transition: filter 0.2s ease; }
[data-theme="b"] .logo-img { filter: invert(1) brightness(1.15); }
nav.main-nav { display: flex; align-items: center; gap: 36px; }
nav.main-nav a { font-size: 17px; font-weight: 500; color: var(--muted); text-decoration: none; cursor: pointer; }
nav.main-nav a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.lang-select { display: flex; gap: 6px; font-size: 12px; }
.lang-select button { border: none; background: transparent; color: var(--muted2); cursor: pointer; font-family: inherit; padding: 0; }
.lang-select button.active { color: var(--text); font-weight: 600; }
.icon-toggle { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-toggle svg { width: 15px; height: 15px; stroke: var(--muted); }
.btn-nav-cta { position: relative; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 11px 18px; border-radius: 980px; text-decoration: none; white-space: nowrap; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease; animation: ctaPulse 2.8s ease-in-out infinite; }
.btn-nav-cta svg { transition: transform 0.25s ease; }
.btn-nav-cta:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(255,77,28,0.4); animation-play-state: paused; }
.btn-nav-cta:hover svg { transform: translateX(4px); }
.btn-nav-cta:active { transform: scale(0.97); }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,28,0.45); }
  50% { box-shadow: 0 0 0 9px rgba(255,77,28,0); }
}
@media (prefers-reduced-motion: reduce) { .btn-nav-cta { animation: none; } }

/* Hamburger button — hidden on desktop, shown on mobile */
.hamburger-btn { display: none; width: 36px; height: 36px; border: none; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.hamburger-btn span { display: block; width: 22px; height: 2px; background: var(--text); transition: transform 0.25s ease, opacity 0.25s ease; }
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; position: fixed; inset: 0; top: 73px; z-index: 99; background: var(--bg); flex-direction: column; padding: 32px 24px; overflow-y: auto; }
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 22px; font-weight: 500; color: var(--text); text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mobile-menu-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 20px; }
.mobile-menu-controls .lang-select { font-size: 15px; gap: 10px; }

/* ============ TYPOGRAPHY / LAYOUT PRIMITIVES ============ */
section { padding: 120px 48px; border-bottom: 1px solid var(--line); }
.inner { max-width: 980px; margin: 0 auto; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 20px; }
h1 { font-size: clamp(38px, 4.8vw, 60px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 22px; color: var(--text); }
h2 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 20px; color: var(--text); }
section p.sub { font-size: 16px; color: var(--muted); max-width: 560px; line-height: 1.65; }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 16px 34px; border-radius: 980px; background: var(--accent); color: var(--accent-text); font-size: 15px; font-weight: 500; text-decoration: none; border: none; cursor: pointer; font-family: inherit; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease; animation: ctaPulse 2.8s ease-in-out infinite; }
.btn:hover { transform: scale(1.05); box-shadow: 0 8px 24px rgba(255,77,28,0.4); animation-play-state: paused; }
.btn:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .btn { animation: none; } }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--text); }

/* ============ PAGE HERO (used by About / Who I Work With / What You Get) ============ */
.page-hero { padding: 160px 48px 80px; text-align: center; }
.page-hero .eyebrow { text-align: center; }

/* ============ FOOTER ============ */
footer { background: #0b0b0b; color: #fff; padding: 64px 48px 32px; }
footer .logo-img { filter: invert(1) brightness(1.15); }
.footer-top { max-width: 980px; margin: 0 auto 40px; }
.footer-tagline { font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 14px; max-width: 320px; }
.footer-email-btn { position: relative; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--accent); color: var(--accent); font-size: 14px; padding: 12px 20px; border-radius: 980px; text-decoration: none; margin-bottom: 20px; transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease; animation: emailPulse 2.8s ease-in-out infinite; }
.footer-email-btn svg { transition: transform 0.3s ease; }
.footer-email-btn:hover { background: var(--accent); color: #fff; transform: scale(1.05); box-shadow: 0 8px 24px rgba(255,77,28,0.35); animation-play-state: paused; }
.footer-email-btn:hover svg { transform: translateY(-2px) rotate(-6deg); }
.footer-email-btn:active { transform: scale(0.97); }
@keyframes emailPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,28,0.35); }
  50% { box-shadow: 0 0 0 8px rgba(255,77,28,0); }
}
@media (prefers-reduced-motion: reduce) { .footer-email-btn { animation: none; } }
.footer-social { display: flex; gap: 10px; }
.footer-social-icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); display: flex; align-items: center; justify-content: center; text-decoration: none; }
.footer-divider { display: flex; align-items: center; gap: 18px; max-width: 980px; margin: 0 auto 40px; }
.footer-divider-line { flex: 1; height: 1px; background: rgba(255,255,255,0.14); }
.footer-divider-bolt { width: 10px; height: 22px; flex-shrink: 0; fill: rgba(255,255,255,0.4); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: 980px; margin: 0 auto 40px; }
.footer-col-title { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 14px; color: rgba(255,255,255,0.45); }
.footer-col p, .footer-col a { display: block; font-size: 14px; color: rgba(255,255,255,0.85); text-decoration: none; margin-bottom: 10px; }
.footer-bottom { max-width: 980px; margin: 0 auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.12); display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,0.4); }
.footer-credit-shimmer {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.4) 45%, var(--accent) 50%, rgba(255,255,255,0.4) 55%, rgba(255,255,255,0.4) 100%);
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  background-clip: text; -webkit-background-clip: text;
  animation: footerShimmer 9s linear infinite;
  transition: filter 0.3s ease;
  position: relative;
}
.footer-credit-shimmer:hover { filter: drop-shadow(0 0 6px rgba(255,77,28,0.5)); animation-play-state: paused; }
@keyframes footerShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .footer-credit-shimmer { animation: none; }
}

@media (max-width: 900px) {
  nav.main-nav { display: none; }
  .nav-right .lang-select, .nav-right .icon-toggle, .nav-right .btn-nav-cta { display: none; }
  .hamburger-btn { display: flex; }
  header { padding: 16px 20px; }
  section { padding: 72px 20px; }
  .page-hero { padding: 120px 20px 56px; }

  /* ---- Footer: compact mobile layout ---- */
  footer { padding: 48px 20px calc(24px + env(safe-area-inset-bottom)); }
  .footer-top { margin-bottom: 24px; }
  .footer-top .logo { margin-bottom: 18px; }
  .footer-tagline { margin-bottom: 12px; max-width: none; }
  .footer-tagline:last-of-type { margin-bottom: 20px; }
  .footer-email-btn { max-width: 100%; white-space: normal; word-break: break-word; margin-bottom: 16px; }
  .footer-social { gap: 12px; }
  .footer-divider { margin: 0 auto 24px; }
  .footer-grid {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
    gap: 24px 20px;
    margin: 0 auto 24px;
  }
  .footer-col:nth-child(1) { order: 1; }
  .footer-col:nth-child(3) { order: 2; }
  .footer-col:nth-child(2) {
    order: 3;
    grid-column: 1 / -1;
    margin-top: 24px;
  }
  .footer-grid .footer-col-title { font-size: 12px; letter-spacing: 0.06em; margin-bottom: 12px; }
  .footer-col a { font-size: 15px; line-height: 1.4; padding: 6px 0; margin-bottom: 0; }
  .footer-col:nth-child(2) p { font-size: 14px; line-height: 1.5; margin-bottom: 4px; }
  .footer-col:nth-child(2) p:last-child { margin-bottom: 0; }
  .footer-bottom { flex-direction: column; gap: 7px; text-align: center; font-size: 12.5px; }
}

/* ============ SCROLL REVEAL: fade up on entering viewport ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-group > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-group > .reveal:nth-child(2) { transition-delay: 90ms; }
.reveal-group > .reveal:nth-child(3) { transition-delay: 180ms; }
.reveal-group > .reveal:nth-child(4) { transition-delay: 270ms; }
.reveal-group > .reveal:nth-child(5) { transition-delay: 360ms; }
.reveal-group > .reveal:nth-child(6) { transition-delay: 450ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
