/* The two GRIND sites share a masthead, type scale and Tennessee palette. */
:root {
  --orange: #ff8200;
  --smokey: #4b4b4b;
  --muted: #666;
  --line: #dbd6ca;
  --surface: #f2efe6;
  --paper: #faf8f2;
  --frame: min(89.6%, 1472px);
  --header-height: 76px;
  --section-space: clamp(2.5rem, 5vw, 5rem);
  color: var(--smokey);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 1rem); }
body { margin: 0; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, blockquote, ul { margin: 0; }
h1, h2, h3 { line-height: 1.14; text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--orange); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--smokey); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.skip-link:focus { position: fixed; top: .75rem; left: .75rem; z-index: 20; padding: .65rem 1rem; background: var(--paper); }
.main-content:focus { outline: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); }
.header-inner, .hero-content, .content-grid, .page-header, .content-wrapper, .pub-heading, .pub-catalog, .site-footer p {
  width: var(--frame); margin-inline: auto;
}
.header-inner { height: var(--header-height); display: flex; align-items: center; gap: 2rem; border-bottom: 1px solid var(--line); }
.header-name { display: inline-flex; align-items: center; gap: .85rem; flex: none; text-decoration: none; }
.name-en { font-weight: 700; font-size: 1.36rem; letter-spacing: -.055em; }
.name-en::after, .profile-name > span::after, .page-title::after, .pub-heading h1::after { content: '.'; color: var(--orange); }
.name-zh { padding-left: .85rem; border-left: 1px solid var(--line); font-size: .86rem; letter-spacing: .12em; }
.main-nav { align-self: stretch; margin-left: auto; display: flex; gap: clamp(1rem, 2.1vw, 2.25rem); }
.nav-link { display: flex; align-items: center; position: relative; text-decoration: none; font-size: .92rem; font-weight: 500; white-space: nowrap; }
.nav-link[aria-current]::after, .nav-link:hover::after { content: ''; position: absolute; inset: auto 0 -1px; height: 3px; background: var(--orange); }
.hamburger { display: none; align-items: center; justify-content: center; flex-direction: column; gap: 5px; width: 44px; height: 44px; margin-left: auto; border: 0; background: none; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--smokey); }
.hamburger[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }

.lab-return { flex: none; display: grid; align-items: center; min-height: 44px; padding: 4px 0; border-radius: 3px; }
.lab-return img { width: 108px; height: auto; }
.lab-return:hover img { opacity: .82; }

