/* =========================================================
   Sikarin Yoo-Kong — redesign prototype
   Design tokens + components (single stylesheet)
   ========================================================= */

:root {
  /* --- Color: academic navy, warm brass accent, cool paper --- */
  --navy-900: #181C62;   /* โทนเดียวกับ footer ของเว็บตัวอย่าง PIPC */
  --navy-700: #262E8C;
  --navy-500: #3F4ABE;
  --navy-300: #8E96DE;
  /* accent: deep crimson (was brass) — token name kept so components stay unchanged */
  --brass:    #C4362F;
  --brass-soft: #FBE6E2;

  --paper:    #FAF9F6;
  --surface:  #FFFFFF;
  --surface-2:#F2F2F7;
  --ink:      #14172E;
  --heading:  #1B2158;   /* สีหัวข้อและพาดหัว */
  --muted:    #565C7D;
  --line:     #DFDFEA;

  --bg:        var(--paper);
  --fg:        var(--ink);
  --accent:    var(--navy-700);
  --accent-fg: #FFFFFF;
  --link:      var(--navy-500);

  /* --- Type --- */
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", "IBM Plex Sans Thai", "Noto Sans Thai",
          system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* --- Diagram (hero figure) --- */
  --dia-a: #3F4ABE;
  --dia-b: #C4362F;
  --dia-c: #8E96DE;

  /* --- Space / shape --- */
  --gut: clamp(16px, 4vw, 48px);
  --maxw: 1320px;   /* ความกว้างมาตรฐานของทุกหน้า */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 19, 56, .06), 0 8px 24px rgba(15, 19, 56, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:    #0B0E26;
    --surface:  #131734;
    --surface-2:#1B2047;
    --ink:      #E9EAF4;
    --heading:  #E9EAF4;
    --muted:    #A3A8C6;
    --line:     #2B3162;
    --brass:    #F09088;
    --brass-soft: #3B1C23;
    --dia-a: #8E96EC;
    --dia-b: #F09088;
    --dia-c: #A9B0FF;

    --bg: var(--paper);
    --fg: var(--ink);
    --accent: #C7CBFF;
    --accent-fg: #0B0E26;
    --link: #A9B0FF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --paper:    #0B0E26;
  --surface:  #131734;
  --surface-2:#1B2047;
  --ink:      #E9EAF4;
  --heading:  #E9EAF4;
  --muted:    #A3A8C6;
  --line:     #2B3162;
  --brass:    #F09088;
  --brass-soft: #3B1C23;
  --dia-a: #8E96EC;
  --dia-b: #F09088;
  --dia-c: #A9B0FF;

  --bg: var(--paper);
  --fg: var(--ink);
  --accent: #C7CBFF;
  --accent-fg: #0B0E26;
  --link: #A9B0FF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

html body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 { color: var(--heading); font-family: var(--display); font-weight: 600; line-height: 1.18; text-wrap: balance; }
/* WordPress: reset margins only inside the prototype components, so normal page content keeps its paragraph spacing */
.syk-ui :where(h1, h2, h3, h4, p) { margin: 0; }
h1 { font-size: clamp(2.1rem, 4vw, 3.5rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.3rem); letter-spacing: -.01em; }
h3 { font-size: 1.18rem; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.prose { max-width: 66ch; }
.muted { color: var(--muted); }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy-700); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- topbar (แถบน้ำเงินเต็มจอ) ---------- */
.topbar {
  background: var(--navy-900);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-band {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  min-height: 30px;
  padding: 4px var(--gut);
}
.topbar-link {
  color: #FFFFFF; text-decoration: none;
  font-size: .82rem; font-weight: 500; white-space: nowrap;
  transition: color .15s ease;
}
.topbar-link:hover { color: var(--brass); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .topbar-band { gap: 10px; }
  .topbar-link { font-size: .76rem; }
}

/* ---------- header ---------- */
.site-header {
  border-top: 3px solid var(--brass);   /* เส้นขลิบแดง ติดขอบบนของแถบเมนู */
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 20px;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-right: auto; }
/* โลโก้: รูปจัตุรัส — ถ้าเป็นโลโก้แนวนอนให้ใช้ width:auto; height:34px; แทน */
.brand .sigil {
  width: 34px; height: 34px; flex: none;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}
:root[data-theme="dark"] .brand .sigil,
:root:not([data-theme="light"]) .brand .sigil { }
.brand-name { font-family: var(--display); font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.brand-role { display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em;
              text-transform: uppercase; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  font-size: .92rem; color: var(--fg); text-decoration: none;
  padding: 7px 11px; border-radius: 7px;
}
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a[aria-current="page"] { color: var(--brass); box-shadow: inset 0 -2px 0 var(--brass); border-radius: 0; }

/* icon buttons in the header (theme switch, menu) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  border-radius: 9px; padding: 0; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.icon-btn:hover { border-color: var(--brass); color: var(--brass); }
.icon-btn svg { width: 19px; height: 19px; display: block; }
.icon-btn svg[hidden] { display: none; }
.icon-btn[aria-expanded="true"] { border-color: var(--brass); color: var(--brass); background: var(--surface-2); }

.nav-toggle { display: none; }

/* --- collapsed navigation (phones, tablets in portrait) --- */
@media (max-width: 900px) {
  .site-header .wrap { position: relative; }
  .nav-toggle { display: inline-flex; }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: var(--gut);
    min-width: 224px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 10px 12px; border-radius: 8px; font-size: .96rem; }
  .nav a[aria-current="page"] { box-shadow: none; background: var(--brass-soft); border-radius: 8px; }
}

@media (max-width: 480px) {
  .brand-name { font-size: .98rem; }
  .brand-role { display: none; }   /* ชื่ออย่างเดียวบนมือถือ ไม่ให้หัวเว็บสูงเกิน */
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(32px, 5vw, 56px); }
.hero-grid {
  display: grid; gap: clamp(28px, 5vw, 56px);
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-top: 14px; }
.hero .lede { margin-top: 18px; font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--muted); max-width: 54ch; }
.hero .quote {
  margin-top: 22px; padding-left: 18px; border-left: 2px solid var(--brass);
  font-family: var(--display); font-style: italic; font-size: 1.08rem; color: var(--fg);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px; text-decoration: none;
  font-size: .95rem; font-weight: 500; border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--navy-700); color: #fff; }
:root[data-theme="dark"] .btn-primary,
:root:not([data-theme="light"]) .btn-primary { }
.btn-primary:hover { background: var(--navy-500); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: var(--surface); }
.btn-ghost:hover { border-color: var(--brass); color: var(--fg); transform: translateY(-1px); }

/* hero figure: three-lens diagram */
.hero-figure {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px; box-shadow: var(--shadow);
}
.hero-figure .dia-a { stroke: var(--dia-a); fill: color-mix(in srgb, var(--dia-a) 14%, transparent); }
.hero-figure .dia-b { stroke: var(--dia-b); fill: color-mix(in srgb, var(--dia-b) 14%, transparent); }
.hero-figure .dia-c { stroke: var(--dia-c); fill: color-mix(in srgb, var(--dia-c) 14%, transparent); }
.hero-figure .dia-label { fill: var(--fg); }
.hero-figure .dia-accent { fill: var(--brass); }

.hero-figure figcaption {
  margin-top: 14px; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); text-align: center;
}

