/* 光王的个人网站
   苹果式设计语言：黑白分区、大标题、磨砂玻璃、克制的动效。
   手写 CSS，无框架。 */

:root {
  --ink: #1d1d1f;
  --muted: #86868b;
  --muted-dark: #a1a1a6;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link-dark-bg: #2997ff;
  --border: #d2d2d7;
  --nav-h: 48px;
  --radius: 28px;
  --font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Display",
          "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: rgba(0, 113, 227, 0.18); }

.container { max-width: 988px; margin: 0 auto; padding: 0 22px; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* 深色形态（覆盖黑色首屏） */
.nav.is-dark {
  color: #f5f5f7;
  background: rgba(22, 22, 23, 0.55);
}
.nav.is-dark .nav__links a { color: rgba(245, 245, 247, 0.8); }
.nav.is-dark .nav__links a:hover,
.nav.is-dark .nav__links a.is-active { color: #fff; }
.nav.is-dark .nav__cta { color: #0a84ff; }

/* 浅色形态（其余部分） */
.nav.is-light {
  color: var(--ink);
  background: rgba(251, 251, 253, 0.78);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.nav.is-light .nav__links a { color: rgba(29, 29, 31, 0.72); }
.nav.is-light .nav__links a:hover,
.nav.is-light .nav__links a.is-active { color: var(--ink); }
.nav.is-light .nav__cta { color: var(--blue); }

.nav__inner {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav__logo { display: inline-flex; align-items: center; gap: 9px; }
.mono-mini {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, #0a84ff, #bf5af2);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.nav__logo b { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }

.nav__links { display: flex; gap: 34px; }
.nav__links a {
  font-size: 13.5px;
  transition: color 0.3s ease;
}

.nav__actions { display: flex; align-items: center; gap: 16px; }
.nav__cta { font-size: 13.5px; font-weight: 500; }

.nav__burger {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  align-content: center;
  gap: 5px;
}
.nav__burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}
.nav__burger.is-open span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 22px 60px;
}

.hero__glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.hero__glow--a {
  background: radial-gradient(circle, rgba(10, 132, 255, 0.55), transparent 65%);
  top: -22%;
  left: -12%;
  animation: driftA 16s ease-in-out infinite alternate;
}
.hero__glow--b {
  background: radial-gradient(circle, rgba(191, 90, 242, 0.45), transparent 65%);
  bottom: -26%;
  right: -14%;
  animation: driftB 19s ease-in-out infinite alternate;
}
@keyframes driftA { to { transform: translate(9vw, 7vh) scale(1.12); } }
@keyframes driftB { to { transform: translate(-8vw, -6vh) scale(1.08); } }

.hero__content { position: relative; z-index: 2; }

.mono {
  width: 76px;
  height: 76px;
  margin: 0 auto 30px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #0a84ff, #bf5af2);
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 24px 70px -14px rgba(120, 90, 255, 0.65);
}

.hero__name {
  font-size: clamp(64px, 11vw, 116px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: #f5f5f7;
}

.hero__grad {
  margin-top: 6px;
  font-size: clamp(30px, 5.2vw, 56px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  background: linear-gradient(90deg, #0a84ff, #64d2ff, #bf5af2, #ff375f, #0a84ff);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 9s linear infinite;
}
@keyframes sheen { to { background-position: 220% 0; } }

.hero__sub {
  max-width: 560px;
  margin: 26px auto 0;
  font-size: 18px;
  color: var(--muted-dark);
}

.hero__cta {
  margin-top: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 30px;
}

/* 首屏入场 */
.js [data-anim] {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 1s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ---------- 按钮与链接 ---------- */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.3s var(--ease);
}
.btn:hover { background: var(--blue-hover); transform: scale(1.02); }
.btn--lg { padding: 16px 38px; font-size: 17.5px; }

.link-cta {
  color: var(--link-dark-bg);
  font-size: 17px;
  font-weight: 500;
}
.link-cta:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-cta span { font-size: 19px; }

/* ---------- 分区 ---------- */
.section { padding: 130px 0; }
.sec-gray { background: var(--bg-alt); }
.sec-black { background: #000; color: #f5f5f7; }

.sec-title {
  text-align: center;
  font-size: clamp(38px, 5.5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.sec-sub {
  text-align: center;
  margin: 14px auto 0;
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--muted);
  max-width: 620px;
}
.sec-black .sec-sub { color: var(--muted-dark); }

.lead {
  max-width: 720px;
  margin: 44px auto 0;
  text-align: center;
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.55;
  font-weight: 500;
}

/* ---------- 关于：信息卡 ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 60px;
}
.info-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.info-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.info-value {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 42px;
}
.chip {
  padding: 8px 19px;
  border: 1px solid var(--border);
  border-radius: 980px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- 作品卡 ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.work-card {
  position: relative;
  min-height: 380px;
  border-radius: var(--radius);
  padding: 44px 40px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s ease;
}
.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.22), transparent 55%);
  pointer-events: none;
}
.work-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 30px 70px -22px rgba(0, 0, 0, 0.45);
}

.work-card--violet  { background: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 55%, #bf5af2 100%); }
.work-card--sunset  { background: linear-gradient(135deg, #ff9f0a 0%, #ff375f 55%, #bf5af2 100%); }
.work-card--mint    { background: linear-gradient(135deg, #30d158 0%, #64d2ff 60%, #0a84ff 100%); }
.work-card--dark    { background: #1d1d1f; }
.work-card--dark::before {
  background: radial-gradient(120% 80% at 50% 0%, rgba(94, 92, 230, 0.35), transparent 55%);
}

.work-label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}
.work-title {
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.work-title--grad {
  background: linear-gradient(90deg, #0a84ff, #64d2ff, #bf5af2, #ff375f);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 8s linear infinite;
}
.work-desc {
  margin-top: 10px;
  max-width: 420px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}
.work-card--dark .work-desc { color: var(--muted-dark); }
.work-tech {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.75);
}
.work-card--dark .work-tech { color: var(--muted); }

/* ---------- 经历时间线 ---------- */
.timeline {
  max-width: 700px;
  margin: 64px auto 0;
}
.timeline li {
  position: relative;
  padding: 0 0 42px 30px;
  border-left: 1px solid rgba(245, 245, 247, 0.18);
}
.timeline li:last-child { padding-bottom: 4px; border-left-color: transparent; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #bf5af2);
  box-shadow: 0 0 14px rgba(94, 92, 230, 0.8);
}
.timeline time {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--muted-dark);
}
.timeline strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
  font-weight: 700;
  color: #f5f5f7;
}
.timeline p {
  margin-top: 6px;
  font-size: 15.5px;
  color: var(--muted-dark);
  max-width: 540px;
}

/* ---------- 联系 ---------- */
.contact__actions {
  text-align: center;
  margin-top: 40px;
}
.contact__social {
  margin-top: 30px;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 34px;
  font-size: 17px;
}
.contact__social a {
  color: #06c;
  font-weight: 500;
}
.contact__social a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 页脚 ---------- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 26px 0 54px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.footer__links a { color: #424245; }
.footer__links a:hover { text-decoration: underline; }
.footer__note { margin-top: 16px; color: #a1a1a6; }

/* ---------- 滚动显现 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease, transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .works-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .work-card { min-height: 300px; }
}

@media (max-width: 700px) {
  .nav__links {
    position: fixed;
    top: calc(var(--nav-h) + 8px);
    left: 12px;
    right: 12px;
    z-index: 99;
    flex-direction: column;
    gap: 2px;
    padding: 14px;
    border-radius: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav.is-dark .nav__links {
    background: rgba(28, 28, 30, 0.92);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
  .nav.is-light .nav__links {
    background: rgba(251, 251, 253, 0.95);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  }
  .nav__links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav__links a { padding: 13px 14px; font-size: 16px; border-radius: 10px; }
  .nav__links a:hover { background: rgba(128, 128, 128, 0.12); }
  .nav__burger { display: grid; }
  .nav__cta { display: none; }

  .section { padding: 92px 0; }
  .info-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero__cta .btn { width: min(320px, 86vw); }
  .hero__cta .link-cta { width: 100%; text-align: center; }
}

@media (max-width: 440px) {
  .info-grid { grid-template-columns: 1fr; }
  .work-card { padding: 34px 26px; }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal], .js [data-anim] { opacity: 1 !important; transform: none !important; }
}
