/* ========================================
   LI ZEXU Personal Site
   Minimal Editorial — White ground, centered Hero, SVG folder stack
   ======================================== */

:root {
  /* Backgrounds */
  --bg: #FFFFFF;
  --surface: #F7F7F5;
  --surface-alt: #FAFAF8;
  --surface-hover: #F0F0EE;
  --dark: #0A0A0A;
  --dark-surface: #151515;

  /* Borders */
  --border: #E8E8E8;
  --border-strong: #1A1A1A;
  --border-hover: #1A1A1A;
  --border-dark: rgba(255,255,255,0.12);

  /* Text */
  --text: #0A0A0A;
  --text-secondary: #555555;
  --text-tertiary: #999999;
  --text-invert: #FFFFFF;
  --text-invert-dim: rgba(255,255,255,0.6);

  /* Accent */
  --accent: #1A4FFF;
  --accent-hover: #0033CC;
  --accent-soft: #E8EEFF;

  /* Semantic */
  --success: #2E7D32;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 600ms;

  /* Layout */
  --container: 1280px;
  --pad-x: 40px;
  --section-pad: 120px;
  --nav-h: 68px;
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}

.mono {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.dim { color: var(--text-tertiary); }
.hl { background: linear-gradient(180deg, transparent 60%, rgba(26,79,255,0.15) 60%); padding: 0 2px; }
em { font-style: normal; color: var(--text); font-weight: 500; }

/* ========== NAV (sticky with links) ========== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 40px;
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  z-index: 100;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255,255,255,0.9);
}
.nav__brand {
  font: 500 13px/1 'Inter', 'Noto Sans SC', sans-serif;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 4px;
  justify-self: start;
}
.nav__brand-name { font-weight: 600; letter-spacing: 0.08em; }
.nav__brand-sub { color: var(--text-tertiary); font-weight: 400; font-size: 12px; }

.nav__links {
  display: flex;
  gap: 4px;
  justify-self: center;
  font: 500 13px/1 'Inter', 'Noto Sans SC', sans-serif;
}
.nav__links a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  transition: color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
  position: relative;
}
.nav__links a .mono {
  font-size: 11px;
  color: var(--text-tertiary);
  transition: color var(--dur-base) var(--ease-out);
}
.nav__links a:hover {
  color: var(--text);
  background: var(--surface);
}
.nav__links a:hover .mono { color: var(--text-secondary); }
.nav__links a.is-active {
  color: var(--text);
  background: var(--text);
  color: var(--text-invert);
}
.nav__links a.is-active .mono { color: rgba(255,255,255,0.6); }

.nav__pill {
  justify-self: end;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: 500 11px/1 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface);
}

/* ========== HERO (centered, greeting style) ========== */
.hero {
  padding-top: calc(var(--nav-h) + 32px);
  padding-bottom: 24px;
  /* No overflow clip — let folders bleed into the About section's top whitespace
     so the transition is soft instead of "guillotined". */
  position: relative;
}
.hero__head {
  text-align: center;
  padding-bottom: 24px;
}
.hero__kicker { margin-bottom: 16px; }
.hero-display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(80px, 14vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.035em;
  color: var(--text);
  margin: 0 auto 24px;
  opacity: 0;
  transform: translateY(12px);
  animation: rise 900ms var(--ease-out) 200ms forwards;
  font-variation-settings: "opsz" 144;
}
.hero-display--greeting {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 5.2vw, 60px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 auto 14px;
  max-width: 14em;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero__sub {
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
}
.hero__sub .sep { display: inline-block; margin: 0 10px; color: var(--text-tertiary); }

.hero__cta {
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ========== FOLDER STACK ========== */
.folder-stack {
  position: relative;
  width: 100%;
  height: 420px;
  margin: 0 auto;
  max-width: 1100px;
  perspective: 1400px;
  /* let labels at folder bottom render fully; outer folders need ~30px buffer */
  overflow: visible;
}

.folder {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 240px;
  height: 280px;
  text-decoration: none;
  cursor: pointer;
  --f-px: 0px;
  --f-py: 0px;
  transform:
    translate(calc(-50% + var(--x) + var(--f-px) * var(--fx, 1)),
              calc(-50% + var(--y) + var(--f-py) * var(--fy, 1)))
    rotate(var(--rot))
    scale(var(--scale, 1));
  transition: transform 520ms var(--ease-out),
              filter 520ms var(--ease-out);
  z-index: var(--z, 1);
  transform-origin: center 80%;
}

.folder__svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 16px 24px rgba(10,10,10,0.16))
          drop-shadow(0 40px 60px rgba(10,10,10,0.12));
  transition: filter 520ms var(--ease-out);
}

.folder__body { fill: var(--f-body); }
.folder__tab  { fill: var(--f-tab); }
.folder__shine {
  stroke: var(--f-shine, rgba(255,255,255,0.3));
  stroke-width: 1;
  fill: none;
}
.folder__dot {
  fill: var(--f-dot, rgba(255,255,255,0.35));
}

/* Label on the folder */
.folder__label {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 26px;
  pointer-events: none;
  color: var(--f-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.folder__label-en {
  font-size: 10px;
  letter-spacing: 0.16em;
  opacity: 0.7;
  font-weight: 500;
}
.folder__label-zh {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  line-height: 1.1;
}
.folder__hint {
  font-size: 10px;
  opacity: 0.55;
  margin-top: 4px;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  letter-spacing: 0.04em;
}

/* Color variants for each folder */
.folder--about {
  --f-body: #F0E6D2;
  --f-tab: #E4D6B0;
  --f-text: #4A3F28;
  --f-shine: rgba(255,255,255,0.5);
  --f-dot: rgba(74,63,40,0.25);
}
.folder--shimeng {
  --f-body: #2A2438;
  --f-tab: #1A1526;
  --f-text: #E8D9A0;
  --f-shine: rgba(232,217,160,0.35);
  --f-dot: rgba(232,217,160,0.45);
}
.folder--kaikailong {
  --f-body: #1A4FFF;
  --f-tab: #0033CC;
  --f-text: #FFFFFF;
  --f-shine: rgba(255,255,255,0.35);
  --f-dot: rgba(255,255,255,0.45);
}
.folder--agri {
  --f-body: #FF7A35;
  --f-tab: #E35A18;
  --f-text: #FFFFFF;
  --f-shine: rgba(255,255,255,0.35);
  --f-dot: rgba(255,255,255,0.45);
}
.folder--contact {
  --f-body: #E8E8E8;
  --f-tab: #CECECE;
  --f-text: #1A1A1A;
  --f-shine: rgba(255,255,255,0.8);
  --f-dot: rgba(26,26,26,0.25);
}

/* Hover: rise, straighten, bigger shadow */
.folder:hover {
  transform:
    translate(calc(-50% + var(--x) + var(--f-px) * var(--fx, 1)),
              calc(-50% + var(--y) - 24px + var(--f-py) * var(--fy, 1)))
    rotate(calc(var(--rot) * 0.35))
    scale(calc(var(--scale, 1) * 1.08));
  z-index: 20;
}
.folder:hover .folder__svg {
  filter: drop-shadow(0 20px 32px rgba(10,10,10,0.22))
          drop-shadow(0 60px 90px rgba(10,10,10,0.18));
}
.folder--main .folder__hint {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ========== SECTION COMMON ========== */
.section {
  padding-block: var(--section-pad);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 80px;
}
.section-head__title {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.section-head__title::before {
  content: "• ";
  color: var(--text);
}
.section-head__tag { justify-self: center; }
.section-head__num {
  justify-self: end;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.section-head--dark {
  border-color: var(--border-dark);
}
.section-head--dark .section-head__title,
.section-head--dark .section-head__num {
  color: var(--text-invert);
}

/* ========== TAGS ========== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: 500 11px/1 'Inter', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  transition: border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
}
.tag:hover { border-color: var(--text); color: var(--text); }
.tag--cn {
  text-transform: none;
  letter-spacing: 0.05em;
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  font-size: 13px;
}
.tag--active {
  background: var(--text);
  color: var(--text-invert);
  border-color: var(--text);
}
.tag--dark {
  border-color: var(--border-dark);
  color: var(--text-invert-dim);
  background: transparent;
}
.tag--dark:hover { border-color: var(--text-invert); color: var(--text-invert); }

/* ========== BUTTONS ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  background: var(--text);
  color: var(--text-invert);
  border: 1px solid var(--text);
  border-radius: 999px;
  font: 500 14px/1 'Inter', 'Noto Sans SC', sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary--invert {
  background: var(--text-invert);
  color: var(--dark);
  border-color: var(--text-invert);
}
.btn-primary--invert:hover {
  background: var(--accent);
  color: var(--text-invert);
  border-color: var(--accent);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: 500 14px/1 'Inter', 'Noto Sans SC', sans-serif;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--text); background: var(--surface); }
.btn-ghost--invert {
  color: var(--text-invert);
  border-color: var(--border-dark);
}
.btn-ghost--invert:hover { border-color: var(--text-invert); background: rgba(255,255,255,0.05); }

/* ========== LINK UNDERLINE ========== */
.link {
  color: var(--text);
  background-image: linear-gradient(var(--text), var(--text));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  transition: background-size 320ms var(--ease-out), color 220ms ease;
  padding-bottom: 2px;
  display: inline-block;
}
.link:hover {
  color: var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 2px;
}

/* ========== #01 ABOUT ========== */
.about__intro {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 100px;
}
.about__avatar {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 20px 50px -20px rgba(10,10,10,0.18);
}
.about__avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transition: transform 800ms var(--ease-out);
}
.about__avatar:hover img { transform: scale(1.03); }

.about__lead {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.55;
  color: var(--text);
  font-weight: 400;
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  padding-top: 8px;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}
.about__card {
  background: var(--bg);
  padding: 40px 36px;
  transition: background var(--dur-base) var(--ease-out);
}
.about__card:hover { background: var(--surface); }
.about__card-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}
.about__card-head .mono {
  font-size: 13px;
  color: var(--text-tertiary);
}
.about__card-head h3 {
  font-size: 22px;
  font-weight: 600;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
}
.about__card p {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 15px;
}

/* ========== #02 PROJECTS ========== */
.grid-projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.grid-projects .project-card--feature { grid-column: 1 / -1; }

.project-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.project-card:hover {
  border-color: var(--text);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -20px rgba(10,10,10,0.1);
}
.project-card--feature { display: grid; grid-template-columns: 1.4fr 1fr; }
.project-card--feature .project-card__media { aspect-ratio: auto; min-height: 480px; }
.project-card__media {
  aspect-ratio: 16 / 11;
  background: var(--surface-alt);
  overflow: hidden;
  position: relative;
}
.project-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.project-card:hover .project-card__media img { transform: scale(1.04); }
.project-card__media.img-fallback::after {
  content: "图片加载占位";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--surface-alt);
}
.project-card__body {
  padding: 36px 36px 40px;
}
.project-card--feature .project-card__body {
  padding: 48px 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  align-items: center;
}
.project-card__meta .mono { font-size: 12px; margin-left: auto; }
.project-card__title {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}
.project-card__org {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: 18px;
}
.project-card__desc {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 15px;
  margin-bottom: 28px;
}
.project-card__link { margin-top: auto; font-size: 14px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.metrics--compact { grid-template-columns: repeat(2, 1fr); }
.metric {
  background: var(--bg);
  padding: 18px 20px;
  text-align: left;
}
.metric__value {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
  white-space: nowrap;
}
.project-card__tagline {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
}
.metric__label {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* Kaikailong hero photo */
.project-card__media--kkl {
  position: relative;
  aspect-ratio: auto;
  min-height: 520px;
  overflow: hidden;
  background: #BCD8F2;
}
@media (max-width: 1023px) {
  .project-card--feature .project-card__media--kkl { aspect-ratio: auto; min-height: 420px; }
}
.project-card__media--kkl .kkl-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 800ms var(--ease-out);
}
.project-card:hover .project-card__media--kkl .kkl-hero {
  transform: scale(1.03);
}
.kkl-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(10,10,10,0.55) 100%);
  z-index: 1;
}
.kkl-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kkl-tag {
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  font: 500 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  color: #fff;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.kkl-caption {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.85);
}

/* ===== Agri project: Phone chat mock ===== */
.project-card__media--phone {
  aspect-ratio: 16 / 11;
  background: linear-gradient(135deg, #FFE8C8 0%, #FFD4A3 40%, #C8E6B8 100%);
  padding: 40px 28px 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}
.project-card__media--phone::before {
  content: "";
  position: absolute;
  top: 14%;
  left: -10%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.5), transparent 70%);
  pointer-events: none;
}
.project-card__media--phone::after {
  content: "";
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,122,53,0.18), transparent 70%);
  pointer-events: none;
}
.phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  border: 1px solid rgba(10,10,10,0.08);
  border-bottom: none;
  box-shadow: 0 30px 50px -20px rgba(10,10,10,0.15);
  overflow: hidden;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  z-index: 1;
}
.phone__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
  font-size: 11px;
  color: var(--text);
}
.phone__status-icons { display: inline-flex; gap: 4px; }
.phone__status-icons .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text); display: inline-block; }
.phone__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.phone__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF9155, #FF6B1F);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  flex-shrink: 0;
}
.phone__who { flex: 1; min-width: 0; }
.phone__name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  line-height: 1.2;
  font-family: 'Noto Sans SC', sans-serif;
}
.phone__meta {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-family: 'Noto Sans SC', sans-serif;
}
.phone__more { color: var(--text-tertiary); font-size: 16px; }
.chat {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  font-family: 'Noto Sans SC', sans-serif;
}
.chat-bubble p { margin: 0; }
.chat-bubble strong { color: #FF6B1F; font-weight: 600; }
.chat-bubble--user {
  align-self: flex-start;
  background: #F0F0F0;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble--ai {
  align-self: flex-end;
  background: linear-gradient(135deg, #FFB084, #FF7A35);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 6px 14px -4px rgba(255,122,53,0.4);
}
.chat-ai-tag {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #FF6B1F;
  font-weight: 500;
  margin-top: 4px;
  font-family: 'Noto Sans SC', sans-serif;
}
.chat-ai-tag .spark {
  color: #FF6B1F;
  font-size: 11px;
  animation: spark 2s ease-in-out infinite;
}
@keyframes spark {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.phone__input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  background: #FAFAFA;
}
.phone__input-placeholder {
  flex: 1;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-family: 'Noto Sans SC', sans-serif;
}
.phone__send {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #FF6B1F;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
}

/* ========== #03 EXPERIENCE ========== */
.timeline {
  border-top: 1px solid var(--border);
}
.timeline-item {
  display: grid;
  grid-template-columns: 80px 24px 1fr;
  column-gap: 32px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background var(--dur-base) var(--ease-out);
}
.timeline-item { padding-inline: 24px; margin-inline: -24px; border-radius: 8px; }
.timeline-item:hover { background: var(--surface-alt); }
.timeline-item__date {
  font: 500 16px/1.5 'JetBrains Mono', monospace;
  color: var(--text);
  padding-top: 14px;
  letter-spacing: 0.02em;
  text-align: right;
}
.timeline-item__rail {
  position: relative;
  align-self: stretch;
}
.timeline-item__rail::before {
  /* vertical line, extends into neighbor padding to connect */
  content: "";
  position: absolute;
  left: 50%;
  top: -40px;
  bottom: -40px;
  width: 1px;
  background: var(--border-strong);
  transform: translateX(-0.5px);
  opacity: 0.45;
}
.timeline-item__rail::after {
  /* dot anchored to date row */
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text);
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px var(--bg);
  z-index: 2;
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.timeline-item:hover .timeline-item__rail::after {
  box-shadow: 0 0 0 4px var(--surface-alt);
}
.timeline-item:first-child .timeline-item__rail::before { top: 24px; }
.timeline-item:last-child .timeline-item__rail::before { bottom: calc(100% - 24px); }
.timeline-item__role {
  font-size: 22px;
  font-weight: 600;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  line-height: 1.3;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.timeline-item__org {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}
.timeline-item__desc {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 15px;
  max-width: 760px;
}

/* ========== #04 CONTACT ========== */
.section-contact {
  background: var(--dark);
  color: var(--text-invert);
  padding-block: var(--section-pad);
  margin-top: 40px;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.section-contact .section-head {
  margin-bottom: 80px;
}
.contact {
  padding-block: 40px 100px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}
.contact__headline {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 900;
  font-size: clamp(48px, 8vw, 110px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 48px;
}
.contact__kicker {
  display: block;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--text-invert-dim);
  margin-bottom: 28px;
}
.contact__kicker::before, .contact__kicker::after {
  content: "—";
  display: inline-block;
  margin: 0 14px;
  color: var(--text-invert-dim);
  letter-spacing: 0;
}
.contact__main {
  font-family: 'Fraunces', 'Noto Sans SC', serif;
  display: block;
}
.contact__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 80px;
}
.contact__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-top: 48px;
  border-top: 1px solid var(--border-dark);
  text-align: left;
  max-width: 700px;
  margin: 0 auto;
}
.contact__meta-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-invert-dim);
  margin-bottom: 8px;
  font-family: 'Noto Sans SC', sans-serif;
}
.contact__meta > div > div:last-child {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 15px;
}