/* ---------- sections ---------- */
.section { padding-block: clamp(44px, 7vw, 80px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 10px; margin-bottom: 30px; max-width: 62ch; }

/* ---------- pillar cards ---------- */
.pillars { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pillar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: grid; gap: 10px; align-content: start;
  transition: border-color .15s ease, transform .15s ease;
}
.pillar:hover { border-color: var(--navy-300); transform: translateY(-2px); }
.pillar .idx { font-family: var(--mono); font-size: .72rem; color: var(--brass); letter-spacing: .12em; }
.pillar p { color: var(--muted); font-size: .96rem; }
.pillar a.more { font-size: .9rem; font-weight: 500; }

/* ---------- list: publications / talks / posts ---------- */
.entry-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.entry {
  display: grid; gap: 4px 22px; padding-block: 18px;
  grid-template-columns: 92px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 560px) { .entry { grid-template-columns: 1fr; } }
.entry .year { font-family: var(--mono); font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 3px; }
.entry .title { display: block; font-weight: 500; }
.entry .meta { display: block; font-size: .9rem; color: var(--muted); }

/* ---------- timeline (education / experience) ---------- */
.timeline { display: grid; gap: 0; }
.tl-item {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 22px;
  padding-block: 16px; border-bottom: 1px solid var(--line);
}
@media (max-width: 560px) { .tl-item { grid-template-columns: 1fr; } }
.tl-item .when { font-family: var(--mono); font-size: .8rem; color: var(--brass); font-variant-numeric: tabular-nums; }
.tl-item .what { display: block; font-weight: 500; }
.tl-item .where { display: block; font-size: .92rem; color: var(--muted); }

/* ---------- news strip ---------- */
.news { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 30px); }
.news ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.news li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: baseline; }
.news .tag {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--brass-soft); color: var(--brass);
  border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent);
  white-space: nowrap;
}

