/* Base styles shared by all pages. Page-specific styles live in styles/pages/. */
@font-face {
  font-family: "Ethnocentric";
  src: local("Ethnocentric Rg"),
       local("Ethnocentric Bold"),
       local("Ethnocentric-Bold"),
       url("../assets/fonts/ethnocentric-rg-2.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Ethnocentric";
  src: url("../assets/fonts/ethnocentric-rg-it-1.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-soft: #f3f4f5;
  --text: #1f1f1f;
  --muted: #5f6368;
  --line: #e1e3e6;
  --accent: #9e2435;
  --accent-2: #7b1c2a;
  --accent-soft: #f7e9ec;
  --max-width: 1120px;
  --radius: 14px;
  --shadow: 0 8px 22px rgba(20, 20, 20, 0.07);
  --font-body: "Inter", "Segoe UI", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-brand: "Ethnocentric", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.65;
  color: var(--text);
  background: #ffffff;
}

.brand-mark,
.home-hero-brand h1 {
  font-family: var(--font-brand);
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.wrap {
  width: min(100% - 2.4rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
}

.brand-logo {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-mark {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.top-nav a {
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text);
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: transparent;
  color: var(--accent);
  text-decoration: none;
}

.top-nav a.active {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.72rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-dropdown-toggle::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.12rem;
  opacity: 0.55;
  transition: transform 0.2s ease, margin 0.2s ease, opacity 0.15s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible {
  color: var(--accent);
}

.nav-dropdown.is-active-group .nav-dropdown-toggle {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown.is-open .nav-dropdown-toggle,
.nav-dropdown:focus-within .nav-dropdown-toggle {
  color: var(--accent);
}

.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown.is-open .nav-dropdown-toggle::after,
.nav-dropdown:focus-within .nav-dropdown-toggle::after {
  transform: rotate(-135deg);
  margin-top: 0.08rem;
  opacity: 0.85;
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 0;
  min-width: 11rem;
  margin: 0;
  padding: 0;
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu,
.nav-dropdown.is-open .nav-submenu {
  display: flex;
}

.nav-submenu a {
  display: block;
  padding: 0.58rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-submenu a:hover,
.nav-submenu a:focus-visible {
  background: var(--surface-soft);
  color: var(--accent);
  text-decoration: none;
}

.nav-submenu a.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}

@media (min-width: 741px) {
  .nav-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 30;
    padding: 0.45rem 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
  }

  .nav-submenu a {
    background: var(--surface);
  }

  .nav-submenu a:first-child {
    border-radius: 8px 8px 0 0;
  }

  .nav-submenu a:last-child {
    border-radius: 0 0 8px 8px;
  }

  .nav-submenu a:only-child {
    border-radius: 8px;
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.45rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  padding: 3.2rem 0 2rem;
}

.page-hero {
  padding: 2.5rem 0 1.2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.14;
}

.page-title {
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
}

.hero-intro {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.45rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
}

.btn:hover,
.btn:focus-visible {
  text-decoration: none;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.btn-light {
  color: var(--text);
  border: 1px solid var(--line);
  background: #ffffff;
}

.hero-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 1.2rem 1.2rem 1.05rem;
}

.hero-panel h2 {
  margin-bottom: 0.55rem;
}

.hero-panel ul {
  margin: 0;
  padding-left: 1.1rem;
}

.hero-panel li {
  margin: 0.38rem 0;
  color: var(--muted);
}

.section {
  padding: 2.2rem 0;
}

.section-alt {
  background: #fafafa;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.9fr);
  gap: 1.4rem;
}

h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  line-height: 1.22;
}

h3 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  line-height: 1.35;
}

p {
  margin: 0 0 0.95rem;
}

p:last-child {
  margin-bottom: 0;
}

.section-lead {
  color: var(--muted);
  max-width: 70ch;
}

.about-section h2 {
  margin-bottom: 0.55rem;
}

.about-intro {
  margin: 0 0 1.6rem;
  max-width: none;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.55;
}

.about-pillars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.about-pillar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.15rem 1.2rem 1.05rem;
  box-shadow: var(--shadow);
}

.about-pillar-wide {
  grid-column: 1 / -1;
}

.about-pillar h3 {
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.about-pillar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.about-value {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.45;
}

.about-scope h3 {
  margin-bottom: 1rem;
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: var(--text);
}

.scope-figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.scope-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.tag-board {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.55rem;
}

.tag-board span {
  display: inline-block;
  padding: 0.48rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
  font-size: 0.9rem;
}

.card-grid,
.people-grid,
.demo-grid {
  display: grid;
  gap: 1rem;
}

.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.people-card,
.demo-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
}

.card p,
.demo-card p,
.people-card span {
  color: var(--muted);
}

.people-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.people-card ul {
  margin: 0;
  padding-left: 1rem;
}

.people-card li {
  margin: 0.52rem 0;
}

.people-card span {
  display: block;
  font-size: 0.93rem;
}


/* Shared utilities, footer, and back-to-top button. */
.demo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demo-card a {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
}

.link-arrow {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
}

.link-arrow::after {
  content: " ->";
}

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

.simple-list li {
  margin: 0.45rem 0;
}

.timeline {
  margin: 0;
  padding-left: 0;
  list-style: none;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.34rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 2px;
  background: #d5d8dd;
}

.timeline li {
  margin: 0.95rem 0;
  padding-left: 1.45rem;
  color: var(--muted);
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
}

.timeline li strong {
  color: var(--accent);
  font-weight: 700;
}

time {
  margin-right: 0.45rem;
  color: var(--text);
  font-weight: 600;
}

.site-footer {
  padding: 1.35rem 0 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.site-footer p {
  margin: 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  color: var(--muted);
}

.footer-brand strong {
  color: var(--text);
  font-weight: 700;
}

.footer-annals {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
}

.footer-label {
  color: var(--text);
  font-weight: 600;
}

.footer-annals a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.footer-annals a:hover,
.footer-annals a:focus-visible {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.82rem;
  color: #7a8087;
}

.back-to-top {
  position: fixed;
  right: max(1.15rem, env(safe-area-inset-right, 0px));
  bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  z-index: 90;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.45rem);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--accent-2);
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.14);
  outline: none;
}

.back-to-top-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.back-to-top-icon path {
  fill: currentColor;
}


@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.01ms, visibility 0.01ms;
    transform: none;
  }

  .back-to-top.is-visible {
    transform: none;
  }
}

/* Shared responsive layout rules. */
@media (max-width: 960px) {
  .hero-grid,
  .section-grid,
  .demo-grid,
  .people-grid,
  .card-grid,
  .about-pillars,
  .honors-stats,
  .projects-stats,
  .pub-stats,
  .awards-grid,
  .research-themes,
  .research-grid,
  .demos-gallery-grid,
  .home-explore-grid {
    grid-template-columns: 1fr;
  }

  .awards-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-pillar-wide {
    grid-column: auto;
  }

  .people-page .profile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.475rem 2.025rem;
  }

  .hero {
    padding-top: 2.5rem;
  }
}