/* ========== FOOTER ========== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px var(--pad-x);
  border-top: 1px solid var(--border-dark);
  font-size: 13px;
  color: var(--text-invert-dim);
  flex-wrap: wrap;
  gap: 16px;
  font-family: 'Noto Sans SC', sans-serif;
}
.footer__left {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.footer__center { }

/* Back to top button — prominent pill */
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--text-invert);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.back-to-top:hover {
  background: var(--text-invert);
  color: var(--dark);
  border-color: var(--text-invert);
  transform: translateY(-2px);
}
.back-to-top__arrow {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--dur-base) var(--ease-out);
}
.back-to-top:hover .back-to-top__arrow {
  transform: translateY(-3px);
}

/* section#about scroll margin */
#about, #projects, #experience {
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

/* ========== REVEAL ANIMATION ========== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .folder-stack { height: 380px; }
  .folder { width: 200px; height: 240px; }
  /* tighten x offsets */
  .folder--about    { --x: -300px; }
  .folder--shimeng  { --x: -150px; }
  .folder--agri     { --x:  150px; }
  .folder--contact  { --x:  300px; }
}

@media (max-width: 1023px) {
  :root {
    --pad-x: 28px;
    --section-pad: 100px;
  }
  .nav__links { gap: 0; }
  .nav__links a { padding: 6px 10px; font-size: 12px; }
  .nav__links a span:last-child { display: none; }
  .nav__pill { display: none; }
  .folder-stack { height: 340px; max-width: 680px; }
  .folder { width: 170px; height: 200px; }
  .folder--about    { --x: -240px; --y: 40px; }
  .folder--shimeng  { --x: -120px; --y: 18px; }
  .folder--agri     { --x:  120px; --y: 18px; }
  .folder--contact  { --x:  240px; --y: 40px; }
  .folder__label-zh { font-size: 18px; }
  .about__intro { grid-template-columns: 160px 1fr; gap: 32px; }
  .project-card--feature { grid-template-columns: 1fr; }
  .project-card--feature .project-card__media:not(.project-card__media--kkl) { min-height: auto; aspect-ratio: 16 / 10; }
  .project-card--feature .project-card__body { padding: 36px; }
  .about__grid { grid-template-columns: 1fr; }
  .grid-projects { grid-template-columns: 1fr; }
  .grid-projects .project-card--feature { grid-column: auto; }
}

