/* ==========================================================================
   Chau Nguyen — personal site
   Design system v2 · 2026
   ========================================================================== */

/* Webfonts are loaded via <link> in each page <head> — see index.html.
   Every family below falls back cleanly if the CDN is unreachable. */

:root {
  /* colour */
  --ink:        #14181f;
  --ink-soft:   #2c333d;
  --muted:      #5d6470;
  --faint:      #6e7581;
  --brand:      #2f4c7e;
  --brand-deep: #1f3557;
  --brand-tint: #eef1f7;
  --gold:       #8d6620;
  --gold-tint:  #f7f1e4;
  --paper:      #faf8f3;
  --surface:    #ffffff;
  --line:       #e4ded2;
  --line-soft:  #efeae0;

  /* type */
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* space */
  --gut: 40px;
  --max: 1240px;
  --band-y: 104px;
  --radius: 4px;
  --pill: 100px;
}

/* --------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0 0 1.05em; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--brand); color: #fff; }

/* --------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }

.band { padding: var(--band-y) 0; position: relative; }
.band + .band { border-top: 1px solid var(--line-soft); }
.band--tint { background: var(--surface); }

/* two-column section: label gutter + content */
.sec { display: grid; grid-template-columns: 214px minmax(0, 1fr); gap: 0 56px; align-items: start; }

.sec__label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 9px;
  position: sticky;
  top: 108px;
  padding-top: 6px;
}
.sec__label svg { width: 15px; height: 15px; flex: none; stroke: var(--brand); }
.sec__body { min-width: 0; }

/* --------------------------------------------------------------- type */
.display {
  font-family: var(--display);
  font-optical-sizing: auto;
  line-height: 1.03;
  letter-spacing: -.018em;
  color: var(--ink);
}
.h-xl { font-size: clamp(40px, 5.6vw, 74px); font-weight: 400; }
.h-lg { font-size: clamp(31px, 3.5vw, 46px); font-weight: 400; }
.h-md { font-size: clamp(23px, 2.2vw, 30px); font-weight: 500; line-height: 1.18; }
.h-sm { font-size: 19.5px; font-weight: 500; line-height: 1.3; }
.ital { font-style: italic; color: var(--brand); }

.lede { font-size: clamp(19px, 1.75vw, 23px); line-height: 1.55; font-weight: 300; color: var(--ink-soft); letter-spacing: -.006em; }
.body { font-size: 16.5px; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: 14.5px; line-height: 1.62; }

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 248, 243, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.nav__logo { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-soft);
  padding: 6px 0; border-bottom: 1.5px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.nav__links a:hover { color: var(--brand); }
.nav__links a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.nav__toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
.nav__toggle svg { width: 22px; height: 22px; stroke: currentColor; }

/* --------------------------------------------------------------- hero */
.hero { display: grid; grid-template-columns: 1.06fr .94fr; min-height: 640px; border-bottom: 1px solid var(--line-soft); }
.hero__left {
  background: var(--brand-deep);
  color: #fff;
  padding: 76px var(--gut) 68px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.hero__left::after {
  content: ''; position: absolute; right: -160px; bottom: -240px;
  width: 620px; height: 620px; border-radius: 50%;
  background: rgba(255, 255, 255, .035);
}
.hero__inner { position: relative; z-index: 2; max-width: 620px; margin-left: auto; width: 100%; padding-right: 24px; }
.hero__place { display: flex; align-items: center; gap: 9px; margin-bottom: 34px; }
.hero__place svg { width: 15px; height: 15px; stroke: rgba(255,255,255,.72); }
.hero__place span { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.78); }

.hero__name {
  font-family: var(--sans);
  font-size: clamp(46px, 6.4vw, 90px);
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: .045em;
  text-transform: uppercase;
  margin: 0 0 30px;
  color: #fff;
}
.hero__role { font-size: 17px; font-weight: 300; line-height: 1.6; color: rgba(255,255,255,.8); max-width: 470px; margin: 0 0 30px; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.34); border-radius: var(--pill);
  padding: 9px 19px;
  font-family: var(--mono); font-size: 10.8px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: rgba(255,255,255,.93);
}
.tag::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.6); flex: none; }

.tag--dark { border-color: var(--line); color: var(--muted); }
.tag--dark::before { background: var(--brand); }