@media (max-width: 860px) {
  .faculty-profile {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .faculty-summary {
    max-width: none;
    width: 100%;
    flex-direction: row;
    align-items: stretch;
  }

  .faculty-summary .profile-image {
    flex: 0 0 clamp(6.5rem, 28vw, 8.75rem);
    aspect-ratio: 3 / 4;
    min-height: 0;
  }

  .people-page .faculty-summary .profile-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem 0.9rem 0.75rem 0.55rem;
  }

  .people-page .faculty-detail {
    border-radius: 12px;
    padding: 1rem 1.05rem;
  }

  .people-page .faculty-bio {
    font-size: 0.9rem;
    line-height: 1.62;
  }
}

@media (max-width: 740px) {
  .footer-row {
    flex-direction: column;
    gap: 0.55rem;
  }

  .home-hero {
    padding-top: 2.5rem;
  }

  .home-updates-head {
    align-items: flex-start;
  }

  .honors-stats,
  .projects-stats,
  .pub-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .awards-grid-compact {
    grid-template-columns: 1fr;
  }

  .nav-wrap {
    position: relative;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.55rem 0;
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .top-nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    margin-top: 0;
    border-top: 1px solid transparent;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease, margin 0.2s ease;
  }

  .site-header.is-nav-open .top-nav {
    max-height: 28rem;
    opacity: 1;
    pointer-events: auto;
    padding: 0.35rem 0 0.65rem;
    margin-top: 0.35rem;
    border-top-color: var(--line);
  }

  .top-nav a {
    padding: 0.72rem 0.5rem;
    border-radius: 8px;
    box-shadow: none;
  }

  .top-nav a.active {
    box-shadow: none;
    background: var(--surface-soft);
  }

  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0.72rem 0.5rem;
    box-shadow: none;
  }

  .nav-dropdown.is-active-group .nav-dropdown-toggle {
    box-shadow: none;
    background: var(--surface-soft);
  }

  .nav-submenu {
    position: static;
    min-width: 0;
    margin: 0.15rem 0 0.45rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    box-shadow: none;
    filter: none;
    gap: 0.2rem;
  }

  .nav-submenu a {
    border: 0;
    border-radius: 8px;
    background: var(--surface);
  }

  .nav-submenu a.active {
    background: var(--accent-soft);
  }

  .nav-dropdown:hover .nav-submenu,
  .nav-dropdown:focus-within .nav-submenu {
    display: none;
  }

  .nav-dropdown.is-open .nav-submenu {
    display: flex;
  }


@media (max-width: 740px) {
  .faculty-profile {
    padding-bottom: 2rem;
  }

  .people-page .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 1.8rem;
  }

  .people-page .profile-grid .profile-content {
    padding: 0.34rem 0.38rem 0.38rem;
  }

  .people-page .profile-grid .profile-name {
    font-size: 0.82rem;
  }

  .people-page .profile-grid .profile-role,
  .people-page .profile-grid .profile-meta {
    font-size: 0.72rem;
  }

  .alumni-list {
    grid-template-columns: 1fr;
  }
}
}
@media (max-width: 740px) and (min-width: 520px) {
  .people-page .profile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.325rem 1.875rem;
  }
}
