/* Typography & base */
:root {
  --bg-dark: #222;
  --bg-panel: #2f2f2f;
  --bg-light: #f4f4f4;
  --text-main: #e6e6e6;
  --text-muted: #b5b5b5;
  --accent: #30D5C8;
  --accent-soft: rgba(48, 213, 200, 0.18);
  --card: #333;
  --border: #3f3f3f;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.section-inner {
  max-width: 980px;
  margin: 0 auto;
}

.measure {
  max-width: 72ch;
  margin: 0 auto;
}

/* Extra breathing room for dense sections */
.section-inner > .timeline,
.section-inner > .research-blocks {
  padding: 0.25rem 0.75rem;
}

.section-inner > .timeline {
  padding-left: 2.9rem;
  padding-right: 0.75rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: 85vh;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(34, 34, 34, 0.9)), url('Cosmi.png') center/cover no-repeat;
  display: flex;
  flex-direction: column;
}

.hero-overlay {
  margin: auto;
  text-align: center;
  max-width: 960px;
  padding: 6rem 1.5rem 8rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4rem);
  margin: 0.5rem 0 0.3rem;
}

.hero .subhead {
  font-size: 1.2rem;
  color: #f0f0f0;
  margin-bottom: 0.75rem;
}

.hero .tagline {
  color: #dedede;
  max-width: 720px;
  margin: 0.5rem auto 1.5rem;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
}

