/* 全局样式 */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  color: #050505;
}

/* -----------------  NAVBAR  ----------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}
/* nav flex wrapper for right alignment */
header nav {
  display: flex;
  justify-content: flex-end;   /* push all items to the right */
  align-items: center;         /* vertical centre */
  min-height: 60px;            /* unified bar height */
}

/* 默认透明导航 */
header nav ul {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  gap: 28px;                 /* consistent spacing (was 36px) */
  margin: 0;
  padding: 0 5vw;            /* symmetric horizontal padding */
  background: transparent;
}

header nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin: 0;
  transition: color 0.3s;
  padding: 0;
  line-height: 1;
}

header.scrolled {
  background: rgba(255,255,255,0.8);
}

header.scrolled nav ul li a {
  color: #050505;
}

/* ----- language buttons (default: overlay on hero) ----- */
header nav ul li button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;       /* transparent while hero is behind */
  color: #ffffff;                /* white text */
  border: 1.5px solid #ffffff;   /* white border */
  border-radius: 4px;
  padding: 4px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

/* hover in hero state: subtle white tint */
header nav ul li button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ---- when header turns white (scrolled) ---- */
header.scrolled nav ul li button {
  background: #ffffff;
  color: #000000;
  border: 1.5px solid #000000;
}

header.scrolled nav ul li button:hover {
  background: #e6e6e6;
}

/* -----------------  HERO  ----------------- */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  color: #fff;
}

.hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.8));
  z-index: 1;
}

/* 文字容器 */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;      /* 左对齐文字 */
  height: 100%;
  text-align: left;
  padding: 0 5vw;              /* 两侧响应式边距 */
  max-width: 700px;            /* 控制最大宽度，避免压缩重叠 */
  margin: 0 1vw 0 auto;   /* 更贴近右边，但仍保留 2vw 安全边距 */
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-content .static-text {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.hero-content p {
  font-size: 1.1rem;
  line-height: 1.4;
}

/* 打字光标 */
.typed-text {
  border-right: none;
}

.cursor {
  display: inline-block;
  width: 3px;
  background-color: #fff;
  margin-left: 3px;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* -----------------  PROJECTS OVERVIEW  ----------------- */
.projects-overview {
  padding: 80px 5vw 50px;
}

.projects-overview h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
}

/* -----------------  INSIGHTS OVERVIEW  ----------------- */
.insights-overview {
  padding: 60px 5vw 50px;
  text-align: left;
}

.insights-overview h2 {
  margin-left: 0;
  font-size: 2.5rem;
  margin-bottom: 30px;      /* match Projects spacing */
}

.insight-carousel {
  display: flex;
  gap: 36px;            /* wider gaps so enlarged card won't overlap */
  padding: 14px 40px 70px;  /* reduced bottom space so “Explore more” is closer */
  overflow-x: auto;
  overflow-y: visible;            /* let raised cards show fully */
  scroll-snap-type: x mandatory;
  scrollbar-width: none;          /* Firefox */
}

.insight-carousel::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.insight-card {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  scroll-snap-align: center;
  border-radius: 12px;
  box-shadow: none; /* no shadow at rest */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: visible;          /* allow caption below image */
}


.insight-card:hover {
  transform: translateY(-6px);        /* subtle lift without cropping */
  z-index: 3;
  box-shadow: 0 22px 34px 6px rgba(0,0,0,0.28);
}

/* === 3D hover effect for insight cards === */
.hover-3d{
  position:relative;
  transform-style:preserve-3d;          /* children follow 3‑D */
  transition:transform .35s cubic-bezier(.21,.6,.14,1);
  will-change:transform;
}
/* dynamic shadow that follows 3‑D transform */
.hover-3d::after{
  content:'';
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:rgba(0,0,0,.16);
  filter:blur(16px);
  transform:translateZ(-1px);          /* sit just behind the card */
  transition:inherit;                 /* follow parent transform */
  pointer-events:none;
}
/* populated by JS on pointer‑move */
.hover-3d.is-hovering {
  /* --rx & --ry will be set in JS (deg) */
  transform: perspective(900px) rotateX(var(--ry,0deg)) rotateY(var(--rx,0deg)) scale(1.05);
  z-index: 5;
}

.insight-card img {
  width: 100%;
  height: 280px;           /* fixed image height */
  object-fit: cover;
  display: block;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.insight-caption {
  margin: 0;
  padding: 10px 12px;   /* top‑bottom 10px, left‑right 12px */
  font-size: 1rem;
  font-weight: 600;
  color: var(--apple-black);
  background: #ffffff;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* “Explore more” 按钮复用现有样式 */
.insights-overview .see-more-wrapper {
  margin-top: 5px;
  text-align: center;
}

/* 卡片网格：桌面三列，自适应 */
.work-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* always three equal columns on desktop */
  gap: 30px;
  padding: 0 40px;   /* symmetric left‑right padding like Insights */
}

.projects-overview .see-more-wrapper {
  margin-top: 40px;
  text-align: center;
}

/* 单张卡片 */
.work-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  display: block;
  aspect-ratio: 16 / 10;          /* fills its grid cell */
  text-decoration: none;
}

/* 图片填充 */
.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 半透明灰色遮罩 */
.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);   /* 初始完全透明 */
  transition: background 0.3s;
}

