
/* =========================================
   YUAN TIAN | ACADEMIC PORTFOLIO
   Global Design System
   ========================================= */

:root {
  --green: #718b70;
  --green-dark: #405d48;
  --green-light: #e8eee5;
  --cream: #faf9f5;
  --white: #ffffff;
  --yellow: #f5efd9;
  --text: #303b32;
  --muted: #7b837b;
  --border: #e8e9e1;

  --radius: 20px;
  --shadow: 0 10px 35px rgba(53, 75, 55, .08);
  --transition: all .3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: "Inter", "Noto Sans SC",
    "Noto Sans", sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
}

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

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

button, input, textarea, select {
  font: inherit;
}

/* CONTAINER */

.container {
  width: min(1160px, 90%);
  margin-inline: auto;
}

.section {
  padding: 100px 0;
}

.section-title {
  font-family: Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 18px;
}

.section-subtitle {
  color: var(--muted);
  max-width: 650px;
}

/* NAVIGATION */

.navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  background: rgba(250, 249, 245, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  color: var(--green-dark);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  position: relative;
  font-size: .92rem;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 0;
  height: 2px;
  background: var(--green);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.language-switch {
  display: flex;
  gap: 7px;
}

.language-switch button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 30px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: .78rem;
}

.language-switch button.active,
.language-switch button:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 1.6rem;
  cursor: pointer;
}

/* BUTTONS */

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 25px;
  border-radius: 50px;
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: var(--green-dark);
  transform: translateY(-3px);
}

.btn-outline {
  background: transparent;
  color: var(--green-dark);
}

.btn-outline:hover {
  color: white;
}

/* HERO */

.hero {
  min-height: 720px;
  padding: 150px 0 90px;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 65px;
}

.hero-label {
  color: var(--green);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: .8rem;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.2rem);
  font-weight: 400;
  line-height: 1.12;
  margin-bottom: 25px;
}

.hero h1 span {
  color: var(--green);
}

.hero-description {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.hero-image {
  width: 100%;
  height: 480px;
  object-fit: cover;
  border-radius: 48% 48% 22px 22px;
  box-shadow: var(--shadow);
}

/* STATISTICS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  padding: 32px 20px;
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow);
}

.stat-number {
  color: var(--green-dark);
  font-family: Georgia, serif;
  font-size: 2.7rem;
}

.stat-label {
  color: var(--muted);
  font-size: .9rem;
}

/* CARDS */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(53,75,55,.12);
}

.card-icon {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 1.5rem;
  margin-bottom: 22px;
}

.card h3 {
  margin-bottom: 12px;
  font-family: Georgia, serif;
  font-size: 1.35rem;
}

.card p {
  color: var(--muted);
  font-size: .95rem;
}

/* PAGE HEADER */

.page-header {
  padding: 155px 0 85px;
  background: linear-gradient(
    135deg,
    #e8eee5,
    #f7f4e9
  );
}

.page-header h1 {
  font-family: Georgia, serif;
  font-size: clamp(2.7rem, 5vw, 4rem);
  font-weight: 400;
}

.breadcrumb {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .9rem;
}

/* FILTERS */

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 35px 0;
}

.filter-btn {
  padding: 9px 20px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

/* RESEARCH */

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.research-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.research-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow);
}

.research-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.research-content {
  padding: 25px;
}

.research-tag {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 4px 13px;
  border-radius: 30px;
  font-size: .78rem;
  margin-bottom: 13px;
}

/* QUOTE */

.quote-section {
  background: var(--yellow);
  padding: 65px 30px;
  border-radius: 30px;
  text-align: center;
}

.quote-section blockquote {
  max-width: 760px;
  margin: auto;
  font-family: Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.5;
}

/* CONTACT */

.contact-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 50px;
}

.contact-form {
  background: white;
  border-radius: 25px;
  padding: 38px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: .9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  border-radius: 30px;
  border: 1px solid var(--border);
  outline: none;
  background: var(--cream);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
  border-radius: 18px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--green);
}

/* FAQ */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* CV */

.timeline {
  border-left: 2px solid var(--green-light);
  padding-left: 30px;
  margin-left: 10px;
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 9px;
  width: 14px;
  height: 14px;
  background: var(--green);
  border-radius: 50%;
}

.timeline-date {
  color: var(--green);
  font-size: .85rem;
  font-weight: 600;
}

/* BANNER */

.banner {
  background: var(--green-light);
  padding: 65px 30px;
  border-radius: 30px;
  text-align: center;
}

/* FOOTER */

.footer {
  background: #293b30;
  color: #f5f5ed;
  padding: 75px 0 25px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 50px;
}

.footer a {
  color: #d3dfd1;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  margin-top: 45px;
  padding-top: 22px;
  color: #b6c1b6;
  font-size: .85rem;
}

/* REVEAL ANIMATION */

.reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.active,
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-image {
    height: 400px;
  }

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

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

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

@media (max-width: 650px) {
  .section {
    padding: 70px 0;
  }

  .nav-inner {
    min-height: 68px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    width: 100%;
    background: var(--cream);
    padding: 25px;
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    padding: 120px 0 60px;
    min-height: auto;
  }

  .hero-image {
    height: 330px;
  }

  .stats-grid,
  .card-grid,
  .research-grid,
  .faq-grid,
  .form-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full {
    grid-column: auto;
  }

  .contact-form {
    padding: 24px;
  }

  .language-switch {
    gap: 3px;
  }

  .language-switch button {
    padding: 4px 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Clickable academic cards */

a.research-card {
  display: block;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

a.research-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(53, 75, 55, .12);
}

.card-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--green-dark);
  font-size: .9rem;
  font-weight: 600;
  transition: all .3s ease;
}

a.research-card:hover .card-link {
  transform: translateX(5px);
}
/* =================================
   CONTACT PAGE LAYOUT FIX
================================= */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 45px;
    align-items: start;
    width: 100%;
}

.contact-info-card {
    display: block;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 18px;
}

.contact-form {
    display: block;
    width: 100%;
    min-width: 0;
    background: white;
    padding: 35px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-form {
        padding: 22px;
    }
}