/* Profile and research on the landing page */
.hero-section { border-bottom: 1px solid var(--line); }
.profile-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(155px, 26%); grid-template-areas: 'bio photo'; align-items: center; column-gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(2rem, 4.5vw, 4.8rem); }
.portrait-wrapper { grid-area: photo; justify-self: center; display: block; width: min(100%,295px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent; perspective: 950px; }
.portrait-turn { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s ease; }
.portrait-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid var(--orange); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.portrait-back, .portrait-flip[aria-pressed="true"] .portrait-turn { transform: rotateY(180deg); }
@media (prefers-reduced-motion: reduce) { .portrait-turn { transition: none; } }
.profile-info { grid-area: bio; min-width: 0; }
.profile-title { display: flex; align-items: center; gap: .65rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.profile-title::before { content: ''; flex: none; width: 25px; height: 3px; background: var(--orange); }
.profile-name, .page-title, .pub-heading h1 { font-size: clamp(2.65rem, 5.5vw, 5.4rem); letter-spacing: -.065em; line-height: 1.06; }
.profile-name { margin: .8rem 0 .85rem; }
.pronoun { font-size: clamp(.85rem, 1.2vw, 1.05rem); color: var(--muted); font-weight: 400; letter-spacing: normal; white-space: nowrap; }
.profile-dept { font-size: clamp(1.16rem, 1.9vw, 1.7rem); line-height: 1.3; letter-spacing: -.026em; }
.profile-inst, .page-subtitle { margin-top: .4rem; color: var(--muted); }
.profile-inst i { margin-right: .3rem; }
.profile-links { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.profile-links { margin-top: 1.4rem; }
.profile-social { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .2rem; }
.profile-social a { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem 0; color: var(--muted); font-size: .88rem; text-decoration: none; }
.profile-social a:hover { text-decoration: underline; text-decoration-color: var(--orange); }
.pill-link, .pub-filters .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .88rem; color: var(--smokey); background: var(--paper); border: 1px solid var(--line); border-radius: 3px; font-size: .88rem; font-weight: 600; text-decoration: none; line-height: 1.4; }
.pill-link:hover, .pub-filters .btn:hover { border-color: var(--smokey); }
.pub-filters .btn { width: fit-content; padding: .63rem 1.08rem; font-size: .92rem; line-height: 1.35; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--section-space) clamp(2rem, 6vw, 6rem); padding-block: var(--section-space); }
.full-width { grid-column: 1 / -1; }
.card { min-width: 0; }
.card-title { margin: 0 0 1.2rem; font-size: clamp(1.5rem, 2.6vw, 2.5rem); letter-spacing: -.048em; }
.card-title > i { display: none; }
.editorial-card { display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem); max-width: 850px; padding: clamp(1.4rem, 3vw, 2.6rem); background: var(--surface); border-top: 3px solid var(--orange); }
.journal-cover { display: block; flex: 0 0 min(32%, 190px); box-shadow: 5px 8px 15px #26352b26; transition: transform .2s ease; }
.journal-cover:hover { transform: translateY(-3px); }
.journal-cover img { width: 100%; height: auto; }
.editorial-info { min-width: 0; }
.editorial-role { margin-bottom: .7rem; color: #9b4900; font-size: .9rem; font-weight: 700; }
.editorial-info h3 { max-width: 24ch; font: 400 clamp(1.4rem, 2.6vw, 2.35rem)/1.16 Georgia, serif; letter-spacing: -.025em; }
.editorial-info h3 a { text-decoration: none; }
.editorial-info h3 a:hover { text-decoration: underline; text-decoration-color: var(--orange); }
.editorial-publisher { margin-top: .8rem; color: var(--muted); }
.editorial-years { margin-top: .3rem; font-size: .9rem; font-weight: 600; }
@media (max-width: 480px) { .editorial-card { gap: 1.1rem; padding: 1.1rem; } .editorial-info h3 { font-size: 1.35rem; } .editorial-role, .editorial-years, .editorial-publisher { font-size: .875rem; } }
@media (prefers-reduced-motion: reduce) { .journal-cover { transition: none; } }
.interest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(1rem, 3vw, 3rem); }
.interest-item { display: flex; align-items: center; gap: .75rem; padding: .85rem 0; border-top: 1px solid var(--line); font-weight: 600; line-height: 1.35; }
.interest-icon { display: grid; place-items: center; flex: none; width: 2.3rem; height: 2.3rem; background: var(--surface); border-bottom: 2px solid var(--orange); }
.bio-text { max-width: 66ch; }
.bio-text + .bio-text { margin-top: .9rem; }
.news-list, .talk-list, .mentor-list, .awards-list, .review-list, .service-list { list-style: none; padding: 0; }
.news-item, .award-item, .talk-item, .mentor-item, .session-item, .service-item { display: grid; grid-template-columns: 6.4rem minmax(0,1fr); gap: 1rem; border-top: 1px solid var(--line); padding-block: .8rem; }
.news-item { grid-template-columns: 3rem minmax(0,1fr); gap: .5rem; font-size: .94rem; }
.news-date, .award-year, .talk-year, .mentor-year, .session-year, .service-years, .timeline-year, .course-term { color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.award-body, .award-source, .talk-venue, .mentor-topic, .session-venue, .service-detail, .teach-role { display: block; }
.award-source, .talk-venue, .mentor-topic, .session-venue, .service-detail, .teach-role, .timeline-detail { margin-top: .15rem; font-size: .92rem; color: var(--muted); }

/* Academic pages */
.page-header, .pub-heading { padding-block: clamp(2.25rem, 4.5vw, 4.8rem); border-bottom: 1px solid var(--line); }
.page-subtitle { max-width: 66ch; margin-top: .85rem; }
.content-wrapper { display: grid; gap: var(--section-space); padding-block: var(--section-space); }
.timeline-item, .review-list li { border-top: 1px solid var(--line); padding-block: 1rem; }
.timeline-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; }
.timeline-degree { font-size: clamp(1.05rem, 1.45vw, 1.35rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.35; }
.timeline-inst { display: flex; align-items: center; gap: .55rem; margin-block: .35rem; }
.school-logo { width: 1.8rem; height: 1.6rem; object-fit: contain; }
.teaching-quote { margin: 0; border-left: 3px solid var(--orange); padding: .6rem 1.3rem; }
.teaching-quote p { max-width: 70ch; font-size: clamp(1.05rem, 1.7vw, 1.45rem); line-height: 1.45; }
.teaching-quote cite { display: block; margin-top: .55rem; font-size: .9rem; color: var(--muted); }
.teach-block + .teach-block { margin-top: 2rem; }
.teach-inst { display: flex; gap: .8rem; align-items: center; margin-bottom: .8rem; }
.inst-badge { display: grid; place-items: center; flex: none; width: 2.8rem; height: 2.8rem; font-size: .8rem; font-weight: bold; background: var(--surface); border-bottom: 2px solid var(--orange); }
.course-item { display: grid; grid-template-columns: 8rem 1fr auto; gap: 1rem; align-items: baseline; border-top: 1px solid var(--line); padding: .65rem 0; }
.course-code { font-size: .84rem; font-weight: 700; }
.journal-chip { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; padding: .2rem .5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; font-size: .77rem; line-height: 1.4; }
.journal-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.site-footer p { padding-block: 1.5rem; font-size: .85rem; color: var(--muted); }

@media (max-width: 1180px) {
  :root { --header-height: 64px; }
  .hamburger { display: flex; margin-left: 0; }
  .lab-return { margin-left: auto; }
  .header-inner { gap: .6rem; }
  .main-nav { display: none; position: absolute; inset: 100% 0 auto; max-height: calc(100dvh - var(--header-height)); overflow-y: auto; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 5.2% 1rem; }
  .main-nav.open { display: grid; gap: 0; }
  .nav-link { min-height: 42px; width: fit-content; }
  .nav-link[aria-current]::after, .nav-link:hover::after { height: 2px; bottom: 4px; }
}
@media (max-width: 740px) {
  :root { --frame: 89%; }
  .content-grid { grid-template-columns: minmax(0,1fr); }
  .interest-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-card { grid-template-columns: minmax(0,1fr) minmax(110px,24%); column-gap: 1.1rem; }
}
@media (max-width: 520px) {
  .profile-card { grid-template-columns: minmax(0,1fr) 5rem; grid-template-areas: 'role photo' 'name photo' 'dept dept' 'inst inst' 'links links'; gap: 0 1rem; align-items: center; }
  .profile-info { display: contents; }
  .portrait-wrapper { width: 5rem; }
  .lab-return img { width: 83px; }
  .profile-title { grid-area: role; align-self: end; }
  .profile-name { grid-area: name; align-self: start; margin: .45rem 0 0; font-size: clamp(2.35rem,8.5vw,2.8rem); }
  .pronoun { display: block; margin-top: .2rem; }
  .profile-dept { grid-area: dept; margin-top: 1rem; }
  .profile-inst { grid-area: inst; }
  .profile-links { grid-area: links; gap: .4rem; margin-top: 1rem; }
  .interest-grid { grid-template-columns: minmax(0,1fr); }
  .interest-item { padding-block: .55rem; }
  .course-item { grid-template-columns: minmax(5rem,auto) 1fr; gap: .1rem .65rem; }
  .course-term { grid-column: 2; }
  .award-item, .talk-item, .mentor-item, .session-item, .service-item { grid-template-columns: 4.6rem minmax(0,1fr); gap: .65rem; }
}