/* 标题居中 */
.work-card h3 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #fff;
  font-size: 1.4rem;
  text-align: center;
  z-index: 2;
  width: 80%;
  opacity: 0;                  /* 默认隐藏文字 */
  transition: opacity 0.3s;
  word-wrap: break-word;
  text-wrap: balance;        /* modern browsers nicely balance lines */
}

/* 说明文字（默认隐藏） */
.work-card .work-caption {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  width: 85%;
  opacity: 0;
  transition: opacity 0.3s;
  word-wrap: break-word;
}

/* 悬停时遮罩稍微变浅 */
.work-card:hover::before {
  background: rgba(0, 0, 0, 0.55);  /* 悬停时灰色半透明 */
}

/* “See more” 按钮 */
/* “See more / Explore more” 文字链接风格 (black → blue) */
.btn-see-more,
.btn-see-more:visited {
  display: inline-flex;          /* 文字 + 箭头并排 */
  align-items: center;
  gap: 12px;                     /* 文字与箭头间距 */
  padding: 4px 0;                /* 上下留 4px，左右 0 */
  font-size: 1.6rem;             /* 根据需求调整 */
  color: #000000;                /* 默认黑色 */
  text-decoration: none;         /* 去掉默认下划线 */
  border: none;
  border-bottom: 3px solid #000000;  /* 底部粗下划线 */
  transition: color .25s, border-color .25s;
}

.btn-see-more::after {
  content: "\2192";              /* Unicode → */
  font-size: 1.4rem;
  transition: transform .25s;
}

.btn-see-more:hover,
.btn-see-more:focus {
  color: #326BF6;                /* 悬停变蓝 */
  border-bottom-color: #326BF6;
}

.btn-see-more:hover::after,
.btn-see-more:focus::after {
  transform: translateX(4px);    /* 箭头轻微右移 */
}

/* -----------------  SECTIONS  ----------------- */
.projects,
.insights,
.contact {
  padding: 30px 20px;
  text-align: center;
}

/* Projects */
.project {
  margin-bottom: 20px;
}

.project img {
  width: 100%;
  max-width: 400px;
  border-radius: 10px;
}

.project h3 {
  margin-top: 10px;
  font-size: 1.5rem;
}

/* Insights */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.photo-grid img {
  width: 100%;
  border-radius: 10px;
}

/* Contact */
.contact form {
  max-width: 500px;
  margin: 0 auto;
}

.contact form input,
.contact form textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  color: #050505;
  background-color: #fff;
}

/* .contact form button {
  padding: 10px 20px;
  border: none;
  background: #f39c12;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
} */

.btn-submit {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 34px;          /* 跟 .btn-see-more 一致 */
  border: 2px solid #4BA6EE;   /* 橙色描边 */
  background: transparent;
  color: #4BA6EE;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .25s, color .25s;
}

.btn-submit:hover {
  background: #4BA6EE;         /* 悬停填充 */
  color: #fff;
}

.contact .btn-submit{
  background:#ffffff;
  color:#1d1d1f;
  border:1px solid #C4C4C4;
}
.contact .btn-submit:hover,
.contact .btn-submit:focus{
  background: #ebebec;;
  color:#1d1d1f;
}
.contact form button:hover {
  background: #1d1d1f;
}

/* -----------------  GREETING ANIMATION  ----------------- */
#greeting-animation {
  position: fixed;
  inset: 0;
  background: #ebebec;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
  font-size: 2rem;
  color: #1d1d1f;
}

.greeting {
  position: absolute;
  opacity: 0;
  animation: fadeInOut 0.5s ease-in-out forwards;
}

.greeting:nth-child(1) { animation-delay: 0s; }
.greeting:nth-child(2) { animation-delay: 0.5s; }
.greeting:nth-child(3) { animation-delay: 1s; }
.greeting:nth-child(4) { animation-delay: 1.5s; }
.greeting:nth-child(5) { animation-delay: 2s; }
.greeting:nth-child(6) { animation-delay: 2.5s; }
.greeting:nth-child(7) { animation-delay: 3s; }
.greeting:nth-child(8) { animation-delay: 3.5s; }
.greeting:nth-child(9) { animation-delay: 4s; }

