/* ============================================================
   Hsiu-Ting Yu | Psychometrics and Quantitative Methods Lab
   Site stylesheet. Colours and fonts are defined once below;
   change a variable here and every page follows.
   ============================================================ */

:root {
  --ink: #0f1c30;          /* headings, header background */
  --ink-2: #263650;        /* body text */
  --muted: #6b7686;        /* secondary text */
  --line: #e3e6ec;         /* hairlines */
  --paper: #f7f7f4;        /* page background */
  --card: #ffffff;
  --blue: #2457d6;         /* primary accent (umg blue) */
  --blue-soft: #e9efff;
  --gold: #c9a24a;         /* secondary accent */
  --gold-soft: #f8f1dc;
  --teal: #1f8a80;
  --teal-soft: #e2f3f1;
  --node: #d9d9d9;         /* observed-node grey from the graphical lexicon */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 28, 48, .06), 0 10px 30px -12px rgba(15, 28, 48, .18);
  --font-display: "Source Serif 4", "Noto Serif TC", Georgia, serif;
  --font-body: "Inter", "Noto Sans TC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1140px;
}

html[lang="zh-Hant"] {
  --font-display: "Noto Serif TC", "Source Serif 4", Georgia, serif;
  --font-body: "Noto Sans TC", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 40px; height: 40px; stroke-width: 1.6; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 28, 48, .96);
  backdrop-filter: saturate(160%) blur(8px);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand .brand-name { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.1; }