@media (max-width: 768px) {
  :root {
    --pad-x: 20px;
    --section-pad: 80px;
    --nav-h: 58px;
  }
  .nav {
    grid-template-columns: 1fr auto;
    padding: 0 20px;
  }
  .nav__brand-sub { display: none; }
  .nav__links {
    position: absolute;
    top: var(--nav-h);
    right: 12px;
    justify-self: end;
    gap: 2px;
    font-size: 11px;
  }
  .nav__links a { padding: 4px 8px; }
  .hero { padding-top: calc(var(--nav-h) + 90px); }
  .hero-display { font-size: clamp(64px, 22vw, 100px); }
  .hero-display.hero-display--greeting { font-size: clamp(28px, 8.4vw, 44px); line-height: 1.25; }
  .hero__lede { font-size: 14px; line-height: 1.75; }
  .hero__cta { gap: 10px; flex-direction: column; align-items: stretch; padding-inline: 12px; }
  .hero__cta .btn-primary, .hero__cta .btn-ghost { justify-content: center; }
  .folder-stack {
    height: 260px;
    transform: scale(0.7);
    transform-origin: center center;
    margin: -20px auto;
  }
  .section-head {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .section-head__tag { display: none; }
  .about__intro { grid-template-columns: 1fr; gap: 20px; }
  .about__avatar { max-width: 200px; aspect-ratio: 1; border-radius: 50%; }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 32px 0;
  }
  .timeline-item__date { order: -1; text-align: left; padding-top: 0; font-size: 14px; }
  .timeline-item__rail { display: none; }
  .timeline-item:hover { margin-inline: 0; padding-inline: 0; }
  .about__lead { font-size: 20px; margin-bottom: 60px; }
  .about__card { padding: 32px 24px; }
  .project-card__body { padding: 28px 24px 32px; }
  .project-card--feature .project-card__body { padding: 32px 24px; }
  .metrics { grid-template-columns: 1fr; }
  .metrics--compact { grid-template-columns: 1fr 1fr; }
  .contact__actions { flex-direction: column; align-items: stretch; }
  .contact__actions .btn-primary, .contact__actions .btn-ghost { justify-content: center; }
  .contact__meta { grid-template-columns: 1fr; gap: 24px; }
  .footer { flex-direction: column; gap: 12px; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-display { animation: none; opacity: 1; transform: none; }
  .folder-stack, .folder { transform: none !important; }
}

/* ========== PROJECT CARD EXPAND BUTTON ========== */
.project-card__expand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 24px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: 500 13px/1 'Inter', 'Noto Sans SC', sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.project-card__expand:hover {
  background: var(--text);
  color: var(--text-invert);
  border-color: var(--text);
  transform: translateY(-2px);
}
.project-card__expand-arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}
.project-card__expand:hover .project-card__expand-arrow {
  transform: translate(2px, -2px);
}
.project-card__actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
}
.project-card__actions .project-card__expand { margin-top: 0; }
.project-card__actions .project-card__link { margin: 0; }