/* ---------- two column ---------- */
.two-col { display: grid; gap: clamp(28px, 5vw, 52px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- page header (inner pages) ---------- */
.page-head { padding-block: clamp(40px, 6vw, 72px) clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--line); }
.page-head .lede { margin-top: 14px; color: var(--muted); max-width: 62ch; }

/* header with a portrait alongside the text */
.page-head .with-portrait {
  display: grid; gap: clamp(24px, 4vw, 48px);
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  align-items: start;
}
@media (max-width: 760px) {
  .page-head .with-portrait { grid-template-columns: 1fr; }
  .portrait-figure { max-width: 300px; }
}

.portrait-figure { margin: 0; }
.portrait {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-2); box-shadow: var(--shadow);
}
.portrait-figure figcaption {
  margin-top: 12px; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--navy-900);
  color: #C9CBDF;
  padding-block: clamp(22px, 2.6vw, 32px);
}
.site-footer a { color: #C7CBFF; }
.site-footer a:hover { color: var(--brass); }
.footer-grid {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
  grid-template-columns: 65% minmax(0, 35%);
  align-items: center;
}
.footer-brand { display: grid; gap: 8px; text-align: center; }
.footer-brand p { margin: 0; }
.footer-quote {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.1rem, 1.9vw, 1.45rem);
  color: #EDEEFA;
}
.footer-name { font-size: .92rem; color: #AEB2D4; }

.footer-meta {
  display: grid; gap: 6px;
  text-align: right;
  font-size: .88rem; color: #AEB2D4;
}
.footer-meta p { margin: 0; }

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; align-items: start; }
  .footer-brand, .footer-meta { text-align: left; }
}

/* =========================================================
   WordPress integration (sikarin-child 2.0)
   ========================================================= */

/* map WordPress preset colours onto the prototype tokens, so page content follows light/dark mode */
html:root {
  --wp--preset--color--base: var(--paper);
  --wp--preset--color--contrast: var(--ink);
  --wp--preset--color--heading: var(--heading);
  --wp--preset--color--muted: var(--muted);
  --wp--preset--color--line: var(--line);
  --wp--preset--color--navy-light: var(--link);
  --wp--preset--color--crimson: var(--brass);
  --wp--preset--color--crimson-soft: var(--brass-soft);
  --syk-heading: var(--heading);
  --syk-line: var(--line);
  --syk-muted: var(--muted);
  --syk-crimson: var(--brass);
  --syk-crimson-soft: var(--brass-soft);
}

/* no gaps between header, main and footer (the prototype has none) */
.wp-site-blocks > * { margin-block-start: 0; }
/* let the sticky header stick to the page, not to its template-part wrapper */
.wp-site-blocks > .wp-block-template-part:first-child { display: contents; }

/* inner pages: title band + content at the prototype width */
.syk-page-body { padding-block: clamp(36px, 5vw, 64px); }
.syk-page-body .wp-block-post-content > :first-child { margin-top: 0; }
.syk-page-body img { height: auto; border-radius: 6px; }
.syk-page-body iframe { max-width: 100%; }
.page-head .wp-block-post-title { margin: 0; }

/* section sub-navigation (Research → Publications · Talks …) */
.syk-subnav { border-bottom: 1px solid var(--line); background: var(--bg); }
.syk-subnav .wrap { display: flex; flex-wrap: wrap; gap: 4px 6px; padding-block: 10px; }
.syk-subnav a {
  font-size: .9rem; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
}
.syk-subnav a:hover { color: var(--fg); background: var(--surface-2); }
.syk-subnav a[aria-current="page"] { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 35%, transparent); background: var(--brass-soft); }

