:root {
  --navy: #161b40;
  --ink: #1d2340;
  --text: #3d4566;
  --muted: #6b7394;
  --bg: #ffffff;
  --bg-alt: #f4f6fb;
  --card: #ffffff;
  --border: #e3e7f2;
  --accent: #4055a9;
  --accent-2: #2bb3a3;
  --line: #c9d0ea;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(22, 27, 64, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef0fa; --text: #c8cde3; --muted: #9aa2c2;
    --bg: #0f1330; --bg-alt: #141a3d; --card: #1a2148; --border: #2a3366;
    --accent: #8fa2ff; --accent-2: #4fd1c1; --line: #36407a;
    --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 "Prompt", "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--accent); margin-bottom: .6em; }
.eyebrow.light { color: #b9c4ff; }
.muted { color: var(--muted); }
.prose { font-size: 1.05rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  background: var(--accent); color: #fff; font-weight: 500;
  padding: .75em 1.4em; border-radius: 999px; border: 2px solid var(--accent);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-light { background: #fff; color: var(--navy); border-color: #fff; }
.btn-small { padding: .45em 1em; font-size: .9rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .6em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 1.1rem; }
.brand small { font-size: .72rem; color: var(--muted); }
.menu { display: flex; align-items: center; gap: 1.4em; }
.menu a:not(.btn) { color: var(--text); font-weight: 500; font-size: .95rem; }
.menu a:not(.btn):hover { color: var(--accent); text-decoration: none; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* Hero */
.hero { padding: 72px 0 40px; background:
  radial-gradient(1000px 400px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
  radial-gradient(700px 300px at -10% 110%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.lead { font-size: 1.2rem; max-width: 38ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--border); background: var(--card); padding: .3em .9em; border-radius: 999px; font-size: .85rem; color: var(--muted); }
.hero-art { display: flex; justify-content: center; }
.pixel { image-rendering: pixelated; }
.hero-logo { width: 100%; max-width: 460px; height: auto; }
@media (prefers-color-scheme: dark) {
  /* navy wordmark needs a light backdrop in dark mode */
  .hero-logo { background: #fff; border-radius: var(--radius); padding: 18px 22px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 48px; }
.stats div { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stats strong { display: block; font-size: 1.8rem; color: var(--ink); line-height: 1.1; }
.stats span { color: var(--muted); font-size: .9rem; }

/* Sections */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-alt); }
.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }

.cards { display: grid; gap: 20px; margin-top: 32px; }
.cards.research { grid-template-columns: repeat(2, 1fr); }
.cards.services { grid-template-columns: repeat(4, 1fr); }
.card, .svc, .person {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.num { font-weight: 700; color: var(--line); font-size: 1.6rem; }
.tag { font-size: .75rem; font-weight: 600; padding: .25em .75em; border-radius: 999px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }
.tag-live { color: #0f7a6d; background: #e2f7f4; border-color: #bdeee6; }
@media (prefers-color-scheme: dark) { .tag-live { color: #7ee6d8; background: #12383a; border-color: #1f5557; } }
.kicker { font-size: .82rem; color: var(--accent); font-weight: 600; margin-bottom: .3em; }
.link { font-weight: 500; }
.svc-ico { font-size: 1.8rem; display: block; margin-bottom: 10px; }
.svc p { margin: 0; font-size: .95rem; }

/* Team */
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.person { display: flex; flex-direction: column; }
.person p { font-size: .94rem; }
.person .link { margin-top: auto; }
.role { color: var(--accent); font-weight: 500; font-size: .9rem !important; margin-bottom: .6em; }
.lead-person { grid-column: 1 / -1; flex-direction: row; gap: 24px; align-items: center; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; flex: none; margin-bottom: 14px;
  display: grid; place-items: center; font-weight: 600; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.lead-person .avatar { width: 112px; height: 112px; font-size: 1.9rem; margin: 0; }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.pubs li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.pubs .year { font-weight: 700; color: var(--accent); }
.pubs a { color: var(--ink); font-weight: 500; }
.pubs a:hover { color: var(--accent); }
.pubs p { margin: .3em 0 0; color: var(--muted); font-size: .9rem; }

/* Banner */
.banner { background: linear-gradient(120deg, var(--navy), #2a3488); color: #dfe4ff; }
.banner h2 { color: #fff; }
.banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.banner p { max-width: 60ch; margin: 0; }

/* Contact */
.contact-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.mail { font-size: 1.3rem; font-weight: 600; display: inline-block; margin-bottom: 12px; word-break: break-all; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .88rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { color: var(--muted); }

/* Responsive */
@media (max-width: 960px) {
  .cards.services { grid-template-columns: repeat(2, 1fr); }
  .team { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .menu {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; display: none;
  }
  .menu.open { display: flex; }
  .menu a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .menu .btn { margin-top: 12px; justify-content: center; }
  .hero { padding-top: 40px; }
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { justify-content: flex-start; }
  .hero-logo { max-width: 300px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards.research, .cards.services, .team { grid-template-columns: 1fr; }
  .lead-person { flex-direction: column; align-items: flex-start; }
  .lead-person .avatar { width: 88px; height: 88px; }
  .banner-inner { flex-direction: column; align-items: flex-start; }
  .section { padding: 60px 0; }
  .pubs li { grid-template-columns: 1fr; gap: 4px; }
}