/* ========== MODAL ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal.is-open {
  display: flex;
  animation: modal-fade var(--dur-base) var(--ease-out) both;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 880px;
  background: var(--bg);
  border-radius: 24px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.5);
  padding: 72px 72px 72px;
  z-index: 1;
  transform: translateY(16px);
  opacity: 0;
  animation: modal-rise var(--dur-slow) var(--ease-out) 80ms forwards;
  margin-bottom: 5vh;
}
@keyframes modal-rise {
  to { opacity: 1; transform: translateY(0); }
}
.modal__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  transition: background var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  z-index: 2;
}
.modal__close:hover {
  background: var(--text);
  color: var(--text-invert);
  transform: rotate(90deg);
}

/* ===== Modal detail content (md__*) ===== */
.md__head {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.md__num {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.14em;
  margin-bottom: 20px;
}
.md__title {
  font-family: 'Fraunces', 'Noto Sans SC', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  color: var(--text);
}
.md__sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  max-width: 640px;
}
.md__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.md__meta .mono { margin-left: auto; font-size: 12px; }

.md__block {
  margin-bottom: 48px;
}
.md__block:last-child { margin-bottom: 0; }
.md__block-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
}
.md__block-head .mono {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
}
.md__block-head h3 {
  font-size: 22px;
  font-weight: 600;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  color: var(--text);
  letter-spacing: -0.01em;
}
.md__block p {
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: 15px;
  margin-bottom: 12px;
}
.md__block p:last-child { margin-bottom: 0; }
.md__block em {
  color: var(--text);
  font-weight: 500;
  font-style: normal;
  background: linear-gradient(180deg, transparent 60%, rgba(26,79,255,0.12) 60%);
  padding: 0 2px;
}