@keyframes fadeInOut {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* -----------------  ABOUT  ----------------- */
#about {
  padding: 80px 0;
  color: #06141b;
}

/* About section text size */
#about .about-col-2 p {
  font-size: 1.15rem;   /* was ~1rem, enlarge for readability */
  line-height: 1.6;
}

#about h2 {
  font-size: 2.5rem;      /* bigger than default 2.5 */
  margin-top: 0;
  margin-bottom: 30px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

.row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Center portrait and about-text vertically */
#about .row {
  align-items: center;   /* vertically centre content */
}

.about-col-1 {
  flex-basis: 35%;
}

.about-col-1 img {
  width: 80%;
  border-radius: 15px;
}

.about-col-2 {
  flex-basis: 60%;
}

/* --- Mobile nav hamburger (hidden on desktop) --- */
.hamburger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: none;          /* show only in media query */
}

.hamburger img {
  width: 32px;
  height: 32px;
}

/* mobile drawer default (desktop) */
.mobile-drawer { display: none; }

/* -----------------  MEDIA QUERIES  ----------------- */
@media (max-width: 700px) {
  /* hide desktop nav, show hamburger */
  header nav ul            { display: none; }
  .hamburger               { display: block; position: absolute; top: 20px; right: 5vw; }

  /* slide‑in drawer */
  .mobile-drawer {
    display: block;
    position: fixed;
    top: 0; left: -100%;
    width: 70%;
    height: 100%;
    background: #ebebec;          /* white/grey background */
    transition: left 0.3s ease;
    padding: 60px 24px;
    box-shadow: 4px 0 12px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
  }
  .mobile-drawer.open { left: 0; }

  /* close (×) button */
  .drawer-close {
    position: absolute;
    top: 20px; right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #1d1d1f;
    cursor: pointer;
  }

  /* drawer links */
  .drawer-links {
    list-style: none;
    padding: 0;
    margin: 80px 0 0 0;
  }
  .drawer-links li { margin-bottom: 32px; }
  .drawer-links a {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1d1d1f;
    text-decoration: none;
  }

  /* push language buttons to bottom on mobile drawer */
  .drawer-lang {
    margin-top: auto;
    display: flex;
    gap: 12px;
  }
  .drawer-lang button {
    flex: 1 1 80px;
  }

  /* keep previously added hero / about tweaks */
  header nav ul li          { margin: 10px 0; }

  .hero-content {
    margin: 0 20px;
    align-items: flex-start;
    text-align: left;
  }
  .hero-content h1       { font-size: 2rem; }
  .hero-content .static-text { font-size: 2rem; }
  .hero-content p        { font-size: 1rem; }

  .project img { max-width: 100%; }
  .photo-grid  { grid-template-columns: 1fr; }
  
  /* Project card overlay text — tablet */
  .work-card h3           { font-size: 1.2rem; line-height: 1.3; }
  .work-card .work-caption{ font-size: 0.9rem; }

  /* --- Project card overlay text: hide caption entirely on tablets & smaller --- */
  .work-card .work-caption{
    display:none;       /* prevent overflow / overlap */
  }
  .work-card h3{
    top:50%;            /* re‑centre title now that caption is gone */
    transform:translate(-50%,-50%);
  }
}

