/* Mingyue Tang homepage stylesheet.
   Tokens live in :root. The dark band at the top holds the name, statement, and
   contact links; everything below it is the light reading area.
   Sections below follow the page order in index.html. */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/SourceSerif4-Roman.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/SourceSerif4-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/IBMPlexSans-Variable.woff2") format("woff2");
}

:root {
  --paper: #fbfbfa;
  --ink: #1b2330;
  --muted: #5b6573;
  --rule: #dfe3e8;
  --link: #1f5c99;
  --link-dark: #163f6b;
  --wash: #f1f4f7;

  --band: #0f1b2a;
  --band-raised: #14243a;
  --band-ink: #e9eef4;
  --band-muted: #9fb0c2;
  --band-rule: rgba(159, 176, 194, 0.22);
  --accent: #e3a55a; /* CV link and chirp mark */
  --focus: #6cc6d8; /* focus ring on dark surfaces */

  /* research topics: bright on the band, darker on the light page */
  --topic-wireless: #e3a55a;
  --topic-health: #7cc7a0;
  --topic-graph: #a3aef2;
  --topic-federated: #6cc6d8;
  --topic-wireless-ink: #b06d24;
  --topic-health-ink: #3a8a62;
  --topic-graph-ink: #5b67c7;
  --topic-federated-ink: #2b8799;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --container: 72rem;
  --gutter: 1.5rem;
  --bar-height: 3rem;
}

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

html {
  color-scheme: light;
  scroll-padding-top: calc(var(--bar-height) + 1rem);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgba(31, 92, 153, 0.15);
}

img {
  max-width: 100%;
  height: auto;
}

p {
  margin: 0 0 0.9rem;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(31, 92, 153, 0.35);
  touch-action: manipulation;
}

a:hover {
  color: var(--link-dark);
  text-decoration-color: currentColor;
}

a:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 30;
  padding: 0.4rem 0.7rem;
  background: #fff;
  color: var(--link);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.skip-link:focus {
  left: 1rem;
}

/* Top bar ---------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--band);
  border-bottom: 1px solid var(--band-rule);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--bar-height);
}

.topbar a {
  text-decoration: none;
  white-space: nowrap;
}

.topbar a:hover {
  text-decoration: underline;
}

.topbar a:focus-visible {
  outline-color: var(--focus);
}

.topbar-name {
  color: var(--band-ink);
  font-weight: 600;
  font-size: 0.9375rem;
}

.topbar-nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-nav::-webkit-scrollbar {
  display: none;
}

.topbar-nav ul {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topbar-nav a {
  color: var(--band-muted);
}

.topbar-nav a:hover {
  color: var(--band-ink);
}

.topbar .topbar-cv,
.topbar .topbar-cv:hover {
  color: var(--accent);
  font-weight: 600;
}

/* Header band ------------------------------------------------------------ */

.band {
  padding-bottom: 2.75rem;
  background: var(--band);
  color: var(--band-ink);
}

.band a {
  color: var(--band-ink);
  text-decoration-color: rgba(233, 238, 244, 0.35);
}

.band a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}

.band a:focus-visible,
.band input:focus-visible {
  outline-color: var(--focus);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem;
  grid-template-areas:
    "head photo"
    "text photo";
  column-gap: 3rem;
  align-items: end;
  padding-top: 3.5rem;
}

.intro-head {
  grid-area: head;
}

.intro-text {
  grid-area: text;
}

.intro h1 {
  margin: 0;
  font-size: 3.25rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.signature {
  display: block;
  width: 15rem;
  margin: 0.85rem 0 0.15rem;
}

.role {
  margin: 0.7rem 0 1.1rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--band-muted);
}

.statement {
  max-width: 44rem;
  margin: 0 0 1.25rem;
  font-size: 1.1875rem;
  line-height: 1.55;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.contact a {
  font-weight: 500;
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

.contact .email {
  color: var(--band-muted);
}

.contact .cv,
.contact .cv:hover {
  color: var(--accent);
  font-weight: 600;
}

.portrait {
  grid-area: photo;
  align-self: center;
  display: block;
  width: 100%;
  border: 1px solid var(--band-rule);
}

/* Timeline (js/timeline.js) */

.journey {
  margin: 2.25rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--band-rule);
}

.journey[hidden] {
  display: none;
}

.journey-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--band-rule) transparent;
}

.journey-chart {
  display: block;
  font-family: var(--sans);
}

.journey-chart .grid line {
  stroke: rgba(159, 176, 194, 0.14);
}

.journey-chart .now {
  stroke: var(--accent);
  stroke-dasharray: 2 3;
}

.journey-chart .lane-label,
.journey-chart .year {
  fill: var(--band-muted);
  font-size: 11px;
}

.journey-chart .year {
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}

.journey-chart .bar-study {
  fill: rgba(233, 238, 244, 0.1);
  stroke: rgba(233, 238, 244, 0.3);
}