.hero__award {
  margin-top: 38px; display: inline-flex; align-items: center; gap: 13px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.2);
  border-left: 3px solid #d9b25f;
  border-radius: var(--radius);
  padding: 13px 20px 13px 17px;
  max-width: 100%;
}
.hero__award svg { width: 19px; height: 19px; stroke: #d9b25f; flex: none; }
.hero__award b { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: #e7c684; display: block; margin-bottom: 3px; }
.hero__award span { font-size: 14.5px; color: rgba(255,255,255,.95); line-height: 1.4; }

.hero__right { position: relative; background: var(--brand); min-height: 420px; }
.hero__right img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }

/* --------------------------------------------------------------- pieces */
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 44px 64px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* numbered record card (Publications-style) */
.rec {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px 28px;
  display: flex; flex-direction: column;
  transition: border-color .2s ease, transform .2s ease;
}
.rec:hover { border-color: var(--brand); transform: translateY(-2px); }
.rec--gold { background: var(--gold-tint); border-color: #e6d5b4; }
.rec--gold:hover { border-color: var(--gold); }
.rec__top { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.rec__no { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: .06em; }
.rec__line { flex: 1; height: 1px; background: var(--line); }
.rec--gold .rec__line { background: #e0cba4; }
.rec__yr { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.rec__title { font-size: 17px; font-weight: 500; line-height: 1.38; color: var(--ink); margin: 0 0 9px; letter-spacing: -.008em; }
.rec__meta { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.rec__badge {
  align-self: flex-start; margin-bottom: 13px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); background: #fff; border: 1px solid #e6d5b4;
  border-radius: var(--pill); padding: 4px 11px;
}

/* metric */
.metric { border-top: 2px solid var(--ink); padding-top: 18px; }
.metric__n { font-family: var(--display); font-size: clamp(38px, 4.4vw, 54px); font-weight: 400; line-height: 1; letter-spacing: -.03em; color: var(--brand); display: block; margin-bottom: 10px; }
.metric__k { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--ink); display: block; margin-bottom: 9px; }
.metric__d { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0; }

/* credential rows */
.cred { border-top: 1px solid var(--line); padding: 22px 0; display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 28px; align-items: start; }
.cred:last-child { border-bottom: 1px solid var(--line); }
.cred__when { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--muted); padding-top: 4px; white-space: nowrap; }
.cred__what { font-size: 18px; font-weight: 500; color: var(--ink); margin: 0 0 4px; letter-spacing: -.01em; }
.cred__where { font-size: 14.5px; color: var(--muted); margin: 0; }

/* timeline */
.tl { position: relative; }
.tl__item { position: relative; padding: 0 0 52px 34px; border-left: 1px solid var(--line); }
.tl__item:last-child { padding-bottom: 0; border-left-color: transparent; }
.tl__item::before {
  content: ''; position: absolute; left: -5.5px; top: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--brand);
}
.band--tint .tl__item::before { background: var(--surface); }
.tl__when { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--brand); display: block; margin-bottom: 11px; }
.tl__org { font-family: var(--display); font-size: 27px; font-weight: 500; letter-spacing: -.015em; color: var(--ink); margin: 0 0 5px; }
.tl__role { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.tl__list li { position: relative; padding-left: 20px; margin-bottom: 11px; font-size: 15.8px; line-height: 1.62; color: var(--ink-soft); }
.tl__list li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.tl__list li:last-child { margin-bottom: 0; }

/* article / insight card */
.art {
  display: block; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px 28px;
  transition: border-color .2s ease, transform .2s ease;
  height: 100%;
}
.art:hover { border-color: var(--brand); transform: translateY(-2px); }
.art__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.art__cat { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--brand); background: var(--brand-tint); border-radius: var(--pill); padding: 5px 12px; }
.art__date { font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: .06em; white-space: nowrap; }
.art__title { font-family: var(--display); font-size: 21px; font-weight: 500; line-height: 1.26; letter-spacing: -.015em; color: var(--ink); margin: 0 0 12px; }
.art__ex { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 20px; }
.art__more { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); display: inline-flex; align-items: center; gap: 7px; }
.art__more svg { width: 12px; height: 12px; stroke: currentColor; transition: transform .2s ease; }
.art:hover .art__more svg { transform: translateX(3px); }

/* award certificates */
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.proof figure { margin: 0; }
.proof img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.proof figcaption {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
  margin-top: 12px;
}
.proof--single { grid-template-columns: minmax(0, 560px); }

/* logo wall — real marks, calmed to greyscale until hover */
.logos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.logos__i {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 20px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 146px;
  transition: border-color .2s ease;
}
.logos__i:hover { border-color: var(--brand); }
.logos__i img {
  height: 42px; width: auto; max-width: 100%;
  object-fit: contain; object-position: left center;
  filter: grayscale(1); opacity: .8;
  transition: filter .25s ease, opacity .25s ease;
}
.logos__i:hover img { filter: none; opacity: 1; }
.logos__i b { font-size: 15px; font-weight: 500; color: var(--ink); display: block; margin-bottom: 3px; letter-spacing: -.005em; }
.logos__i em {
  font-family: var(--mono); font-size: 10px; font-weight: 500; font-style: normal;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}

