﻿:root {
  --bg: #070707;
  --panel: #0d0d0f;
  --text: #f5f5f2;
  --muted: #8d8d91;
  --line: rgba(255,255,255,.13);
  --orange: #ff5038;
  --pink: #ff4f9b;
  --blue: #467dff;
  --green: #74f5a1;
  --shell: 1440px;
  --page-gutter: clamp(48px, 5vw, 96px);
  --nav-gutter: clamp(36px, 2.8vw, 56px);
  --hero-gutter: clamp(72px, 5.8vw, 112px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; overflow-x: hidden; }

body,
body * {
  word-break: keep-all;
  overflow-wrap: normal;
}

p,
li,
h1,
h2,
h3,
h4,
span,
small,
strong {
  text-wrap: pretty;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
.shell { width: min(var(--shell), calc(100% - 96px)); max-width: var(--shell); margin-left: auto; margin-right: auto; }
.noise { position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .022; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E"); }

.site-header { position: fixed; inset: 0 0 auto; z-index: 50; background: rgba(7,7,7,.72); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(18px); }
.navbar { height: 76px; display: flex; align-items: center; gap: 18px; }
.brand { font-size: 23px; font-weight: 900; letter-spacing: -.06em; }
.brand span { font-size: 9px; vertical-align: top; margin-left: 3px; letter-spacing: 0; }
.theme-toggle { --theme-thumb-x: 0%; position: relative; display: inline-grid; grid-template-columns: repeat(2, minmax(42px, 1fr)); align-items: center; gap: 0; margin-left: 8px; padding: 4px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; }
.theme-toggle::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; z-index: 0; width: calc((100% - 8px) / 2); border-radius: 999px; background: #f7f7f5; box-shadow: 0 8px 20px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.78); transform: translate3d(var(--theme-thumb-x), 0, 0); transition: transform 420ms cubic-bezier(.22, 1, .36, 1), background-color 260ms ease, box-shadow 260ms ease; will-change: transform; }
.theme-toggle[data-theme-current="light"] { --theme-thumb-x: 100%; }
.theme-option { position: relative; z-index: 1; appearance: none; border: 0; border-radius: 999px; padding: 7px 12px; color: rgba(255,255,255,.48); background: transparent; font: inherit; font-size: 11px; font-weight: 950; letter-spacing: .06em; cursor: pointer; transition: color 260ms ease; }
.theme-option:hover { color: #fff; }
.theme-option.is-active { color: #111; background: transparent; box-shadow: none; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 48px; }
.nav-links a { color: #737377; font-weight: 700; font-size: 14px; transition: color .2s ease; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-links sup { margin-left: 2px; font-size: 8px; }
.contact-pill { display: flex; align-items: center; gap: 12px; margin-left: 38px; padding: 6px 23px 6px 7px; border-radius: 999px; background: #f7f7f5; color: #111; font-size: 14px; font-weight: 700; }
.contact-pill span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 18px; }

body.theme-light {
  --bg: #f5f3ef;
  --panel: #ffffff;
  --text: #111113;
  --muted: #66666b;
  --line: rgba(12,12,14,.14);
  color: var(--text);
  background: var(--bg);
}

body.theme-light .noise { opacity: .025; mix-blend-mode: multiply; }
body.theme-light .site-header {
  background: rgba(255,255,255,.34);
  border-bottom-color: rgba(255,255,255,.32);
  box-shadow: 0 16px 46px rgba(40,65,90,.08);
  backdrop-filter: blur(28px) saturate(1.28);
  -webkit-backdrop-filter: blur(28px) saturate(1.28);
}

/* Final Hero title safety: prevent split-letter clipping and keep 庐 as a small corner mark. */
.hero .hero-title {
  overflow: visible;
  max-width: none;
  font-size: clamp(118px, 9.55vw, 178px);
  line-height: .95;
  padding: .04em .22em .06em 0;
  box-sizing: content-box;
}

.hero-title.variable-proximity-ready .vp-word:last-child .vp-letter:last-child {
  position: static;
  width: 0;
  margin: 0;
  font-size: 0;
  opacity: 0;
  pointer-events: none;
}

.hero .hero-title::after {
  content: "庐";
  position: relative;
  top: -.58em;
  display: inline-block;
  margin-left: .045em;
  font-size: .16em;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: top;
  opacity: .95;
}

/* Variable Proximity title interaction */
[data-variable-proximity] {
  cursor: default;
  user-select: none;
  contain: paint;
}

.variable-proximity-ready {
  --vp-glow: rgba(255, 80, 56, .18);
}

.vp-line {
  display: block;
  white-space: nowrap;
}

.vp-word {
  display: inline-block;
  white-space: nowrap;
}

.vp-letter {
  display: inline-block;
  transform-origin: 50% 70%;
  will-change: transform, color;
  transition:
    transform 520ms cubic-bezier(.22, 1, .36, 1),
    color 520ms cubic-bezier(.22, 1, .36, 1),
    opacity 520ms cubic-bezier(.22, 1, .36, 1);
}

.variable-proximity-ready:hover .vp-letter {
  text-shadow: none;
}

.section-heading h2.variable-proximity-ready .vp-line:nth-child(2),
.contact h2.variable-proximity-ready .vp-line:nth-child(2) {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.58);
}

body.theme-light .variable-proximity-ready {
  --vp-glow: rgba(12, 55, 92, .18);
}

body.theme-light .section-heading h2.variable-proximity-ready .vp-line:nth-child(2),
body.theme-light .contact h2.variable-proximity-ready .vp-line:nth-child(2) {
  -webkit-text-stroke-color: rgba(0,0,0,.32);
}
body.theme-light .brand,
body.theme-light .nav-links a:hover,
body.theme-light .nav-links a.active { color: #111; }
body.theme-light .nav-links a { color: rgba(20,20,24,.48); }
body.theme-light .theme-toggle { color: rgba(20,20,24,.62); background: rgba(0,0,0,.055); border-color: rgba(0,0,0,.08); }
body.theme-light .theme-toggle::before { background: #111; box-shadow: 0 8px 20px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.08); }
body.theme-light .theme-option { color: rgba(20,20,24,.48); }
body.theme-light .theme-option:hover { color: #111; }
body.theme-light .theme-option.is-active { color: #fff; background: transparent; box-shadow: none; }
body.theme-light .contact-pill { background: #111; color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.12); }
body.theme-light .hero,
body.theme-light .projects,
body.theme-light .gallery,
body.theme-light .contact { background: #f5f3ef; }
body.theme-light .hero::before { opacity: .28; background-image: linear-gradient(rgba(0,0,0,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.045) 1px, transparent 1px); }
body.theme-light .hero-ferrofluid,
body.theme-light .hero-core { opacity: .16; filter: invert(1) grayscale(1) contrast(.9); }
body.theme-light .hero-title,
body.theme-light .section-heading h2,
body.theme-light .gallery-heading h2,
body.theme-light .contact h2,
body.theme-light .footer-brand { color: #111; }
body.theme-light .hero-subtitle,
body.theme-light .hero-role-subtitle,
body.theme-light .hero-intro p,
body.theme-light .gallery-heading > p,
body.theme-light .section-no,
body.theme-light .gallery-hint { color: rgba(20,20,24,.62); }
body.theme-light .hero-intro { border-top-color: rgba(0,0,0,.24); }
body.theme-light .hero-metrics span { color: rgba(20,20,24,.52); }
body.theme-light .hero-id-card,
body.theme-light .about-gallery-card,
body.theme-light .project-preview,
body.theme-light .masonry-item,
body.theme-light .contact-card {
  border-color: rgba(0,0,0,.12);
  background: rgba(255,255,255,.72);
  box-shadow: 0 24px 70px rgba(35,30,24,.12);
}
body.theme-light .about { background: radial-gradient(circle at 70% 38%, rgba(255,80,56,.08), transparent 30%), #f5f3ef; }
body.theme-light .about-particles { opacity: .13; filter: invert(1); }
body.theme-light .section-heading h2 em { -webkit-text-stroke-color: rgba(0,0,0,.32); }
body.theme-light .company-logo,
body.theme-light .about-card-media.logo-media,
body.theme-light .about-card-media.portrait-media { background: rgba(255,255,255,.9); }
body.theme-light .project-tab { border-bottom-color: rgba(0,0,0,.12); color: rgba(20,20,24,.62); }
body.theme-light .project-tab:hover,
body.theme-light .project-tab.is-active { color: #111; }
body.theme-light .preview-overlay { background: linear-gradient(to top, rgba(245,243,239,.96), rgba(245,243,239,.68) 55%, transparent); }
body.theme-light .preview-overlay p,
body.theme-light .about-intro,
body.theme-light .footer-copy,
body.theme-light .contact-card p { color: rgba(20,20,24,.62); }
body.theme-light .contact-icon-btn {
  color: rgba(20,20,24,.7);
  background: transparent;
  box-shadow: none;
}
body.theme-light .contact-icon-btn:hover,
body.theme-light .contact-icon-btn:focus-visible {
  color: #111;
  background: transparent;
  box-shadow: none;
}
body.theme-light .contact-modal-overlay {
  background: rgba(18,18,20,.22);
}
body.theme-light .contact-modal {
  color: #111113;
  border-color: rgba(20,20,24,.12);
  background: rgba(252,251,248,.76);
  box-shadow: 0 24px 70px rgba(35,30,24,.16), inset 0 1px rgba(255,255,255,.68);
}
body.theme-light .contact-modal-close {
  color: rgba(20,20,24,.62);
  border-color: rgba(20,20,24,.1);
  background: rgba(255,255,255,.48);
}
body.theme-light .contact-modal-close:hover,
body.theme-light .contact-modal-close:focus-visible {
  color: #111;
  border-color: rgba(20,20,24,.16);
  background: rgba(255,255,255,.72);
}
body.theme-light .contact-modal-content p {
  color: rgba(20,20,24,.58);
}
body.theme-light .contact-email-value {
  color: rgba(20,20,24,.82);
}
body.theme-light .wechat-qr {
  border-color: rgba(20,20,24,.1);
  background: rgba(255,255,255,.9);
}
body.theme-light .copy-email-button {
  color: #fff;
  border-color: rgba(20,20,24,.12);
  background: #111113;
  box-shadow: 0 12px 28px rgba(35,30,24,.16);
}
body.theme-light .copy-toast {
  color: #111113;
  border-color: rgba(20,20,24,.12);
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 24px rgba(35,30,24,.12);
}