.brand .brand-sub { display: block; font-size: .72rem; font-weight: 500; color: rgba(255,255,255,.65); letter-spacing: .04em; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a { color: rgba(255,255,255,.82); padding: 8px 10px; white-space: nowrap; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255,255,255,.14); }
.lang { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; color: #fff; font-size: .9rem; font-weight: 500; }
.lang:hover { background: #fff; color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 66px; flex-direction: column; align-items: stretch; background: var(--ink); padding: 10px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; }
  .lang { margin: 8px 0 0; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #0f1c30 0%, #15284a 60%, #1a2f57 100%);
  color: #fff;
  padding: 72px 0 64px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("../img/pattern-lexicon.svg");
  background-size: 640px auto; opacity: .16; pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.25fr .9fr; gap: 48px; align-items: center; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 18px; }
.hero h1 { color: #fff; margin-bottom: 6px; }
.hero .zh-name { font-weight: 500; color: rgba(255,255,255,.75); margin-left: .35em; font-size: .7em; }
.hero .role { font-size: 1.2rem; font-weight: 500; color: #fff; }
.hero .affil { color: rgba(255,255,255,.72); margin-bottom: 20px; }
.hero .lede { font-size: 1.1rem; color: rgba(255,255,255,.9); max-width: 58ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-ghost { border-color: rgba(255,255,255,.45); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.hero-figure { position: relative; }
.hero-figure .frame {
  background: rgba(255,255,255,.96); border-radius: 18px; padding: 18px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
}
.hero-figure .frame img { width: 100%; }
.hero-figure .caption { margin-top: 12px; font-size: .8rem; color: rgba(255,255,255,.65); text-align: center; }
.hero-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
@media (max-width: 860px) {
  .hero { padding: 48px 0 40px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-figure { max-width: 420px; }
}

/* ---------- Stats strip ---------- */
.stats { background: var(--card); border-bottom: 1px solid var(--line); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 22px 16px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat .n { font-family: var(--font-display); font-size: 2rem; color: var(--ink); line-height: 1; }
.stat .l { font-size: .85rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 720px) { .stats .wrap { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-left: none; } }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); font-weight: 700; margin-bottom: 8px; }
.section-head .more { white-space: nowrap; font-weight: 600; }
.intro { font-size: 1.1rem; max-width: 72ch; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); position: relative;
  transition: transform .18s ease, border-color .18s ease;
}
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--blue); }
.card .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; background: var(--blue-soft); color: var(--blue); }
.card .ic.gold { background: var(--gold-soft); color: #9a7a2a; }
.card .ic.teal { background: var(--teal-soft); color: var(--teal); }
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--ink-2); font-size: .97rem; }
.card .kicker { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.card .arrow { position: absolute; right: 18px; top: 22px; color: var(--muted); }

/* Featured course card: solid blue with white type, links out to the course site. */
a.card.card-course { background: var(--blue); border-color: var(--blue); color: #fff; }
a.card.card-course .kicker, a.card.card-course .sub { color: rgba(255,255,255,.78); }
a.card.card-course h3, a.card.card-course .arrow { color: #fff; }
a.card.card-course p { color: rgba(255,255,255,.92); }
a.card.card-course:hover { border-color: #fff; }
a.card.card-course .sub { font-weight: 500; }

/* ---------- Research axes (page + home) ---------- */
.axis { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px 0; border-top: 1px solid var(--line); }
.axis:first-of-type { border-top: none; }
.axis:nth-of-type(even) .axis-fig { order: -1; }
.axis .num { font-family: var(--font-display); font-size: .9rem; color: var(--blue); font-weight: 700; letter-spacing: .1em; }
.axis h3 { font-size: 1.45rem; margin: 6px 0 10px; }
.axis .tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.axis .tags li { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 500; }
.axis-fig { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.axis-fig img { margin: 0 auto; max-height: 300px; width: auto; }
.axis-fig figcaption { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 10px; }
@media (max-width: 860px) { .axis { grid-template-columns: 1fr; } .axis:nth-of-type(even) .axis-fig { order: 0; } }

/* ---------- Books ---------- */
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 960px) { .book-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .book-grid { grid-template-columns: 1fr; } }
.book { display: flex; flex-direction: column; }
.book .cover {
  aspect-ratio: 3 / 4; border-radius: 10px; margin-bottom: 16px; padding: 22px 20px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, #15284a, #2457d6); position: relative; overflow: hidden;
}
.book .cover.c2 { background: linear-gradient(160deg, #123c38, #1f8a80); }
.book .cover.c3 { background: linear-gradient(160deg, #3a2c0d, #c9a24a); }
.book .cover.c4 { background: linear-gradient(160deg, #2b1e3d, #7a4fb3); }
.book .cover.c5 { background: linear-gradient(160deg, #3d1a1a, #c2513f); }
.book .cover::after { content: ""; position: absolute; inset: 0; background-image: url("../img/pattern-lexicon.svg"); background-size: 320px auto; opacity: .18; }
.book .cover .t { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; position: relative; }
.book .cover .s { font-size: .82rem; opacity: .85; margin-top: 8px; position: relative; }
.book .cover .a { font-size: .8rem; opacity: .85; position: relative; }
.book .badge { display: inline-block; justify-self: start; align-self: start; width: max-content; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); margin-bottom: 8px; }
.book .badge.plan { background: var(--gold-soft); color: #8a6a1e; }
.book .meta { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.book .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
.book .links a { font-size: .88rem; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.book .links a:hover { border-color: var(--blue); text-decoration: none; }

/* ---------- Publications ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li { padding: 14px 0 14px 2.2em; text-indent: -2.2em; border-bottom: 1px solid var(--line); font-size: .98rem; }
.pub-list li:last-child { border-bottom: none; }
.pub-list em { color: var(--ink); }
.pub-list .zh { display: block; text-indent: 0; margin-top: 4px; color: var(--muted); font-size: .9rem; }
.pub-list .me { font-weight: 700; color: var(--ink); }
.legend { font-size: .88rem; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f2f6; color: var(--ink); font-weight: 600; font-size: .85rem; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
td.yr { white-space: nowrap; color: var(--muted); width: 8.5em; }

/* ---------- Timeline / lists ---------- */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--blue); }
.timeline .yr { font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.timeline .t { color: var(--ink); font-weight: 600; }
.plain { padding-left: 1.2em; }
.plain li { margin-bottom: 6px; }
.two-col { columns: 2; column-gap: 40px; }
@media (max-width: 720px) { .two-col { columns: 1; } }

/* ---------- Page header ---------- */
.page-head { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 56px 0 48px; }
.page-head::before { content: ""; position: absolute; inset: 0; background-image: url("../img/pattern-lexicon.svg"); background-size: 560px auto; opacity: .14; }
.page-head .wrap { position: relative; display: flex; align-items: center; gap: 22px; }
.page-head .ic { width: 62px; height: 62px; border-radius: 16px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; color: var(--gold); flex: none; }
.page-head h1 { color: #fff; margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.page-head p { margin: 6px 0 0; color: rgba(255,255,255,.75); font-size: 1.05rem; }

/* ---------- Callouts ---------- */
.callout { background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 10px; padding: 18px 22px; margin: 22px 0; }
.callout.gold { background: var(--gold-soft); border-left-color: var(--gold); }
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: none; }
.contact-list .icon { flex: none; margin-top: .25em; color: var(--blue); }
.contact-list b { color: var(--ink); display: block; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 44px 0 34px; margin-top: 40px; font-size: .92rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; margin-top: 8px; font-size: .82rem; color: rgba(255,255,255,.55); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; } }

.note { font-size: .88rem; color: var(--muted); }
.chip { display: inline-block; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-weight: 600; margin-right: 6px; }
.chip.gold { background: var(--gold-soft); color: #8a6a1e; }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
