:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #060912;
}

html[lang="zh"] {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { background: #060912; scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: #060912;
  color: #f8fafc;
}

html.is-loading,
body.is-loading { overflow: hidden; }

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #060912;
  opacity: 1;
  transition: opacity 650ms ease;
}

.site-loader.is-complete {
  opacity: 0;
  pointer-events: none;
}

.site-loader[hidden] { display: none; }

.site-loader__content {
  display: grid;
  justify-items: center;
  gap: 22px;
  width: min(82vw, 280px);
  text-align: center;
}

.site-loader__mark {
  position: relative;
  width: min(58vw, 220px);
  aspect-ratio: 1;
}

.site-loader__logo {
  position: absolute;
  inset: 22%;
  z-index: 1;
  width: 56%;
  height: 56%;
  object-fit: contain;
}

.site-loader__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.site-loader__ring-track,
.site-loader__ring-progress {
  fill: none;
  stroke-width: 3;
}

.site-loader__ring-track { stroke: rgba(248, 250, 252, 0.16); }

.site-loader__ring-progress {
  stroke: #f8fafc;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transform: rotate(-90deg);
  transform-origin: 70px 70px;
  transition: stroke-dashoffset 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-loader__copy { display: grid; gap: 7px; }

.site-loader__title,
.site-loader__status { margin: 0; }

.site-loader__title {
  color: #f8fafc;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-loader__status {
  color: rgba(248, 250, 252, 0.62);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

button,
a { font: inherit; }

button { color: inherit; }

#site {
  --card-width: 560px;
  --card-opacity: 0.68;
  --card-blur: 18px;
  --title-size: 64px;
  --body-size: 16px;
  --eyebrow-size: 12px;
  --cta-size: 13px;
  --title-line-height: 1.04;
  --body-line-height: 1.7;
  --card-padding: 40px;
  --card-radius: 24px;
  --nav-size: 12px;
  --card-top: 50%;
  --card-left-vw: 7vw;
  --overlay-opacity: 0.72;
}

#stage {
  --accent: #ff9a3d;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
  background: #060912;
}

#scroll-track { position: relative; z-index: 0; }
.scroll-segment { width: 100%; }

#scene-layer,
#video-layer { position: absolute; inset: 0; }

.scene,
.connector-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene {
  overflow: hidden;
  background-color: #060912;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transition: opacity 360ms ease;
}

.scene.is-active { animation: ken-burns 18s ease-in-out forwards; }

@keyframes ken-burns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.06) translate(-1%, -0.5%); }
}

.scene::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(2, 5, 14, var(--overlay-opacity)) 0%, rgba(2, 5, 14, 0.3) 34%, transparent 66%),
    linear-gradient(0deg, rgba(2, 5, 14, 0.56) 0%, transparent 36%);
}

.scene::after {
  position: absolute;
  inset: -14%;
  content: "";
  opacity: 0.42;
  background:
    radial-gradient(circle at 25% 40%, color-mix(in srgb, var(--scene-accent) 44%, transparent), transparent 28%),
    radial-gradient(circle at 74% 62%, color-mix(in srgb, var(--scene-accent) 24%, transparent), transparent 34%);
  mix-blend-mode: screen;
  animation: breathe 4.8s ease-in-out infinite;
}

@keyframes breathe {
  50% { opacity: 0.72; transform: scale(1.08); }
}

.connector-video {
  z-index: 2;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms linear;
}

.topbar,
.copy-card,
.scene-rail,
.scroll-hint { position: fixed; z-index: 10; }

.topbar {
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 92px minmax(500px, 2fr) minmax(150px, 1fr);
  align-items: center;
  column-gap: 24px;
  padding: clamp(18px, 3vw, 40px) clamp(20px, 5vw, 72px);
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar::after {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  content: "";
  background: var(--accent);
  transition: width 120ms linear;
}

.brand,
.contact-link {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.brand span { color: var(--accent); }

.brand { justify-self: start; }

.contact-link {
  padding-bottom: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  font-size: max(0.72rem, calc(var(--nav-size) * 0.95));
  justify-self: end;
}

.lang-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 78px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(4, 8, 18, 0.42);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font-size: max(0.72rem, calc(var(--nav-size) * 0.8));
  font-weight: 700;
  letter-spacing: 0.08em;
  user-select: none;
  justify-self: center;
}

.lang-option { position: relative; z-index: 1; padding: 4px 8px; color: rgba(255, 255, 255, 0.5); }
.lang-option.active { color: #fff; }

.lang-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 40%, rgba(255, 255, 255, 0.15));
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lang-switch[data-lang="zh"] .lang-slider { transform: translateX(0); }
.lang-switch[data-lang="en"] .lang-slider { transform: translateX(100%); }

.lang-switch:hover { border-color: var(--accent); }
.lang-switch:focus-visible,
.copy-cta:focus-visible,
.social-link:focus-visible,
.social-card:focus-visible,
.back-to-top:focus-visible,
.scene-rail button:focus-visible,
#scene-nav button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#scene-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  width: min(100%, 600px);
  min-width: 0;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(4, 8, 18, 0.38);
  backdrop-filter: blur(18px);
}

