/* ======================================================================
   PRISM · 创意前端实验室  —  暗色霓虹主题
   纯手写 CSS，零依赖。包含：自定义光标、粒子层、玻璃拟态、
   渐变文字、3D 倾斜、滚动揭示动画、响应式与 prefers-reduced-motion。
   ====================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #0a0a14;
  --bg-2: #0f0f1e;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);

  --text: #eef0ff;
  --text-dim: #a6acdb;
  --text-faint: #6f76a8;

  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --grad: linear-gradient(135deg, var(--violet), var(--cyan) 50%, var(--pink));

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1160px;
  --nav-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  /* 多层径向光晕 + 微噪点感的深色背景 */
  background-image:
    radial-gradient(1100px 700px at 12% -5%, rgba(139, 92, 246, 0.20), transparent 60%),
    radial-gradient(1000px 800px at 100% 0%, rgba(34, 211, 238, 0.14), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(236, 72, 153, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  line-height: 1.65;
  font-size: 16px;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: rgba(139, 92, 246, 0.35); color: #fff; }

/* ---------- 粒子背景层 ---------- */
#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}

/* ---------- 自定义光标（仅精确指针设备） ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan);
}
.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(139, 92, 246, 0.8);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              border-color 0.25s var(--ease), opacity 0.3s var(--ease),
              background 0.25s var(--ease);
}
.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  border-color: rgba(236, 72, 153, 0.9);
  background: rgba(236, 72, 153, 0.08);
}
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, [data-tilt] { cursor: none; }
  .cursor-dot, .cursor-ring { opacity: 1; }
}

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.7);
  z-index: 1000;
  transition: width 0.08s linear;
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 48px);
  z-index: 900;
  transition: background 0.35s var(--ease), backdrop-filter 0.35s var(--ease),
              border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(10, 10, 20, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.16em;
}
.nav__logo {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.15em;
}
.nav__links {
  display: flex;
  gap: 34px;
}
.nav__links a {
  position: relative;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 2px;
  transition: color 0.25s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--grad);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

/* 汉堡按钮（移动端） */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  padding: 6px 2px;
}
.nav__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  position: relative;
  transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease),
              background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn--primary {
  background: var(--grad);
  color: #0a0a14;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(236, 72, 153, 0.45);
}
.btn--ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
}
.btn--ghost:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.20);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 20px 60px;
}
.hero__inner { max-width: 900px; }
.hero__eyebrow {
  display: inline-block;
  color: var(--text-dim);
  font-size: 0.92rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  margin-bottom: 28px;
}
.hero__title {
  font-size: clamp(2.8rem, 9vw, 6.2rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  color: var(--text-dim);
  margin-bottom: 40px;
}
.hero__type { color: var(--text); font-weight: 600; }
.hero__caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  background: var(--cyan);
  transform: translateY(2px);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 80px;
}
.hero__scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
}
.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(var(--cyan), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--text);
  animation: scrolldot 1.8s var(--ease) infinite;
}
@keyframes scrolldot {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(250%); }
}

/* ---------- 通用 Section ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(70px, 12vh, 130px) 20px;
}
.section__head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}
.section__kicker {
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section__title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.section__desc {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 1.02rem;
}

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid--features {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid--works {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ---------- 特色卡片（玻璃拟态） ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  z-index: -1;
}
.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  background: var(--surface-strong);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}
.card__icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.card__title {
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.card__text { color: var(--text-dim); font-size: 0.96rem; }

/* ---------- 3D 倾斜作品卡 ---------- */
.grid--works { perspective: 1200px; }
.tilt {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(139, 92, 246, 0.22), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(34, 211, 238, 0.18), transparent 55%),
    var(--surface-strong);
  border: 1px solid var(--border);
  transform-style: preserve-3d;
  transition: transform 0.2s var(--ease), box-shadow 0.35s var(--ease),
              border-color 0.35s var(--ease);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.tilt:hover {
  border-color: var(--border-strong);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.tilt__glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.18),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.tilt:hover .tilt__glare { opacity: 1; }
.tilt__content { position: relative; transform: translateZ(40px); }
.tilt__tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
  padding: 5px 12px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 999px;
  margin-bottom: 18px;
}
.tilt__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.tilt__text { color: var(--text-dim); font-size: 0.96rem; margin-bottom: 18px; }
.tilt__more {
  font-weight: 600;
  color: var(--text);
  transition: color 0.25s var(--ease);
}
.tilt:hover .tilt__more { color: var(--pink); }

/* ---------- 数据统计 ---------- */
.section--stats { max-width: 1000px; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}
.stat {
  padding: 34px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.stat__num {
  display: block;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 800;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label {
  display: block;
  margin-top: 12px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

/* ---------- 联系 CTA ---------- */
.section--cta { max-width: 900px; }
.cta {
  text-align: center;
  padding: clamp(40px, 7vw, 70px) clamp(24px, 5vw, 60px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(100% 120% at 50% 0%, rgba(139, 92, 246, 0.22), transparent 60%),
    var(--surface-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cta__title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 14px;
}
.cta__text { color: var(--text-dim); margin-bottom: 30px; font-size: 1.05rem; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: rgba(8, 8, 16, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-top: 40px;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 20px 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
}
.footer__slogan { color: var(--text-faint); margin-top: 12px; font-size: 0.95rem; }
.footer__links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.footer__links a {
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.footer__links a:hover { color: var(--cyan); }
.footer__bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 20px 30px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.88rem;
}
.footer__bottom a {
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.footer__bottom a:hover { color: var(--cyan); }

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #0a0a14;
  background: var(--grad);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 800;
}
.to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.to-top:hover { transform: translateY(-4px) scale(1.05); }

/* ---------- 滚动揭示动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* 给同一网格内的卡片做轻微错峰 */
.grid > .reveal { transition-delay: calc(var(--i, 0) * 0.07s); }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    width: min(78vw, 320px);
    height: calc(100vh - var(--nav-h));
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 30px 26px;
    background: rgba(12, 12, 24, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  }
  .nav__links a {
    display: block;
    padding: 14px 4px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav__links.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .footer__inner { flex-direction: column; }
  .footer__bottom { flex-direction: column; text-align: center; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__caret, .hero__scroll-line::after { animation: none; }
}