.journey-chart .bar-study-label {
  fill: var(--band-ink);
  font-size: 11px;
  font-weight: 500;
}

.journey-chart .bar-role {
  fill: rgba(233, 238, 244, 0.55);
}

.journey-chart .role-label {
  fill: var(--band-muted);
  font-size: 11px;
}

.journey-chart .award {
  fill: var(--band-ink);
}

.journey-chart .dot {
  fill: var(--band-muted);
  stroke: var(--band);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
}

.journey-chart .dot-wireless {
  fill: var(--topic-wireless);
}

.journey-chart .dot-health {
  fill: var(--topic-health);
}

.journey-chart .dot-graph {
  fill: var(--topic-graph);
}

.journey-chart .dot-federated {
  fill: var(--topic-federated);
}

.journey-chart .mark {
  cursor: pointer;
  text-decoration: none;
}

.journey-chart .mark:hover .bar-study {
  fill: rgba(233, 238, 244, 0.2);
}

.journey-chart .mark:hover .bar-role,
.journey-chart .mark:hover .award {
  fill: #fff;
}

.journey-chart .mark:hover .role-label {
  fill: var(--band-ink);
}

.journey-chart .mark:hover .dot {
  transform: scale(1.4);
}

.journey-chart .mark-paper.is-dim {
  opacity: 0.18;
}

.journey-caption {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--band-muted);
}

.journey-detail {
  min-height: 1.3rem;
  margin: 0.6rem 0 0;
  line-height: 1.5;
}

.journey-detail .detail-meta {
  margin-right: 0.6rem;
  color: var(--accent);
  font-weight: 600;
}

.journey-detail .detail-title {
  color: var(--band-ink);
}

.hint-touch {
  display: none;
}

.journey-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  background: transparent;
  border: 1px solid var(--band-rule);
  border-radius: 4px;
  color: var(--band-ink);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.chip:hover {
  border-color: rgba(233, 238, 244, 0.55);
}

.chip[aria-pressed="true"] {
  background: rgba(233, 238, 244, 0.12);
  border-color: var(--band-ink);
}

.chip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.chip-swatch {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--swatch, var(--band-muted));
}

.chip[data-topic="wireless"] {
  --swatch: var(--topic-wireless);
}

.chip[data-topic="health"] {
  --swatch: var(--topic-health);
}

.chip[data-topic="graph"] {
  --swatch: var(--topic-graph);
}

.chip[data-topic="federated"] {
  --swatch: var(--topic-federated);
}

.chip-count {
  color: var(--band-muted);
  font-variant-numeric: tabular-nums;
}

