/* ============================================================
   CIEL — AIGC 设计师作品集 · 核心设计系统
   配色：紫 #6D2FB8 / 亮紫 #9B5DE5 / 近黑 #0E0E11
   字体：系统字体栈（不依赖 Google Fonts，保证国内加载）
   ============================================================ */

:root {
  --accent: #6D2FB8;
  --accent-bright: #9B5DE5;
  --accent-deep: #4A1E7F;
  --bg: #FFFFFF;
  --surface: #F6F4FA;
  --surface-2: #EDE9F4;
  --border: #E5E0ED;
  --text: #111112;
  --text-dim: #6B6676;

  /* 系统字体栈：中文 + 英文回退，无需外链 */
  --font-display: "Archivo Black", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Helvetica Neue", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --font-serif: "Playfair Display", "Songti SC", "SimSun", Georgia, serif;

  --nav-h: 68px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 页面进入淡入 — 通过 loader 覆盖实现，body 始终保持可见 */
body { opacity: 1; }

::selection { background: var(--accent-bright); color: #fff; }

/* ---------- 自定义光标 ---------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent-bright);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(155, 93, 229, 0.6);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}
.cursor-ring.is-hover {
  width: 60px; height: 60px;
  border-color: var(--accent-bright);
  background: rgba(109, 47, 184, 0.08);
}
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none; }
  body { cursor: auto; }
}

/* 桌面端隐藏原生光标（用自定义光标代替） */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button { cursor: none; }
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  transition: background 0.3s ease;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.nav-logo svg { width: 26px; height: 26px; }
.nav-logo svg path { stroke: var(--text); fill: none; }
.nav-logo svg circle { fill: var(--text); stroke: none; }
.nav-logo .wordmark {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.24em;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  align-items: center;
}
.nav-links a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.3s var(--ease-out);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  width: 0; height: 1px;
  background: var(--accent-bright);
  transition: width 0.35s var(--ease-out);
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { width: 100%; }
.nav-links a.is-active { opacity: 1; color: var(--accent-bright); }
.nav-links a.is-active::after { width: 100%; }

/* 移动端导航 */
@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 11px; letter-spacing: 0.08em; }
  .nav-logo .wordmark { display: none; }
}

/* ---------- 加载页 ---------- */
.loader {
  position: fixed;
  inset: 0;
  background: var(--accent);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s var(--ease-out);
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
}
.loader-mark svg { width: 64px; height: 64px; }
.loader-mark svg path { stroke: #fff; fill: none; }
.loader-mark svg circle { fill: #fff; stroke: none; }
.loader-word {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 52px);
  letter-spacing: 0.12em;
  color: #fff;
}
.loader-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.loader-bar {
  width: 160px; height: 2px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.loader-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  transition: width 0.5s ease;
}

/* ---------- 通用容器 ---------- */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.section {
  position: relative;
  padding: clamp(60px, 10vw, 140px) 0;
}

/* ---------- 标题 ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text);
}
.display-xl { font-size: clamp(48px, 12vw, 180px); }
.display-lg { font-size: clamp(36px, 8vw, 110px); }
.display-md { font-size: clamp(28px, 5.5vw, 72px); }

.display .accent { color: var(--accent-bright); }
.display .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text-dim);
}

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lead {
  font-size: clamp(15px, 1.8vw, 20px);
  color: var(--text-dim);
  max-width: 620px;
  line-height: 1.7;
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
  overflow: hidden;
  transition: color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
  cursor: pointer;
}
.btn .btn-fill {
  position: absolute;
  inset: 0;
  background: var(--accent-bright);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out);
  z-index: -1;
}
.btn:hover { color: #fff; border-color: var(--accent-bright); }
.btn:hover .btn-fill { transform: translateY(0); }
.btn.btn-solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.btn-solid .btn-fill { background: var(--accent-bright); }

/* ---------- 跑马灯 ---------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}
.marquee-track {
  display: inline-flex;
  will-change: transform;
  animation: marquee var(--marquee-speed, 30s) linear infinite;
}
.marquee-track.reverse { animation-direction: reverse; }
.marquee-track span {
  display: inline-flex;
  align-items: center;
  padding: 0 0.4em;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 滚动入场 ---------- */
/* 默认可见，JS 进入视野后加上轻微 transform 动画；这样 JS 失效也不会黑屏 */
.reveal {
  opacity: 1;
  transform: none;
}
.reveal.pre-animate {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.pre-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.pre-animate[data-delay="1"] { transition-delay: 0.08s; }
.reveal.pre-animate[data-delay="2"] { transition-delay: 0.16s; }
.reveal.pre-animate[data-delay="3"] { transition-delay: 0.24s; }
.reveal.pre-animate[data-delay="4"] { transition-delay: 0.32s; }

/* 视差层 */
[data-parallax] { will-change: transform; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: clamp(36px, 5vw, 70px) 0 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-meta { color: var(--text-dim); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; }
.footer-meta a { color: var(--text); text-decoration: none; }
.footer-meta a:hover { color: var(--accent-bright); }
.footer-big {
  font-family: var(--font-display);
  font-size: clamp(44px, 12vw, 180px);
  line-height: 0.9;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--border);
  text-align: right;
  transition: color 0.5s var(--ease-out), -webkit-text-stroke-color 0.5s var(--ease-out);
}
.footer-big:hover { color: var(--accent-bright); -webkit-text-stroke-color: var(--accent-bright); }