@media (max-width: 768px) {
  header nav ul {
    flex-direction: column;
    align-items: center;
  }
  header nav ul li {
    margin: 10px 0;
  }

  .hero-content {
    margin: 0 20px;
    align-items: flex-start;
    text-align: left;
  }
  .hero-content h1       { font-size: 2rem; }
  .hero-content .static-text { font-size: 2rem; }
  .hero-content p        { font-size: 1rem; }

  .project img { max-width: 100%; }
  .photo-grid  { grid-template-columns: 1fr; }
  
  /* Project card overlay text — tablet */
  .work-card h3           { font-size: 1.2rem; line-height: 1.3; }
  .work-card .work-caption{ font-size: 0.9rem; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .hero-content h1,
  .hero-content .static-text { font-size: 1.6rem; }
  .hero-content p           { font-size: 0.95rem; line-height: 1.3; }

  .hero-content {
    margin: 0 10px;         /* 小屏左右留 10px */
    align-items: center;    /* 居中对齐 */
    text-align: center;     /* 文本居中 */
  }
  .projects-overview h2 { font-size: 2rem; }
  .work-card { aspect-ratio: 4 / 3; }
  
  /* Project card overlay text — mobile */
  .work-card h3           { font-size: 1rem; line-height: 1.25; width: 90%; }
  .work-card .work-caption{ font-size: 0.8rem; width: 95%; }
  
  /* even narrower: push caption further down */
  .work-card h3           { top: 34%; }
  .work-card .work-caption{ top: 68%; }

  
}

/* Show title & caption when hovering over project card */
.work-card:hover h3,
.work-card:hover .work-caption {
  opacity: 1;
}

.section-divider {
  border: 0;
  height: 1px;
  width: 80%;
  margin: 60px auto;
}

/* --- Contact | Social icon squares --- */
.social-links {
  margin-top: 24px;
  gap: 12px;          /* was 20px – tighter spacing */
}

.social-links a {
  /* square background container */
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;      /* spacing between icons */
  background: #ffffff;          /* white square */
  border-radius: 6px;
  border: 1px solid #ebebec;
  transition: transform 0.25s ease;
  padding: 4px;          /* give the icon room while filling most of the square */
}

.social-links a:last-child { margin-right: 0; }

.social-links a:hover {
  transform: translateY(-4px);      /* subtle lift on hover */
}

.social-links img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* --- Download CV button --- */
.contact .row {
  display: flex;
  gap: 60px;
  justify-content: center;   /* center entire two‑column group */
  align-items: flex-start;
}

.contact-left  { flex: 0 0 32%; text-align: left; }

.contact-left h2 {
  color: #1d1d1f;        /* same as Insights */
  font-size: 2.5rem;     /* match Insights h2 size */
  margin: 0 0 40px 0;    /* no extra top space */
  text-align: left;
}

.contact-right {
  flex: 0 0 58%;
  max-width: 500px;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
  color: #1d1d1f;
  font-size: 1.05rem;
  line-height: 2;
}

.contact-list .ci-icon { margin-right: 10px; }

/* --- Social icon squares (grey) --- */
.social-links {
  display: flex;
  gap: 12px;          /* was 20px – tighter spacing */
  margin-bottom: 40px;
}

.social-links a {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;          /* white square */
  border-radius: 6px;
  border: 1px solid #ebebec;
  transition: transform .25s;
}
.social-links a:hover { transform: translateY(-4px); }

.social-links img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* --- Buttons use primary orange (#f39c12) --- */
.btn-download {
  display: inline-block;
  padding: 12px 34px;
  background: #000000;          /* solid black */
  color: #ffffff;               /* white text */
  border: none;
  border-radius: 28px;          /* pill-shape */
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease;
}
.btn-download:hover,
.btn-download:focus {
  background: #333333;          /* subtle lighten on hover */
}


/* --- Form fields --- */
.contact-right input,
.contact-right textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #2a2a2a;
  color: #ffffff;
  margin-bottom: 18px;
  font-size: 1rem;
}

.contact-right input::placeholder,
.contact-right textarea::placeholder { color:#9f9f9f; }

.contact .container {
  padding: 40px 5vw 20px;   /* less bottom space (20px) & top (40px) */
  max-width: none;     /* full‑width like Insights */
}

/* ---------- About section link style: gray, underline on hover ---------- */
.about-col-2 a {
  color: #777;             /* 纯灰 */
  transition: color 0.2s ease;
}

.about-col-2 a:hover,
.about-col-2 a:focus {
  text-decoration: underline; /* 悬停/聚焦时显示下划线 */
  color: #555;                /* 深灰，增加可见性 */
}

/* 版权行 */
.copyright{
  width: 100%;
  text-align: center;
  padding: 10px 0;   /* 仅保留很薄的上下内边距 */
  font-size: .9rem;
  color: #666;
  margin-top: 0;          /* 不要额外的上边距 */
}

/* ----- utility: hide any element ----- */
.hidden { display: none !important; }

/* ----- sending spinner ----- */
.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #d0d8ff;
  border-top-color: #326BF6;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* ===== Modal for form submission ===== */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;                           /* for fade‑in */
  animation: backdropFade .35s ease forwards;
}
.modal.hidden { display: none; }

.modal-content {
  background: #ffffff;
  padding: 24px 32px;
  border-radius: 8px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transform: scale(0.8);
  opacity: 0;
  animation: modalPop .45s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.modal-content p {
  margin: 0 0 20px;
  font-size: 1rem;
  color: #000;
}

.modal-content .btn-submit {
  display: inline-block;
  padding: 12px 34px;
  background: #ffffff;          /* white fill */
  color: #000000;               /* black text */
  border: 2px solid #000000;    /* black stroke */
  border-radius: 28px;          /* pill */
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.modal-content .btn-submit:hover,
.btn-submit:focus 
 {
  background: #000000;          /* invert on hover */
  color: #ffffff;
}


/* --- cute pop‑in effect for dialog --- */
@keyframes modalPop {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes backdropFade {
  to { opacity: 1; }
}
header nav ul li {
  display: flex;
  align-items: center;
}