#scene-nav button {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  font-size: var(--nav-size);
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

#scene-nav button.is-active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #fff; }

.copy-card {
  top: var(--card-top);
  left: clamp(20px, var(--card-left-vw), 120px);
  width: min(var(--card-width), calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  padding: var(--card-padding);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--card-radius);
  background: rgba(5, 8, 18, var(--card-opacity));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(var(--card-blur));
  transform: translateY(-50%);
  transition: transform 420ms ease, border-color 280ms ease;
}

#stage.is-holding .copy-card { transform: translateY(calc(-50% - 6px)); }

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: var(--eyebrow-size);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.title-role { max-width: 14ch; margin: 0; font-size: min(var(--title-size), 11vw); line-height: var(--title-line-height); letter-spacing: -0.055em; text-wrap: balance; }
.title-headline { max-width: 22ch; margin-top: 22px; font-size: min(calc(var(--title-size) * 0.68), 7.5vw); font-weight: 700; line-height: 1.08; letter-spacing: -0.045em; text-wrap: balance; }
.title-subheadline { max-width: 26ch; margin-top: 14px; color: rgba(248, 250, 252, 0.9); font-size: min(calc(var(--title-size) * 0.5), 5.8vw); font-weight: 650; line-height: 1.2; letter-spacing: -0.025em; text-wrap: balance; }
.title-bullets,
.body-bullets { display: grid; margin: 0; padding: 0; list-style: none; }
.title-bullets { gap: 0.16em; }
.title-bullets li,
.body-bullets li { position: relative; }
.title-bullets li { padding-left: 0.5em; }
.title-bullets li::before { position: absolute; top: 0.43em; left: 0; width: 0.18em; height: 0.18em; border-radius: 50%; background: var(--accent); content: ""; }

.body-copy {
  max-width: 42rem;
  margin: 28px 0 30px;
  color: rgba(248, 250, 252, 0.76);
  font-size: var(--body-size);
  line-height: var(--body-line-height);
}

.body-bullets { gap: 10px; }
.body-bullets li { padding-left: 1.1em; text-wrap: pretty; }
.body-bullets li::before { position: absolute; top: 0.72em; left: 0.25em; width: 0.35em; height: 0.35em; border-radius: 50%; background: color-mix(in srgb, var(--accent) 70%, white); content: ""; }

.copy-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 72%, transparent);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: var(--cta-size);
  font-weight: 800;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
}

.copy-cta span { color: var(--accent); font-size: 1rem; }

.scene-rail {
  top: 50%;
  right: clamp(14px, 2.7vw, 42px);
  display: grid;
  gap: 16px;
  transform: translateY(-50%);
}

.scene-rail button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.rail-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(5, 9, 18, 0.4);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.rail-label { width: 0; overflow: hidden; opacity: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-align: right; transition: width 220ms ease, opacity 220ms ease; }
.scene-rail button:hover .rail-label,
.scene-rail button.is-active .rail-label { width: 136px; opacity: 1; }
.scene-rail button.is-active .rail-dot { transform: scale(1.45); border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 22%, transparent); }

.scroll-hint {
  bottom: 26px;
  left: 50%;
  display: flex;
  gap: 8px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  transform: translateX(-50%);
  transition: opacity 240ms ease;
}

.scroll-hint.is-hidden { opacity: 0; }

.social-panel {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.9fr);
  gap: clamp(24px, 4vw, 72px);
  min-height: 100vh;
  padding: clamp(80px, 10vw, 160px) clamp(24px, 7vw, 120px);
  background: #070b16;
}

.anchor-target { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }

.social-intro h2 { max-width: 8ch; margin: 0; font-size: clamp(2.5rem, 5vw, 5.5rem); line-height: 0.98; letter-spacing: -0.055em; }
.social-name { margin: 22px 0 0; color: #fff; font-size: 1.15rem; font-weight: 800; }
.social-role { margin: 6px 0 0; color: var(--accent); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.social-intro > p:not(.eyebrow) { max-width: 34rem; margin: 28px 0 18px; color: rgba(248, 250, 252, 0.66); line-height: 1.8; }
.social-intro > .social-name + .social-role + p { margin-top: 20px; }
.social-email,
.social-mini-link { display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; color: #fff; text-decoration: none; }
.social-email { gap: 0; margin-top: 28px; padding: 13px 14px; border: 1px solid rgba(132, 196, 255, 0.16); border-radius: 8px; background: rgba(10, 22, 39, 0.62); font-weight: 700; }
.social-icon { display: inline-grid; grid-row: 1 / span 2; place-items: center; width: 32px; height: 32px; }
.social-icon--email svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.social-icon--logo { border: 0; border-radius: 0; background: transparent; }
.social-icon--logo img { display: block; width: 32px; height: 32px; padding: 0; object-fit: contain; }
.social-mini-links { display: grid; gap: 10px; margin-top: 12px; }
.social-mini-link { width: 100%; padding: 12px 14px; border: 1px solid rgba(132, 196, 255, 0.13); border-radius: 8px; background: rgba(10, 22, 39, 0.48); font-size: 0.9rem; font-weight: 700; transition: border-color 180ms ease, background 180ms ease, transform 180ms ease; }
.social-mini-link:hover,
.social-email:hover { border-color: color-mix(in srgb, var(--accent) 64%, rgba(132, 196, 255, 0.35)); background: rgba(16, 31, 52, 0.72); transform: translateY(-1px); }
.social-mini-link > span:not(.social-icon),
.social-mini-link > small { grid-column: 2; }
.social-mini-link small { color: rgba(248, 250, 252, 0.52); font-size: 0.68rem; font-weight: 600; line-height: 1.35; }

.social-projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: clamp(14px, 1.5vw, 24px); }
.social-card { display: grid; grid-template-rows: auto auto auto; align-items: start; gap: 10px; min-width: 0; height: auto; align-self: start; color: #fff; font-size: 0.78rem; font-weight: 700; text-decoration: none; }
.social-card img { display: block; width: 100%; height: clamp(220px, 24vw, 360px); border-radius: 16px; background: #101827; object-fit: contain; }
.social-card-label { min-height: 1.4em; }
.social-card small { min-height: 2.8em; color: rgba(248, 250, 252, 0.58); font-size: 0.7rem; font-weight: 600; line-height: 1.45; }

.back-to-top { grid-column: 1 / -1; align-self: end; color: rgba(248, 250, 252, 0.6); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.11em; text-decoration: none; text-transform: uppercase; }

@media (max-width: 1080px) {
  #scene-nav { display: none; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .social-panel { grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr); }
}

@media (max-width: 860px) {
  html { scroll-snap-type: y proximity; }
  .snap-point { scroll-snap-align: start; scroll-snap-stop: normal; }
  #scene-nav,
  .scene-rail { display: none; }
  .topbar { display: flex; gap: 14px; padding: 16px 18px; }
  .lang-switch { min-width: 68px; padding: 4px 6px; font-size: 0.6rem; }
  .lang-option { padding: 3px 6px; font-size: 0.58rem; }
  .contact-link { font-size: 0.62rem; }
  .copy-card { top: auto; right: 14px; bottom: calc(48px + env(safe-area-inset-bottom)); left: 14px; width: auto; max-width: none; max-height: 48vh; overflow-y: auto; padding: 18px; border-radius: 18px; transform: none; }
  #stage.is-holding .copy-card { transform: none; }
  .title-role { max-width: 14ch; }
  .title-headline { margin-top: 16px; font-size: min(calc(var(--title-size) * 0.68), 8vw); }
  .title-subheadline { margin-top: 10px; font-size: min(calc(var(--title-size) * 0.5), 6vw); }
  .body-copy { margin: 18px 0 20px; font-size: 0.93rem; }
  .scroll-hint { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .social-panel { display: block; min-height: auto; padding: 80px 20px calc(80px + env(safe-area-inset-bottom)); }
  .social-intro { margin-bottom: 48px; }
  .social-projects { grid-template-columns: 1fr 1fr; }
  .social-card img { height: clamp(180px, 46vw, 300px); }
  .back-to-top { display: inline-block; margin-top: 48px; }
}

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