.md__list {
  padding-left: 22px;
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: 15px;
}
.md__list li { margin-bottom: 10px; }
.md__list li strong { color: var(--text); font-weight: 600; }
.md__list li::marker {
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.md__table {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}
.md__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1fr;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  gap: 12px;
}
.md__row:first-child { border-top: none; }
.md__row--head {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}
.md__row strong { color: var(--text); font-weight: 600; }
.md__badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.md__badge--win {
  background: var(--accent);
  color: var(--text-invert);
}

.md__grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.md__cell {
  background: var(--bg);
  padding: 22px 24px;
}
.md__cell .mono {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  display: block;
}
.md__cell strong {
  display: block;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
}
.md__cell p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.md__link-row {
  margin-top: 18px;
  font-size: 15px;
}

/* Modal responsive */
@media (max-width: 768px) {
  .modal { padding: 2vh 12px; }
  .modal__dialog { padding: 56px 28px 48px; border-radius: 18px; }
  .modal__close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .md__title { font-size: clamp(30px, 9vw, 44px); }
  .md__table { font-size: 12px; }
  .md__row {
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding: 12px 14px;
  }
  .md__row--head { display: none; }
  .md__row > div:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .md__grid2 { grid-template-columns: 1fr; }
  .md__block-head { gap: 12px; flex-wrap: wrap; }
  .md__block-head h3 { font-size: 19px; }
}

