/* =========================================================
   FANGJIE QI ACADEMIC PORTFOLIO
   Full stylesheet
========================================================= */


/* =========================
   VARIABLES
========================= */

:root {
  --text: #111111;
  --muted: #6f6f6f;
  --light: #f5f5f3;
  --border: #dededb;
  --accent: #4361ee;

  --max-width: 1280px;
}


/* =========================
   GLOBAL
========================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;

  color: var(--text);
  background: #ffffff;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;

  font-size: 17px;
  line-height: 1.6;

  overflow-x: hidden;
}

a {
  color: inherit;
}


/* =========================
   QUARTO CLEANUP
========================= */

#quarto-content {
  padding: 0;
}

main.content {
  max-width: none;
  padding: 0;
}

.quarto-title-block {
  display: none;
}

#quarto-header {
  display: none;
}


/* =========================
   TOP BAR
========================= */

.topbar {
  position: fixed;

  top: 0;
  left: 0;

  width: 100%;

  padding: 24px 40px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  z-index: 1000;

  background: rgba(255, 255, 255, 0.82);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.site-name {
  text-decoration: none;

  color: #111111;

  font-size: 1rem;
  font-weight: 650;

  letter-spacing: -0.015em;
}

.site-name:hover {
  color: #111111;
}


/* =========================
   MENU BUTTON
========================= */

.menu-button {
  width: auto;
  height: 44px;

  border: none;
  background: transparent;

  cursor: pointer;

  display: flex;
  flex-direction: row;

  align-items: center;
  justify-content: center;

  gap: 12px;

  padding: 8px;
}

.menu-button .menu-label {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.menu-icon {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-icon > span {
  display: block;

  width: 27px;
  height: 1.5px;

  background: #111111;

  transform-origin: center;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.menu-button:hover .menu-icon > span:first-child {
  transform: translateX(3px);
}

.menu-button:hover .menu-icon > span:last-child {
  transform: translateX(-3px);
}


/* =========================
   MENU OVERLAY
========================= */

.menu-overlay {
  position: fixed;

  top: 0;
  left: 0;
  bottom: 0;

  right: min(460px, 88vw);

  background: rgba(0, 0, 0, 0.28);

  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  opacity: 0;

  pointer-events: none;

  transition: opacity 0.35s ease;

  z-index: 1100;
}

.menu-overlay.open {
  opacity: 1;

  pointer-events: auto;
}


/* =========================
   SIDE MENU
========================= */

.side-menu {
  position: fixed;

  top: 0;
  right: 0;

  width: min(460px, 88vw);
  height: 100vh;

  background: #111111;
  color: white;

  z-index: 1200;

  padding: 36px 42px;

  display: flex;
  flex-direction: column;

  justify-content: space-between;

  transform: translateX(100%);

  transition:
    transform 0.46s
    cubic-bezier(0.77, 0, 0.18, 1);

  box-shadow:
    -20px 0 60px rgba(0, 0, 0, 0.10);
}

.side-menu.open {
  transform: translateX(0);
}


/* =========================
   CLOSE BUTTON
========================= */

.menu-close {
  align-self: flex-end;

  width: 44px;
  height: 44px;

  border: none;

  background: transparent;

  color: white;

  font-size: 2.5rem;
  font-weight: 200;

  line-height: 1;

  cursor: pointer;

  padding: 0;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.menu-close:hover {
  opacity: 0.65;
  transform: rotate(8deg);
}


/* =========================
   SIDE MENU NAV
========================= */

.side-menu-nav {
  display: flex;
  flex-direction: column;

  gap: 8px;

  margin-top: auto;
  margin-bottom: auto;
}

.side-menu-nav a {
  color: white;

  text-decoration: none;

  font-size: clamp(2.1rem, 4vw, 3.6rem);

  line-height: 1.08;

  letter-spacing: -0.045em;

  font-weight: 450;

  opacity: 0;

  transform: translateX(24px);

  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.side-menu.open .side-menu-nav a {
  opacity: 1;
  transform: translateX(0);
}

.side-menu.open .side-menu-nav a:nth-child(1) {
  transition-delay: 0.12s;
}

.side-menu.open .side-menu-nav a:nth-child(2) {
  transition-delay: 0.17s;
}

.side-menu.open .side-menu-nav a:nth-child(3) {
  transition-delay: 0.22s;
}

.side-menu.open .side-menu-nav a:nth-child(4) {
  transition-delay: 0.27s;
}

.side-menu.open .side-menu-nav a:nth-child(5) {
  transition-delay: 0.32s;
}

.side-menu-nav a:hover {
  opacity: 0.55 !important;

  transform: translateX(8px) !important;
}


/* =========================
   MENU FOOTER
========================= */

.menu-footer {
  color: #888888;
  font-size: 0.8rem;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.menu-copyright {
  margin-top: 24px;
  font-size: 0.72rem;
  color: #666666;
}


/* =========================
   BODY LOCK WHEN MENU OPEN
========================= */

body.menu-open {
  overflow: hidden;
}


/* =========================
   HERO
========================= */

.hero {
  max-width: var(--max-width);

  margin: 0 auto;

  min-height: 88vh;

  display: grid;

  grid-template-columns:
    0.9fr
    1.1fr;

  align-items: center;

  gap: 80px;

  padding:
    140px
    40px
    110px;
}

.hero-text {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 0.72rem;

  letter-spacing: 0.16em;

  font-weight: 650;

  color: #777777;

  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(4rem, 8vw, 7.5rem);

  letter-spacing: -0.065em;

  line-height: 0.92;

  margin:
    0
    0
    35px;

  font-weight: 650;
}

.hero-profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-bottom: 30px;
  font-size: 0.95rem;
  font-weight: 500;
}

.hero-profile-links a {
  color: var(--muted);
  text-decoration: none;
}

.hero-profile-links a:hover,
.hero-profile-links a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);

  letter-spacing: -0.035em;

  line-height: 1.1;

  max-width: 700px;

  margin:
    0
    0
    26px;

  font-weight: 450;
}

.hero h2 span {
  color: var(--muted);
}

.hero-description {
  max-width: 590px;

  font-size: 1.08rem;

  color: #666666;

  margin:
    0
    0
    35px;
}

.hero-buttons {
  display: flex;

  flex-wrap: wrap;

  gap: 14px;
}


/* =========================
   BUTTONS
========================= */

.button-primary,
.button-secondary,
.button-dark {
  display: inline-block;

  padding:
    12px
    21px;

  text-decoration: none;

  border-radius: 100px;

  font-size: 0.9rem;

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.button-primary {
  background: #111111;

  color: white;
}

.button-primary:hover {
  color: white;

  transform: translateY(-2px);
}

.button-secondary {
  border: 1px solid #cccccc;

  color: #222222;

  background: white;
}

.button-secondary:hover {
  color: black;

  background: #f3f3f3;

  border-color: #aaaaaa;

  transform: translateY(-2px);
}

.button-dark {
  border: 1px solid #555555;

  color: white;

  white-space: nowrap;
}

.button-dark:hover {
  color: white;

  border-color: #aaaaaa;

  transform: translateY(-2px);
}


/* =========================
   HERO MEDIA
========================= */

.hero-media {
  min-width: 0;
}

.hero-video-frame {
  overflow: hidden;
  border-radius: 4px;
}

.hero-media video,
.hero-media img {
  width: 100%;

  aspect-ratio: 4 / 5;

  object-fit: cover;

  display: block;

  border-radius: 4px;

  background: #eeeeee;
}

.video-caption {
  margin-top: 10px;

  font-size: 0.8rem;

  color: #777777;
}


/* =========================
   GENERAL SECTIONS
========================= */

.research-section,
.publication-section {
  max-width: var(--max-width);

  margin: 0 auto;

  padding:
    100px
    40px;
}

.research-section {
  border-top: 1px solid var(--border);
}

.publication-section {
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;

  justify-content: space-between;
  align-items: flex-end;

  gap: 30px;

  margin-bottom: 45px;
}

.section-heading h2 {
  margin: 0;

  font-size: clamp(2.7rem, 5vw, 4.6rem);

  line-height: 1;

  letter-spacing: -0.045em;

  font-weight: 550;
}

.view-all {
  color: #444444;

  text-decoration: none;

  font-size: 0.9rem;

  white-space: nowrap;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.view-all:hover {
  color: black;

  transform: translateX(4px);
}


/* =========================
   PROJECT GRID
========================= */

.project-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap:
    60px
    28px;
}

.project-card {
  display: block;

  color: inherit;

  text-decoration: none;
}

.project-card:hover {
  color: inherit;
}

.project-media {
  overflow: hidden;

  background: var(--light);

  margin-bottom: 22px;
}

.project-media video,
.project-media img {
  width: 100%;

  aspect-ratio: 16 / 10;

  object-fit: cover;

  display: block;

  transition:
    transform 0.5s
    cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-card:hover .project-media video,
.project-card:hover .project-media img {
  transform: scale(1.025);
}

.project-number {
  font-size: 0.75rem;

  color: #999999;

  margin-bottom: 10px;
}

.project-info h3 {
  font-size: 1.6rem;

  line-height: 1.15;

  letter-spacing: -0.025em;

  margin:
    0
    0
    10px;
}

.project-info p {
  color: #666666;

  max-width: 580px;

  margin:
    0
    0
    16px;
}

.project-tags {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;
}

.project-tags span {
  padding:
    5px
    10px;

  background: #f3f3f1;

  border-radius: 100px;

  font-size: 0.72rem;

  color: #555555;
}


/* =========================
   PUBLICATIONS
========================= */

.publication {
  display: grid;

  grid-template-columns:
    90px
    1fr
    auto;

  gap: 28px;

  padding:
    32px
    0;

  border-top: 1px solid var(--border);
}

.publication:last-child {
  border-bottom: 1px solid var(--border);
}

.publication-year {
  color: #888888;

  font-size: 0.85rem;
}

.publication h3 {
  margin:
    0
    0
    7px;

  font-size: 1.3rem;

  line-height: 1.25;

  letter-spacing: -0.015em;
}

.publication p {
  margin: 0;

  font-size: 0.9rem;
}

.journal {
  color: #777777;
}

.publication-links {
  display: flex;

  gap: 15px;

  align-items: start;

  white-space: nowrap;
}

.publication-links a {
  color: #222222;

  text-decoration: none;

  font-size: 0.82rem;
}

.publication-links a:hover {
  text-decoration: underline;
}


/* =========================
   ABOUT STRIP
========================= */

.about-strip {
  max-width: var(--max-width);

  margin:
    80px
    auto
    120px;

  padding:
    70px
    60px;

  background: #111111;

  color: white;

  display: flex;

  justify-content: space-between;
  align-items: flex-end;

  gap: 60px;
}

.about-strip .eyebrow {
  color: #aaaaaa;
}

.about-strip h2 {
  max-width: 800px;

  font-size: clamp(2rem, 4vw, 3.8rem);

  line-height: 1.05;

  letter-spacing: -0.045em;

  margin: 0;
}


/* =========================
   FOOTER
========================= */

.nav-footer {
  max-width: var(--max-width);

  margin: auto;

  border-top: 1px solid var(--border);

  padding:
    28px
    40px;

  font-size: 0.75rem;

  color: #777777;
}


/* =========================
   GENERAL ARTICLE PAGES
========================= */

.page-columns {
  max-width: 100%;
}

article {
  max-width: 900px;

  margin: 0 auto;

  padding:
    140px
    30px
    100px;
}

article h1 {
  font-size: clamp(3rem, 6vw, 5.5rem);

  letter-spacing: -0.055em;

  line-height: 0.95;

  margin-bottom: 35px;
}

article h2 {
  margin-top: 60px;

  font-size: 2rem;

  letter-spacing: -0.03em;
}

article h3 {
  margin-top: 40px;

  font-size: 1.4rem;
}

article p {
  color: #444444;
}

article img,
article video {
  max-width: 100%;

  height: auto;
}


/* =========================
   SELECTION
========================= */

::selection {
  background: #111111;
  color: white;
}


/* =========================
   TABLET
========================= */

@media (max-width: 1050px) {

  .hero {
    gap: 45px;

    grid-template-columns:
      1fr
      1fr;
  }

  .hero h1 {
    font-size: clamp(3.7rem, 7vw, 6rem);
  }

}


/* =========================
   MOBILE
========================= */

@media (max-width: 850px) {

  .topbar {
    padding:
      18px
      22px;
  }

  .hero {
    grid-template-columns: 1fr;

    gap: 45px;

    min-height: auto;

    padding:
      120px
      22px
      80px;
  }

  .hero h1 {
    font-size: clamp(3.7rem, 15vw, 6rem);
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .research-section,
  .publication-section {
    padding:
      75px
      22px;
  }

  .project-grid {
    grid-template-columns: 1fr;

    gap: 50px;
  }

  .section-heading {
    align-items: start;

    gap: 20px;
  }

  .publication {
    grid-template-columns: 1fr;

    gap: 8px;
  }

  .publication-links {
    margin-top: 8px;
  }

  .about-strip {
    margin:
      60px
      22px;

    padding:
      45px
      30px;

    flex-direction: column;

    align-items: start;
  }

  .side-menu {
    width: min(420px, 92vw);

    padding:
      28px
      28px;
  }

}

@media (max-width: 600px) {

  .menu-overlay {
    right: 100%;
  }

}


/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 600px) {

  .hero-video-frame video {
    transform: scale(1.2);
    transform-origin: center;
    object-position: center;
  }

  body {
    font-size: 16px;
  }

  .topbar {
    padding:
      16px
      18px;
  }

  .site-name {
    font-size: 0.95rem;
  }

  .hero {
    padding:
      105px
      18px
      65px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 17vw, 5rem);

    margin-bottom: 28px;
  }

  .hero h2 {
    font-size: 1.55rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .research-section,
  .publication-section {
    padding:
      65px
      18px;
  }

  .section-heading {
    flex-direction: column;

    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 2.8rem;
  }

  .project-info h3 {
    font-size: 1.4rem;
  }

  .about-strip {
    margin:
      50px
      18px;

    padding:
      38px
      24px;
  }

  .side-menu {
    width: 100%;

    padding:
      24px
      22px;
  }

  .side-menu-nav a {
    font-size: 2.7rem;
  }

  article {
    padding:
      110px
      20px
      80px;
  }

}