@media (hover: none) {
  .hint-hover {
    display: none;
  }

  .hint-touch {
    display: inline;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .journey-chart .dot {
    transition: transform 0.15s ease-out;
  }

  .journey-chart .mark-paper {
    transition: opacity 0.2s ease-out;
  }

  .chip {
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
  }
}

/* Sections --------------------------------------------------------------- */

main {
  padding-bottom: 1rem;
}

.section {
  margin-top: 3.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}

main > .section:first-child {
  margin-top: 0;
  padding-top: 2.75rem;
  border-top: 0;
}

h1,
h2 {
  text-wrap: balance;
}

h3,
h4 {
  text-wrap: pretty;
}

h2 {
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.3;
}

.section-note {
  margin: -0.75rem 0 1.25rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.subhead {
  margin: 2.25rem 0 0.25rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.section > h2 + .subhead {
  margin-top: 0;
}

.meta {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3.5rem;
  align-items: start;
}

/* News ------------------------------------------------------------------- */

.news {
  columns: 2 24rem;
  column-gap: 3.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news li {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.45rem;
  break-inside: avoid;
}

.news time,
.dated time {
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news p {
  margin: 0;
}

.more {
  margin-top: 0.75rem;
}

.more summary {
  width: fit-content;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--link);
  cursor: pointer;
  touch-action: manipulation;
}

.more summary:hover {
  text-decoration: underline;
}

.more[open] summary {
  margin-bottom: 0.5rem;
}

/* About ------------------------------------------------------------------ */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem 3.5rem;
}

.about-main p {
  max-width: 42rem;
}

.about-side .subhead {
  margin-top: 0;
}

.interests {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.interests li {
  margin-bottom: 0.35rem;
  padding-left: 0.2rem;
}

.interests li::marker {
  color: var(--muted);
}

.aside {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Projects --------------------------------------------------------------- */

.project {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 1.75rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
}

.project:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.project-body {
  max-width: 44rem;
}

.project-fig {
  margin: 0;
}

.project-fig img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--rule);
}

.fig-todo {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 0.75rem;
  background: var(--wash);
  border: 1px dashed #b3bcc5;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8125rem;
  text-align: center;
}

.project h3,
.project h4 {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
}

.project .meta {
  margin: 0.2rem 0 0.55rem;
}

.question {
  margin: 0 0 0.4rem;
  font-style: italic;
}

.project-body > p:last-child {
  margin-bottom: 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0.55rem 0 0;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.links a {
  font-weight: 500;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.project.is-compact {
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 1rem;
}

.project.is-compact h4 {
  font-size: 1rem;
}

.project.is-compact p {
  font-size: 0.9375rem;
}

.subhead + .project.is-compact {
  border-top: 0;
}

/* Publications ----------------------------------------------------------- */

.pub-year {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
}

.pub-year:first-of-type {
  margin-top: 0;
}

.pub-year h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pubs {
  display: grid;
  gap: 1.15rem;
  max-width: 56rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub p {
  margin: 0;
}

.pub-title {
  font-weight: 600;
  line-height: 1.4;
  text-wrap: pretty;
}

.pub-authors {
  font-size: 0.9375rem;
  color: var(--muted);
}

.pub-authors strong {
  color: var(--ink);
  font-weight: 600;
}

.pub .links {
  margin-top: 0.15rem;
}

.venue {
  color: var(--ink);
  font-weight: 500;
}

a.venue {
  text-decoration: none;
}

a.venue:hover {
  color: var(--ink);
  text-decoration: underline;
}

.note {
  color: var(--ink);
  font-weight: 600;
}

/* Experience ------------------------------------------------------------- */

.exp li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1.1rem;
  padding-block: 0.95rem;
  border-top: 1px solid var(--rule);
}

.exp li:first-child {
  border-top: 0;
  padding-top: 0;
}

.exp-logo {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}

.exp p {
  margin: 0;
}

.exp-org {
  font-weight: 600;
}

.exp-org a {
  color: var(--ink);
  text-decoration-color: var(--rule);
}

.exp-org a:hover {
  text-decoration-color: currentColor;
}

.exp .meta {
  margin-top: 0.15rem;
}

/* Awards, service, teaching --------------------------------------------- */

.dated li {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.3rem;
}

.service-list {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}

.service-list li {
  margin-bottom: 0.15rem;
}

.service-list li::marker {
  color: var(--muted);
}

/* Footer ----------------------------------------------------------------- */

.footer {
  margin-top: 3rem;
  padding-block: 1.5rem 2.5rem;
  background: var(--band);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--band-muted);
}

/* Topic dots and filtering (js/timeline.js) ----------------------------- */

[data-topic^="wireless"] {
  --dot: var(--topic-wireless-ink);
}

[data-topic^="health"] {
  --dot: var(--topic-health-ink);
}

[data-topic^="graph"] {
  --dot: var(--topic-graph-ink);
}

[data-topic^="federated"] {
  --dot: var(--topic-federated-ink);
}

.pub[data-topic] .pub-title::before,
.project[data-topic] h3::before,
.project[data-topic] h4::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  vertical-align: 0.08em;
  background: var(--dot, var(--muted));
}

.is-filtered {
  display: none !important;
}

.filter-status {
  margin: -0.5rem 0 1.25rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.filter-status[hidden] {
  display: none;
}

.filter-status button {
  margin-left: 0.6rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--link);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.filter-status button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.section h2[tabindex="-1"]:focus {
  outline: none;
}

.pub:target,
.exp li:target,
#awards li:target {
  border-radius: 4px;
  background: rgba(227, 165, 90, 0.16);
  box-shadow: 0 0 0 0.5rem rgba(227, 165, 90, 0.16);
}

/* Medium screens --------------------------------------------------------- */

@media (max-width: 960px) {

  .pair,
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

/* Small screens ---------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --gutter: 1.25rem;
  }

  body {
    font-size: 1rem;
  }

  .topbar-name {
    display: none;
  }

  .topbar-nav {
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
    mask-image: linear-gradient(to right, #000 82%, transparent);
  }

  .intro {
    grid-template-columns: minmax(0, 1fr) 6rem;
    grid-template-areas:
      "head photo"
      "text text";
    column-gap: 1rem;
    align-items: center;
    padding-top: 2rem;
  }

  .intro h1 {
    font-size: 2.25rem;
  }

  .signature {
    width: 10.5rem;
  }

  .journey {
    margin-top: 1.75rem;
    padding-top: 1.1rem;
  }

  .role {
    margin-bottom: 0;
  }

  .statement {
    margin-top: 1.1rem;
    font-size: 1.0625rem;
  }

  .section {
    margin-top: 2.25rem;
    padding-top: 1.75rem;
  }

  .project,
  .project.is-compact {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .project .fig-todo {
    aspect-ratio: auto;
    padding-block: 0.6rem;
  }

  .project.is-compact .project-fig {
    max-width: 16rem;
  }

  .pub-year {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .news li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

@media print {
  .topbar,
  .skip-link {
    display: none;
  }

  .band,
  .footer {
    background: none;
    color: var(--ink);
  }

  .band a {
    color: var(--link);
  }

  .more:not([open]) > *:not(summary) {
    display: block;
  }
}