.hero-icons {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.hero-icons a {
  color: #f7f7f7;
  font-size: 1.05rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.hero-icons a:hover { transform: translateY(-3px); color: var(--accent); }

.scroll-down {
  color: #f7f7f7;
  font-size: 2rem;
  display: inline-block;
  margin-top: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.45);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 980px;
  margin: 0 auto;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.nav-links a {
  color: #f0f0f0;
  font-size: 0.95rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a.active,
.nav-links a:hover {
  background: rgba(24, 194, 180, 0.12);
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: #fff;
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: 22px;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-outline {
  border: 1px solid var(--accent);
  color: #fff;
}

.btn-outline:hover { background: var(--accent); color: #0f1114; transform: translateY(-1px); }

/* Sections */
.section {
  padding: 4.5rem clamp(1.25rem, 6vw, 3.75rem);
  background: var(--bg-panel);
}

.section.light {
  background: var(--bg-light);
  color: #1f1f1f;
}

.section.light a { color: #0aa79c; }
.section.light .section-header p { color: #4a4a4a; }
.section.light p { color: #3f3f3f; }
.section.light strong { color: #1f1f1f; }
.section.light h2,
.section.light h3 { color: #1f1f1f; }

.section.light .timeline::before {
  background: rgba(0, 0, 0, 0.22);
}

.section.light .timeline-meta,
.section.light .timeline-subtitle { color: #5a5a5a; }

.section.light .timeline-item::before {
  background: #0aa79c;
  box-shadow: 0 0 0 4px rgba(10, 167, 156, 0.16);
}

.highlight {
  background: #2a2a2a;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

.section-header p { color: var(--text-muted); }

.split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.media img {
  width: 100%;
  max-width: 320px;
  border-radius: 100% !important;
  border: 6px solid rgba(255, 255, 255, 0.08);
  box-shadow: none !important;
}

.content p { color: var(--text-muted); margin: 0.45rem 0; }
.content { max-width: 72ch; }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge {
  background: rgba(24, 194, 180, 0.12);
  color: var(--accent);
  padding: 0.4rem 0.75rem;
  border-radius: 16px;
  font-size: 0.9rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card p { color: var(--text-muted); margin-top: 0.6rem; }

.math-callout {
  margin-top: 1rem;
  color: #f7f7f7;
  font-weight: 600;
  font-size: 0.95rem;
}

.research-blocks {
  display: grid;
  gap: 1.4rem;
  max-width: 72ch;
  margin: 0 auto;
}

.research-block {
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.research-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.research-block h3 {
  margin-bottom: 0.4rem;
}

.research-block p {
  color: var(--text-muted);
}

.timeline {
  position: relative;
  padding-left: 2.9rem;
  display: grid;
  gap: 1.25rem;
  max-width: 72ch;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.timeline-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 600;
  padding-top: 0.75rem;
}

.timeline-label-subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.section.light .timeline-label-subtitle { color: #5a5a5a; }

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0.15rem 0 0.65rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.30rem;
  top: 0.55rem;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(24, 194, 180, 0.12);
}

.timeline-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 0.2rem;
}

.timeline-body {
  min-width: 0;
}

.timeline-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 0.1rem;
}

.timeline-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.mt-2 { margin-top: 0.85rem; }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.list-block {
  background: var(--card);
  padding: 1.3rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.list-block .meta {
  color: var(--text-muted);
  margin: 0.2rem 0 0.6rem;
  font-size: 0.95rem;
}

.list-block ul {
  list-style: none;
  color: var(--text-muted);
  display: grid;
  gap: 0.65rem;
  margin-top: 0.6rem;
}

.pub-list {
  list-style: none;
  display: grid;
  gap: 1.2rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

.section.light .pub-list { color: #3f3f3f; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.contact {
  background: #262626;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  max-width: 72ch;
  margin: 0 auto;
  color: var(--text-muted);
}

.footer {
  text-align: center;
  padding: 1.5rem;
  background: #1b1b1b;
  color: #8f8f8f;
}

/* Responsive */
@media (max-width: 960px) {
  .nav-inner { flex-wrap: wrap; gap: 0.8rem; }
  .nav-links { display: none; width: 100%; flex-direction: column; }
  .nav-links.show { display: flex; }
  .nav-toggle { display: flex; }
  .btn-outline { display: none; }
  .split { grid-template-columns: 1fr; text-align: center; }
  .media { display: flex; justify-content: center; }
}

@media (max-width: 640px) {
  .hero-overlay { padding: 5rem 1rem 6rem; }
  .section { padding: 3.5rem 1.25rem; }
  .content { max-width: none; }
  .timeline { padding-left: 0; max-width: none; }
  .timeline::before { display: none; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .timeline-item::before { display: none; }
  .timeline-meta { padding-top: 0; }
  .section-inner > .timeline,
  .section-inner > .research-blocks { padding: 0; }
}

/* ========================
   Gallery / Artworks Styles
   ======================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-card {
  display: block;
  position: relative; /* 关键：为了让文字能绝对定位在图片上 */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  cursor: pointer; /* 变成手指图标 */
}

/* 图片容器 */
.card-image {
  width: 100%;
  height: 250px;
  background-color: #eee;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* 鼠标悬停放大图片 */
.gallery-card:hover .card-image img {
  transform: scale(1.1);
}

/* --- 文字描述（悬停覆盖层） --- */
.card-info {
  position: absolute; /* 绝对定位，覆盖在图片上 */
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0)); /* 半透明渐变背景 */
  color: white;
  
  /* 关键：默认隐藏 */
  opacity: 0; 
  transform: translateY(20px);
  transition: all 0.3s ease;
}

/* 鼠标悬停时显示文字 */
.gallery-card:hover .card-info {
  opacity: 1;
  transform: translateY(0);
}

.card-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.card-info p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: #ddd;
}

/* ========================
   Lightbox (大图模式) Styles
   ======================== */
.lightbox {
  position: fixed;
  z-index: 9999; /* 保证在最上层 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9); /* 深黑色背景 */
  display: none; /* 默认不显示，靠JS控制显示 */
  justify-content: center;
  align-items: center;
  flex-direction: column;
  backdrop-filter: blur(5px); /* 背景模糊 */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-caption {
  margin-top: 1rem;
  text-align: center;
  color: white;
  max-width: 80%;
}

.lightbox-caption h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: white;
  cursor: pointer;
  transition: transform 0.2s;
}

.lightbox-close:hover {
  transform: scale(1.1);
  color: var(--accent);
}

/* ========================
   Back to Top Button
   ======================== */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  
  /* 颜色和形状 */
  background: var(--accent); /* 你的绿松石色 */
  color: #fff;
  border: none;
  border-radius: 0px; /* 保持直角风格 */
  
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  cursor: pointer;
  
  /* 默认隐藏 (透明) */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 当JS给它加上 'show' 类名时，它就会显示出来 */
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 鼠标悬停效果：背景变白，箭头变绿 */
#back-to-top:hover {
  background: #fff;
  color: var(--accent);
  transform: translateY(-3px); /* 微微上浮 */
}