/* credential row with an institution mark on the right */
.cred--mark { grid-template-columns: 150px minmax(0, 1fr) auto; }
.cred--mark img { height: 46px; width: auto; max-width: 220px; object-fit: contain; object-position: right center; align-self: center; }

/* small mark inside a timeline entry */
.tl__mark { height: 30px; width: auto; max-width: 190px; object-fit: contain; object-position: left center; margin-bottom: 16px; filter: grayscale(1); opacity: .7; transition: filter .25s ease, opacity .25s ease; }
.tl__item:hover .tl__mark { filter: none; opacity: 1; }

/* text-only institution wall (kept for “In the room”) */
.wall { display: flex; flex-wrap: wrap; gap: 10px; }
.wall__i {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 20px;
  font-size: 14.5px; color: var(--ink-soft); font-weight: 500;
}
.wall__i em { display: block; font-family: var(--mono); font-size: 10px; font-weight: 500; font-style: normal; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--brand); color: #fff; text-decoration: none;
  border: 1px solid var(--brand); border-radius: var(--pill);
  padding: 13px 27px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  transition: background .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn svg { width: 13px; height: 13px; stroke: currentColor; }
.btn--ghost { background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand); color: #fff; }
.btn-row { display: flex; justify-content: flex-end; margin-top: 34px; }

/* quote */
.quote { border-left: 2px solid var(--brand); padding: 4px 0 4px 26px; margin: 0; }
.quote p { font-family: var(--display); font-style: italic; font-size: clamp(20px, 2.1vw, 26px); line-height: 1.44; font-weight: 400; color: var(--ink); margin: 0; letter-spacing: -.012em; }

/* page header (sub-pages) */
.phead { padding: 74px 0 58px; border-bottom: 1px solid var(--line-soft); }
.phead .mono { display: block; margin-bottom: 20px; color: var(--brand); }
.phead p { max-width: 660px; margin-top: 22px; }

/* contact */
.contact { background: var(--brand-deep); color: #fff; padding: 92px 0; }
.avatar {
  width: 78px; height: 78px; border-radius: 50%;
  object-fit: cover; object-position: 44% 38%;
  border: 2px solid rgba(255,255,255,.28);
  margin-bottom: 26px;
}
.contact .h-lg { color: #fff; }
.contact .mono { color: rgba(255,255,255,.62); }
.contact__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: end; }
.contact__links { display: flex; flex-direction: column; gap: 14px; }
.contact__links a { display: inline-flex; align-items: center; gap: 12px; color: rgba(255,255,255,.9); text-decoration: none; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.2); padding-bottom: 12px; transition: color .18s ease, border-color .18s ease; }
.contact__links a:hover { color: #fff; border-color: rgba(255,255,255,.6); }
.contact__links svg { width: 16px; height: 16px; stroke: rgba(255,255,255,.55); flex: none; }

/* footer */
.foot { background: var(--ink); color: rgba(255,255,255,.62); padding: 46px 0; }
.foot__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot__name { font-family: var(--display); font-size: 19px; font-weight: 500; color: #fff; letter-spacing: -.01em; }
.foot__meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; }
.foot a { color: rgba(255,255,255,.72); text-decoration: none; }
.foot a:hover { color: #fff; }

/* reveal */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1 !important; transform: none !important; transition: none; }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  :root { --gut: 32px; --band-y: 82px; }
  .sec { grid-template-columns: 1fr; gap: 26px; }
  .sec__label { position: static; padding-top: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
  .logos { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__left { order: 2; padding: 52px var(--gut) 56px; }
  .hero__inner { margin-left: 0; padding-right: 0; max-width: none; }
  .hero__right { order: 1; height: 380px; min-height: 0; }
  .hero__right img { object-position: center 18%; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 30px; }
  .proof { grid-template-columns: 1fr; gap: 26px; }
  .contact__grid { grid-template-columns: 1fr; gap: 40px; align-items: start; }
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 76px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 8px var(--gut) 20px;
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
  .nav__links a[aria-current="page"] { border-bottom-color: var(--line-soft); }
}
@media (max-width: 620px) {
  :root { --gut: 22px; --band-y: 64px; }
  body { font-size: 16px; }
  .cred, .cred--mark { grid-template-columns: 1fr; gap: 8px; }
  .cred__when { padding-top: 0; }
  .cred--mark img { object-position: left center; margin-top: 6px; }
  .logos { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .btn-row { justify-content: flex-start; }
  .hero__right { height: 300px; }
  .tl__item { padding-left: 26px; }
  .foot__in { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media print {
  .nav, .btn-row, .contact { display: none; }
  body { background: #fff; }
}
