/* ==========================================================================
   Thin Nguyen — academic profile (Deakin Experts-style tabbed layout)
   One stylesheet. Light + dark. Mobile-first. No build step, no dependencies.
   Colour tokens live in :root; everything else flows from them.
   ========================================================================== */

:root {
  --accent: #0f766e;          /* deep teal */
  --accent-2: #155e75;
  --accent-soft: #e6f4f1;
  --ink: #15212e;
  --ink-soft: #4a5a6b;
  --ink-faint: #76869a;
  --bg: #ffffff;
  --bg-alt: #f5f8f9;
  --card: #ffffff;
  --border: #e3e9ee;
  --link: #0c6170;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 34px rgba(16,24,40,.10);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme='dark'] {
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --accent-soft: #11302d;
  --ink: #e7edf3;
  --ink-soft: #aab6c4;
  --ink-faint: #7d8b9c;
  --bg: #0d1218;
  --bg-alt: #121a22;
  --card: #151e27;
  --border: #243140;
  --link: #5fd0c4;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 34px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.65; font-size: 16.5px; -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; transition: background .25s ease, color .25s ease;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; font-weight: 700; letter-spacing: -.012em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 .3rem; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.55rem); margin: 2rem 0 .9rem; padding-bottom: .4rem; border-bottom: 2px solid var(--accent-soft); }
h3 { font-size: 1.08rem; margin: 1.4rem 0 .5rem; }
h4 { font-size: .96rem; margin: 1.1rem 0 .4rem; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin: .35rem 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--bg-alt); padding: .1em .35em; border-radius: 5px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.lead { font-size: 1.06rem; color: var(--ink-soft); }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 200; }
.skip:focus { left: 0; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: var(--maxw); margin: 0 auto; padding: .5rem 22px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-size: 1rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.theme-btn { margin-left: auto; background: var(--bg-alt); border: 1px solid var(--border); color: var(--ink-soft);
  width: 36px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 1rem; }
.theme-btn:hover { color: var(--ink); }

/* ---------- Profile header ---------- */
.profile-head { padding: 2rem 0 .6rem; }
.profile-head .role { font-size: 1.05rem; color: var(--ink-soft); margin: 0; }
.profile-head .role strong { color: var(--ink); font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { border-bottom: 1px solid var(--border); margin-top: .8rem; position: sticky; top: 47px; z-index: 90;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(160%) blur(8px); }
.tabs-in { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; display: flex; gap: .2rem; overflow-x: auto; }
.tabs a { white-space: nowrap; padding: .8rem .9rem; color: var(--ink-soft); font-weight: 600; font-size: .94rem;
  border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Profile grid (sidebar + content) ---------- */
.profile-grid { display: grid; grid-template-columns: 290px 1fr; gap: 2.4rem; max-width: var(--maxw);
  margin: 0 auto; padding: 2rem 22px 1rem; align-items: start; }
.sidebar { position: sticky; top: 108px; display: grid; gap: 1.1rem; }
.sidebar .photo { width: 100%; max-width: 250px; aspect-ratio: 1; object-fit: cover; border-radius: 18px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.side-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.15rem; box-shadow: var(--shadow); }
.side-card h3 { margin: 0 0 .7rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); }
.side-card .row { font-size: .92rem; margin-bottom: .7rem; }
.side-card .row:last-child { margin-bottom: 0; }
.side-card .row .k { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: .1rem; }
.side-links { display: flex; flex-direction: column; gap: .4rem; }
.side-links a { font-size: .92rem; font-weight: 500; }
.tab-content { min-width: 0; }
.tab-content > h2:first-child { margin-top: .2rem; }

@media (max-width: 820px) {
  .profile-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .sidebar { position: static; }
  .sidebar .photo { max-width: 150px; }
  .tabs { top: 47px; }
}

/* ---------- Buttons / pills / tags ---------- */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border-radius: 9px;
  font-weight: 600; font-size: .9rem; border: 1px solid var(--border); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.pill { display: inline-block; padding: .16rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 0; }
.tag { display: inline-block; padding: .26rem .6rem; border-radius: 7px; font-size: .82rem; font-weight: 600;
  background: var(--bg-alt); color: var(--ink-soft); border: 1px solid var(--border); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card h3 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Grants ---------- */
.grant { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.grant:last-child { border-bottom: none; }
.grant .top { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; justify-content: space-between; }
.grant .ttl { font-weight: 650; color: var(--ink); }
.grant .amt { font-weight: 800; color: var(--accent); white-space: nowrap; }
.grant .when { color: var(--ink-faint); font-weight: 600; font-size: .85rem; }
.grant .ci { font-size: .88rem; color: var(--ink-soft); margin-top: .35rem; }
.grant .ci .me { color: var(--ink); font-weight: 700; }
.grant .src { font-size: .85rem; color: var(--ink-faint); margin-top: .2rem; }

/* ---------- Publication outputs ---------- */
.tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0 1.4rem; }
.tools input[type=search] { flex: 1 1 240px; min-width: 180px; padding: .55rem .8rem; border: 1px solid var(--border);
  border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: .92rem; }
.yeargroup > .yh { font-size: 1.15rem; font-weight: 800; color: var(--accent); margin: 1.5rem 0 .3rem; padding-bottom: .25rem; border-bottom: 1px solid var(--border); }
.pub { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.pub:last-child { border-bottom: none; }
.pub .ttl { font-weight: 600; color: var(--ink); }
.pub .au { font-size: .9rem; color: var(--ink-soft); margin-top: .15rem; }
.pub .au .me { color: var(--ink); font-weight: 700; }
.pub .meta { margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.pub .vn { font-style: italic; color: var(--ink-soft); font-size: .88rem; }
.pub a.lnk { font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border: 1px solid var(--border); border-radius: 6px; color: var(--accent); }
.pub a.lnk:hover { text-decoration: none; background: var(--accent-soft); }
.count-note { color: var(--ink-faint); font-size: .88rem; }

/* ---------- People (HDR) ---------- */
.people { display: grid; gap: .6rem; margin: .6rem 0 0; }
.person { display: grid; grid-template-columns: 48px 1fr; gap: .9rem; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-size: .9rem; }
.person .nm { font-weight: 700; }
.person .th { color: var(--ink-soft); font-size: .9rem; }
.person .yr2 { font-size: .8rem; color: var(--ink-faint); font-weight: 600; }
@media (max-width: 600px) { .person { grid-template-columns: 1fr; } .avatar { display: none; } }

/* ---------- Award / talk list ---------- */
.dl { display: grid; grid-template-columns: 92px 1fr; gap: 0 1rem; }
.dl .yr { font-weight: 800; color: var(--accent); font-size: .92rem; padding-top: .7rem; }
.dl .it { border-bottom: 1px solid var(--border); padding: .7rem 0; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl .yr { padding-top: .7rem; padding-bottom: 0; } .dl .it { border: none; padding-top: .1rem; } }

.note { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: var(--radius-sm); padding: .85rem 1.05rem; font-size: .92rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 3rem; }
.footer-in { max-width: var(--maxw); margin: 0 auto; padding: 1.8rem 22px; display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: .88rem; }
.footer a { color: var(--ink-soft); }
.footer a:hover { color: var(--accent); }
.foot-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- Inline decorative icons (plain Unicode/emoji; no external deps, no licence) ---------- */
/* Used only as a visual aid; every .ic is marked aria-hidden in the HTML and the
   adjacent text always carries the meaning, so screen readers are unaffected. */
.ic { font-style: normal; font-weight: 400; display: inline-block; margin-right: .45em;
  text-decoration: none; line-height: 1; font-size: .95em; }
.tabs a .ic { margin-right: .35em; }
.side-links a .ic, .foot-links a .ic { margin-right: .35em; }
h2 .ic { font-size: .9em; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 4px; }