/* Body lock when modal open */
body.modal-open {
  overflow: hidden;
}

/* ========== UTILITY ========== */
::selection { background: var(--accent); color: var(--text-invert); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================================
   手机端 · 卡片改为横滑画廊（覆盖原扇形堆叠）
   Added for mobile UX — 2026.04
   ============================================ */
@media (max-width: 768px) {

  /* 容器：从扇形堆叠改成横向滚动 */
  .folder-stack {
    height: auto;
    transform: none;
    margin: 0;
    max-width: none;
    perspective: none;

    display: flex;
    gap: 14px;
    padding: 36px 20px 56px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .folder-stack::-webkit-scrollbar {
    display: none;
  }

  /* 单个卡片：取消绝对定位和旋转 */
  .folder {
    position: relative;
    left: auto;
    top: auto;
    width: 168px;
    height: 208px;
    flex: 0 0 168px;
    transform: none !important;
    scroll-snap-align: center;
    transition: transform 240ms var(--ease-out);
  }

  /* 凯凯龙（主项目）稍微放大突出 */
  .folder--main {
    width: 186px;
    height: 230px;
    flex: 0 0 186px;
  }

  /* 调整顺序：凯凯龙放首位 */
  .folder--kaikailong { order: 1; }
  .folder--shimeng    { order: 2; }
  .folder--agri       { order: 3; }
  .folder--about      { order: 4; }
  .folder--contact    { order: 5; }

  /* 手机端禁用 hover 上浮（避免触屏的 sticky-hover） */
  .folder:hover {
    transform: none !important;
  }
  .folder:active {
    transform: scale(0.97) !important;
  }

  /* 标签字号微调 */
  .folder__label-zh { font-size: 19px; }
  .folder__label-en { font-size: 10px; }
}

/* ============================================
   手机端 · 首屏压缩（减少顶部空白）
   Round 2 — 2026.04
   ============================================ */
@media (max-width: 768px) {
  /* Nav 重新布局为两列：品牌 | 导航链接 */
  .nav {
    grid-template-columns: auto 1fr;
  }

  /* 导航链接从"浮动到下方"改为"内联到右侧" */
  .nav__links {
    position: static;
    top: auto;
    right: auto;
    justify-self: end;
    align-self: center;
    gap: 2px;
    font-size: 11px;
  }

  /* 隐藏右上角 "2026 · ONGOING" 胶囊 */
  .nav__pill {
    display: none;
  }

  /* 缩小 hero 顶部留白（原 +90px → 现 +20px） */
  .hero {
    padding-top: calc(var(--nav-h) + 20px);
  }

  /* Kicker（HI · 2026）与标题之间也收紧一点 */
  .hero__kicker {
    margin-bottom: 12px;
  }
}

/* ============================================
   手机端 · 经历区块文字被左边屏幕裁切修复
   Round 3 — 2026.04
   ============================================ */
@media (max-width: 768px) {
  /* 防线 1:全局禁止页面级横向滚动（轮播内部滚动不受影响） */
  html, body {
    overflow-x: hidden;
  }

  /* 防线 2:重置 timeline-item 的桌面端负外边距
     桌面端负外扩是为了 hover 高亮超出容器边界,
     手机端会导致内容顶出屏幕边缘,需要归零 */
  .timeline-item,
  .timeline-item:hover {
    margin-inline: 0;
    padding-inline: 0;
    border-radius: 0;
  }
}
