:root {
  --side: #0a3a34; --accent: #1d7a62; --bar: #6cc79a;
  --heading: #14243f; --text: #3d4552; --muted: #6b7380;
  --line: #dfe5e3; --soft: #e6f2ed; --bg: #ffffff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; font-family: "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif; color: var(--text); background: var(--bg); line-height: 1.7; }
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

header.nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
header.nav .wrap { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.brand { font-weight: 700; letter-spacing: .08em; color: var(--heading); text-decoration: none; }
.menu { display: flex; gap: 22px; }
.menu a { color: var(--muted); text-decoration: none; font-size: 15px; }
.menu a:hover { color: var(--accent); }

.hero { background: var(--side); color: #fff; padding: 64px 0 88px; }
.hero .wrap { display: flex; align-items: center; gap: 40px; }
.photo { width: 190px; height: 190px; border-radius: 50%; border: 5px solid #fff; object-fit: cover; flex-shrink: 0; }
.name-en { font-size: clamp(28px, 5vw, 46px); font-weight: 400; letter-spacing: .06em; margin: 0; line-height: 1.2; }
.name-th { font-size: 22px; font-weight: 700; margin: 8px 0 0; }
.role { color: var(--bar); letter-spacing: .04em; margin: 2px 0 22px; font-size: 17px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn.primary { background: var(--bar); color: var(--side); }
.btn.ghost { border: 1.5px solid var(--bar); color: var(--bar); }
.btn:hover { filter: brightness(1.08); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: -40px 0 52px; position: relative; }
.stat { background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(10,58,52,.08); border-radius: 12px; padding: 18px; }
.stat b { display: block; font-size: 24px; color: var(--side); line-height: 1.3; }
.stat span { font-size: 14px; color: var(--muted); }

section { margin-bottom: 52px; }
section > h2 { font-size: 24px; font-weight: 600; color: var(--heading); margin: 0 0 20px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
.summary p { margin: 0 0 10px; font-size: 17px; }

.timeline { border-left: 2px dashed var(--accent); padding-left: 24px; margin-left: 6px; }
.job { position: relative; margin-bottom: 26px; }
.job::before { content: ""; position: absolute; left: -32px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.job .when { font-size: 14px; font-weight: 600; color: var(--heading); }
.job h3 { margin: 2px 0 0; font-size: 18px; color: var(--heading); }
.job .org { color: var(--accent); font-size: 15px; }
.job ul { margin: 8px 0 0; padding-left: 20px; font-size: 15px; color: var(--muted); }
.job li { margin-bottom: 4px; }
.job li b { color: var(--text); font-weight: 600; }
.edu .job h3 { font-size: 17px; }

.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.project { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.project:hover { border-color: var(--accent); transform: translateY(-2px); }
.project h3 { margin: 0 0 4px; font-size: 18px; color: var(--heading); }
.project p { margin: 0; color: var(--muted); font-size: 15px; }
.project .url { color: var(--accent); font-size: 14px; margin-top: 10px; font-weight: 500; }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip { background: var(--soft); color: var(--side); border-radius: 10px; padding: 14px 16px; font-weight: 500; font-size: 15px; border-left: 4px solid var(--bar); }

.certs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cert-group { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cert-group h3 { margin: 0; padding: 10px 16px; font-size: 15px; background: var(--soft); color: var(--accent); }
.cert-group ul { list-style: none; margin: 0; padding: 6px 16px 10px; font-size: 14px; }
.cert-group li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.cert-group li:last-child { border-bottom: 0; }
.cert-group li span { color: var(--muted); white-space: nowrap; }

#contact { background: var(--side); color: #fff; padding: 52px 0; text-align: center; margin: 0; }
#contact h2 { font-size: 26px; font-weight: 600; margin: 0 0 8px; border: 0; }
#contact p { color: #a9c4bc; margin: 0 0 22px; }
#contact .btns { justify-content: center; }
#contact small { display: block; margin-top: 32px; color: #a9c4bc; }

@media (max-width: 760px) {
  .menu { display: none; }
  .wrap { padding: 0 16px; }
  .hero { padding: 44px 0 80px; }
  .hero .wrap { flex-direction: column; text-align: center; gap: 20px; }
  .photo { width: 150px; height: 150px; }
  .btns { justify-content: center; }
  .chips { grid-template-columns: 1fr 1fr; }
  .certs, .projects { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .chips { grid-template-columns: 1fr; }
  .cert-group li { flex-direction: column; gap: 0; }
}

.nav-right { display: flex; align-items: center; gap: 22px; }
.lang { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; border: 1.5px solid var(--accent); border-radius: 999px; padding: 2px 12px; }
.lang:hover { background: var(--accent); color: #fff; }