/* blog post list (Blog Posts page) — same look as "Recent work" */
.syk-post-list .entry-list { list-style: none; margin: 0; padding: 0; }
.syk-post-list .entry { margin: 0; }
.syk-post-list .entry > * { margin: 0; }
.syk-post-list .wp-block-post-title { font-family: var(--body); font-size: 1.02rem; font-weight: 500; line-height: 1.5; margin: 0; }
.syk-post-list .wp-block-post-title a { color: var(--fg); text-decoration: none; }
.syk-post-list .wp-block-post-title a:hover { color: var(--brass); }
.syk-post-list .wp-block-post-terms { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.syk-post-list .wp-block-post-terms a { color: var(--muted); }
.syk-post-list .year { font-family: var(--mono); font-size: .82rem; color: var(--muted); padding-top: 3px; }

/* =========================================================
   Publications page (.pubs)
   ========================================================= */
.pubs { display: grid; gap: 28px; }
.pubs p, .pubs h2, .pubs h3, .pubs dl, .pubs dd, .pubs ol { margin: 0; }

.pubs-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; }
.pubs-lede { max-width: 62ch; font-size: clamp(1.02rem, 1.5vw, 1.12rem); color: var(--muted); }
.pubs-scholar {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  padding: 10px 18px; border-radius: 8px; text-decoration: none;
  background: var(--navy-700); color: #fff; font-size: .92rem; font-weight: 500;
  transition: background .15s ease, transform .15s ease;
}
.pubs-scholar:hover { background: var(--navy-500); color: #fff; transform: translateY(-1px); }

.pubs-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pubs-stats > div {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: grid; gap: 4px;
}
.pubs-stats dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pubs-stats dd { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 600; color: var(--heading); line-height: 1.1; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .pubs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pubs-toolbar {
  position: sticky; top: 64px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 12px 0; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.admin-bar .pubs-toolbar { top: 96px; }
.pubs-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.pubs-filter button {
  font: inherit; font-size: .88rem; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.pubs-filter button span { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-left: 4px; }
.pubs-filter button:hover { border-color: var(--brass); }
.pubs-filter button[aria-pressed="true"] { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.pubs-filter button[aria-pressed="true"] span { color: #C7CBFF; }
.pubs-search { flex: 1 1 260px; max-width: 380px; }
.pubs-search input {
  width: 100%; font: inherit; font-size: .92rem; color: var(--fg);
  padding: 9px 14px 9px 36px; border-radius: 999px;
  border: 1px solid var(--line); background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23565C7D' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center;
}
.pubs-search input:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: transparent; }
.pubs-count { font-family: var(--mono); font-size: .75rem; letter-spacing: .06em; color: var(--muted); margin-top: -12px; }

.pubs-list { display: grid; gap: 0; }
.pubs-year {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 28px;
  border-top: 1px solid var(--line); padding-top: 22px; padding-bottom: 8px;
}
.pubs-year[hidden] { display: none; }
.pubs-y {
  position: sticky; top: 140px; align-self: start;
  font-family: var(--display); font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 600;
  color: var(--heading); line-height: 1; font-variant-numeric: tabular-nums;
}
.pubs-items { list-style: none; padding: 0; display: grid; gap: 0; }
.pub {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 16px; align-items: start;
  padding: 2px 0 20px; margin-bottom: 18px; border-bottom: 1px dashed var(--line);
}
.pub:last-child { border-bottom: 0; margin-bottom: 0; }
.pub[hidden] { display: none; }
.pub-no { font-family: var(--mono); font-size: .72rem; color: var(--brass); letter-spacing: .06em; padding-top: 5px; }
.pub-body { display: grid; gap: 5px; }
.pub-title { font-family: var(--body); font-size: 1.04rem; font-weight: 600; line-height: 1.45; text-wrap: pretty; }
.pub-title a { color: var(--heading); text-decoration: none; }
.pub-title a:hover { color: var(--brass); text-decoration: underline; text-decoration-thickness: 1px; }
.pub-authors { font-size: .92rem; color: var(--muted); }
.pub-authors strong { color: var(--fg); font-weight: 600; }
.pub-venue { font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pub-venue em { color: var(--fg); font-style: italic; }
.pub-kind, .pub-note {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.pub-kind { background: var(--brass-soft); color: var(--brass); border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); }
.pub-note { border: 1px solid var(--line); color: var(--muted); }
.pub-link {
  font-size: .8rem; white-space: nowrap; text-decoration: none; color: var(--link);
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; margin-top: 2px;
  transition: border-color .15s ease, color .15s ease;
}
.pub-link:hover { border-color: var(--brass); color: var(--brass); }
.pubs-empty { padding: 28px 0; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .pubs-year { grid-template-columns: 1fr; gap: 12px; }
  .pubs-y { position: static; }
  .pub { grid-template-columns: 38px minmax(0, 1fr); }
  .pub-link { grid-column: 2; justify-self: start; }
  .pubs-search { max-width: none; }
}

.pub-cite { display: inline; }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px;
  margin: -1px; overflow: hidden; padding: 0; position: absolute !important; word-wrap: normal !important;
}
.pub-links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pub-doi { color: var(--brass); }
.pubs-foot { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 760px) { .pub-links { grid-column: 2; flex-direction: row; justify-self: start; } }
.entry a.title { color: var(--fg); text-decoration: none; }
.entry a.title:hover { color: var(--brass); text-decoration: underline; text-decoration-thickness: 1px; }

/* publications v2: preprints + arXiv links */
.pubs-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pub-arxiv { color: #B31B1B; }
:root[data-theme="dark"] .pub-arxiv { color: #F09088; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pub-arxiv { color: #F09088; } }
.pub-kind-pre { background: var(--surface-2); color: var(--link); border-color: color-mix(in srgb, var(--link) 35%, transparent); }
.pubs-pre .pubs-y { color: var(--link); font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
.pubs-pre { background: linear-gradient(90deg, color-mix(in srgb, var(--link) 6%, transparent), transparent 70%); border-radius: 12px 12px 0 0; padding-left: 14px; padding-right: 14px; margin-bottom: 8px; }

/* =========================================================
   Research page (.rs)
   ========================================================= */
.rs { display: grid; gap: clamp(40px, 6vw, 72px); }
.rs ol, .rs blockquote, .rs figure { margin: 0; padding: 0; }
.rs-intro { display: grid; gap: 22px; }
.rs-quote {
  border-left: 3px solid var(--brass); padding: 4px 0 4px 22px;
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(1.25rem, 2.3vw, 1.7rem); line-height: 1.45; color: var(--heading); max-width: 58ch;
}
.rs-jump { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-jump a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: .9rem; color: var(--fg);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transition: border-color .15s ease, color .15s ease;
}
.rs-jump a span { font-family: var(--mono); font-size: .72rem; color: var(--brass); }
.rs-jump a:hover { border-color: var(--brass); color: var(--brass); }

.rs-thread { display: grid; gap: 28px; padding-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.rs-head { display: grid; gap: 10px; max-width: 70ch; }
.rs-head h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.rs-lede { font-size: clamp(1.02rem, 1.5vw, 1.14rem); color: var(--muted); }
.rs-prose { display: grid; gap: 16px; max-width: 74ch; }
.rs-prose p { line-height: 1.75; }

.rs-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
@media (max-width: 900px) { .rs-grid { grid-template-columns: 1fr; } }
.rs-ideas { display: grid; gap: 14px; }
.rs-ideas .pillar p { color: var(--fg); opacity: .86; }

.rs-fig { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.rs-fig img { width: 100%; height: auto; display: block; border-radius: 6px; }
.rs-fig figcaption { font-size: .82rem; color: #565C7D; text-align: center; }
.rs-fig figcaption a { color: #3F4ABE; }
.rs-fig-wide { max-width: 980px; }

.rs-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; max-width: 900px; }
.rs-compare > div:not(.rs-arrow) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 6px; }
.rs-compare > div:last-child { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); background: color-mix(in srgb, var(--brass-soft) 55%, var(--surface)); }
.rs-compare .idx { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }
.rs-arrow { display: grid; place-items: center; font-size: 1.6rem; color: var(--muted); }
@media (max-width: 640px) { .rs-compare { grid-template-columns: 1fr; } .rs-arrow { transform: rotate(90deg); } }

.rs-papers-wrap { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(18px, 2.6vw, 28px); }
.rs-papers { list-style: none; display: grid; gap: 0; }
.rs-papers li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.rs-papers li:first-child { border-top: 0; }
.rs-y { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: 2px; }
.rs-papers a { color: var(--heading); text-decoration: none; font-weight: 500; }
.rs-papers a:hover { color: var(--brass); text-decoration: underline; text-decoration-thickness: 1px; }
.rs-j { display: block; font-size: .85rem; color: var(--muted); font-style: italic; }

.rs-other details { margin-top: 4px; }
.rs-other summary { cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--link); list-style: none; }
.rs-other summary::-webkit-details-marker { display: none; }
.rs-other summary::after { content: " ↓"; }
.rs-other details[open] summary::after { content: " ↑"; }
.rs-other .rs-papers { margin-top: 10px; }
.rs-other .rs-papers li { grid-template-columns: 44px minmax(0, 1fr); font-size: .9rem; }

.rs-cta { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Talks page (.tks) — reuses .pubs layout */
.tk-items { list-style: none; padding: 0; display: grid; gap: 14px; }
.tk { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 22px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s ease, transform .15s ease; }
.tk:hover { border-color: var(--navy-300); transform: translateY(-1px); }
.tk[hidden] { display: none; }
.tk-date { font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; color: var(--brass); padding-top: 4px; }
.tk-body { display: grid; gap: 4px; }
.tk-title { font-family: var(--display); font-size: 1.14rem; font-weight: 600; line-height: 1.35; color: var(--heading); }
.tk-event { font-size: .95rem; font-weight: 500; color: var(--fg); }
.tk-where { font-size: .88rem; color: var(--muted); }
.tk-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px !important; }
.tk-pill { font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tk-conference { color: var(--link); border-color: color-mix(in srgb, var(--link) 35%, transparent); }
.tk-seminar { color: var(--fg); }
.tk-outreach, .tk-lang { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 35%, transparent); background: var(--brass-soft); }
@media (max-width: 760px) { .tk { grid-template-columns: 1fr; } }

/* =========================================================
   v2.5 — IF profile content: research topics, teaching, students, overview, videos, about
   ========================================================= */
.tc { display: grid; gap: clamp(40px, 6vw, 64px); }
.tc ol, .tc ul, .tc figure, .tc dl, .tc dd { margin: 0; padding: 0; }
.tc-intro { display: grid; gap: 22px; }

/* research: collapsible paper lists, join box, BSM cards */
details.rs-papers-wrap > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.rs-papers-wrap > summary::-webkit-details-marker { display: none; }
details.rs-papers-wrap > summary::after { content: "Show ↓"; font-size: .82rem; color: var(--link); font-weight: 500; }
details.rs-papers-wrap[open] > summary::after { content: "Hide ↑"; }
details.rs-papers-wrap[open] > summary { margin-bottom: 8px; }
.rs-other details.rs-papers-wrap { background: transparent; border: 0; padding: 0; }
.rs-join-tag a { display: inline-flex; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--brass); background: var(--brass-soft); border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent); border-radius: 999px; padding: 3px 10px; }
.rs-bsm { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rs-bsm .pillar h3 { font-size: 1.02rem; }
.rs-seven h2 { font-style: italic; }
.rs-join-box {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #E9EAF4;
  border-radius: 16px; padding: clamp(24px, 4vw, 44px);
}
.rs-join-box h2 { color: #fff; margin-top: 8px !important; }
.rs-join-box .eyebrow { color: #F09088; }
.rs-join-box .rs-lede { color: #C9CBDF; margin-top: 10px !important; }
.rs-join-list { list-style: none; display: grid; gap: 8px; margin-top: 16px !important; }
.rs-join-list li { padding-left: 26px; position: relative; }
.rs-join-list li::before { content: "✓"; position: absolute; left: 0; color: #F09088; font-weight: 700; }
.rs-join-side { display: grid; gap: 14px; }
.rs-join-side .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.rs-join-side .btn-ghost:hover { border-color: #F09088; color: #fff; }
.rs-labs { list-style: none; display: grid; gap: 8px; }
.rs-labs a { color: inherit; }
.rs-join-box .rs-labs a { color: #C7CBFF; }
@media (max-width: 820px) { .rs-join-box { grid-template-columns: 1fr; } }
.rs-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 820px) { .rs-two { grid-template-columns: 1fr; } }
.rs-static { gap: 10px; }
.rs-more { font-size: .9rem; margin-top: 6px !important; }
.pubs-other { margin-top: 8px; }
.pub-sel { background: color-mix(in srgb, #E8B931 22%, var(--surface)); color: #8A6400; border-color: color-mix(in srgb, #E8B931 55%, transparent); }
:root[data-theme="dark"] .pub-sel { color: #F3D27A; }

/* teaching */
.tc-term { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px 28px; padding: 20px 0; border-top: 1px solid var(--line); }
.tc-term:first-of-type { border-top: 0; }
.tc-term-head h3 { font-size: 1.15rem; }
.tc-term-head p { font-family: var(--mono); font-size: .74rem; color: var(--muted); margin-top: 4px !important; }
.tc-courses { display: grid; gap: 12px; }
.tc-course { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 6px; }
.tc-code { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: var(--brass); }
.tc-course h3 { font-size: 1.12rem; }
.tc-links { flex-direction: row !important; flex-wrap: wrap; justify-content: flex-start !important; align-items: center !important; margin-top: 6px; }
.tc-none { font-size: .88rem; }
.tc-video { position: relative; aspect-ratio: 16 / 9; margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); max-width: 640px; }
.tc-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 760px) { .tc-term { grid-template-columns: 1fr; } }
.tc-problems { list-style: none; display: grid; gap: 12px; }
.tc-problems li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.tc-problems h3 { font-size: 1.05rem; }
.tn-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tn-card { display: grid; gap: 4px; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; transition: border-color .15s ease, transform .15s ease; }
.tn-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.tn-th { font-weight: 600; color: var(--heading); font-size: 1.02rem; }
.tn-en { font-size: .85rem; color: var(--muted); }
.tn-note { font-size: .8rem; color: var(--muted); margin-top: 6px !important; }
.tn-grid li:first-child { grid-column: 1 / -1; }

/* students & positions list */
.st-list { list-style: none; display: grid; gap: 10px; }
.st { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) auto; gap: 6px 20px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.st-name { font-weight: 600; color: var(--heading); }
.st-inst { font-size: .86rem; color: var(--muted); }
.st-label { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.st-thesis p:last-child { font-size: .95rem; }
.st-status { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--muted); text-align: right; display: grid; gap: 2px; white-space: nowrap; }
.st-status span { color: var(--muted); }
.st-graduated { color: #1E7B4F; }
.st-ongoing { color: var(--link); }
:root[data-theme="dark"] .st-graduated { color: #7FD6A8; }
@media (max-width: 760px) { .st { grid-template-columns: 1fr; } .st-status { text-align: left; } }

/* about page */
.ab-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; }
.ab-photo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }
.ab-intro { display: grid; gap: 12px; }
.ab-name { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
.ab-role { font-weight: 500; color: var(--fg); }
.ab-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ab-chips a { font-size: .86rem; text-decoration: none; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); }
.ab-chips a:hover { border-color: var(--brass); color: var(--brass); }
.ab-two { align-items: center; }
.ab-list .st { grid-template-columns: 110px minmax(0, 1fr); }
.ab-list .st-status { text-align: left; color: var(--brass); }
.ab-fig { max-width: 420px; justify-self: center; }
@media (max-width: 760px) { .ab-hero { grid-template-columns: 1fr; } .ab-photo { max-width: 220px; } }

/* outreach channels */
.ov-ch { text-decoration: none; color: inherit; }
.ov-ch .more { font-size: .88rem; font-weight: 500; color: var(--link); }

/* videos */
.vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.vd { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: grid; }
.vd-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.vd-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vd figcaption { padding: 14px 16px 16px; display: grid; gap: 4px; }
.vd h3 { font-size: 1rem; line-height: 1.4; }
.vd p { font-size: .84rem; color: var(--muted); }

/* talks: Tah Poe series */
.tp-series { display: grid; gap: 18px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tp { display: grid; gap: 6px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding-bottom: 14px; transition: border-color .15s ease, transform .15s ease; }
.tp:hover { border-color: var(--brass); transform: translateY(-2px); }
.tp img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.tp-no { font-family: var(--mono); font-size: .7rem; color: var(--brass); padding: 4px 14px 0; }
.tp-title { font-weight: 600; color: var(--heading); padding: 0 14px; line-height: 1.4; }
.tk .tc-links { margin-top: 8px; }

/* v2.6 — playlists & media feature */
.pl-thumb { position: relative; display: block; }
.pl-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.pl-badge { position: absolute; right: 8px; bottom: 8px; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; background: rgba(15,19,56,.85); color: #fff; padding: 4px 8px; border-radius: 6px; }
.vd-feature { max-width: 860px; }
.vd-feature h3 { font-size: 1.15rem; }
