/* ===================================================================
   个人案例集 · EDITORIAL MOTION 风格
   章节氛围变色 × 幽灵大数字 × 擦除揭幕 × 故障重组文字
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root{
  --bg:        #08090d;
  --bg-soft:   #0d0f16;
  --panel:     rgba(255,255,255,.04);
  --border:    rgba(255,255,255,.11);
  --border-strong: rgba(255,255,255,.26);

  --text:      #f3f4fb;
  --text-dim:  #9aa2b8;
  --text-faint:#5c6480;

  --cyan:   #4fd8ff;
  --violet: #a78bfa;
  --pink:   #ff5da8;
  --grad: linear-gradient(92deg, var(--cyan), var(--violet) 55%, var(--pink));

  --c1:#ff5d6c; --c2:#4fd1ff; --c3:#3fe08f; --c4:#7c8bff;
  --c5:#c084fc; --c6:#ffb454; --c7:#5eead4;
  --accent: var(--cyan);

  --font-display:"Space Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body:"Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono:"JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --maxw: 1180px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; background:var(--bg); }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
h1,h2,h3,h4,h5{ margin:0; font-family:var(--font-display); letter-spacing:-0.01em; }
p{ margin:0; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family:inherit; cursor:pointer; background:none; border:none; color:inherit; }
::selection{ background:var(--violet); color:#08040f; }
:focus-visible{ outline:2px solid var(--cyan); outline-offset:3px; }
.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 32px; position:relative; }
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* ============ AURA (章节氛围色, crossfade by JS) ============ */
.aura-layer{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  opacity:0; transition:opacity 1.1s ease;
}
.aura-layer.on{ opacity:1; }
.bg-grain{
  position:fixed; inset:0; z-index:1; pointer-events:none; opacity:.04; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette{
  position:fixed; inset:0; z-index:1; pointer-events:none;
  background:radial-gradient(120% 100% at 50% 0%, transparent 40%, rgba(4,5,8,.55) 100%);
}

/* dot trailing the cursor, recolors with theme */
.dot-cursor{
  position:fixed; z-index:250; width:9px; height:9px; border-radius:50%;
  background:var(--accent); box-shadow:0 0 16px var(--accent);
  transform:translate(-50%,-50%); pointer-events:none;
  transition:background .5s ease, box-shadow .5s ease, width .2s ease, height .2s ease;
}
.dot-cursor.hover{ width:16px; height:16px; }
@media (pointer:coarse){ .dot-cursor{ display:none; } }

/* ============ SCRAMBLE TEXT TARGETS ============ */
.scramble{ display:inline-block; }

/* ============ TOPBAR ============ */
.topbar{ position:fixed; top:0; left:0; right:0; z-index:100; padding:16px 0 0; }
.topbar-inner{
  max-width:var(--maxw); margin:0 auto; padding:0 32px;
  display:flex; align-items:center; justify-content:space-between;
  height:52px; border-radius:14px;
  transition:background .25s ease, border-color .25s ease;
  border:1px solid transparent;
}
.topbar.scrolled .topbar-inner{
  background:rgba(9,11,20,.7); backdrop-filter:blur(14px);
  border-color:var(--border);
}
.brand{ display:flex; align-items:center; gap:10px; font-family:var(--font-display); font-weight:700; font-size:15px; }
.brand-dot{ width:9px;height:9px;border-radius:50%; background:var(--accent); box-shadow:0 0 12px var(--accent); transition:background .5s ease, box-shadow .5s ease; }

.nav-links{ display:flex; align-items:center; gap:2px; }
.nav-links a{ position:relative; font-size:13.5px; color:var(--text-dim); font-weight:500; padding:8px 13px; border-radius:8px; }
.nav-links a:hover{ color:var(--text); }
.nav-links a.active{ color:var(--text); }
.nav-links a.active::after{ content:""; position:absolute; left:13px; right:13px; bottom:3px; height:1.5px; background:var(--accent); transition:background .5s ease; }

.nav-cta{
  font-family:var(--font-mono); font-size:12px; font-weight:500; color:var(--text); padding:8px 14px; border-radius:8px;
  border:1px solid var(--border-strong); display:inline-flex; align-items:center; gap:6px;
}
.nav-cta:hover{ border-color:var(--accent); }
.nav-menu-btn{ display:none; }

/* ============ MAGNETIC BUTTONS ============ */
.magnetic{ display:inline-block; will-change:transform; transition:transform .25s cubic-bezier(.2,.8,.2,1); }

/* ============ HERO ============ */
.hero{
  position:relative; z-index:2;
  min-height:100svh;
  display:flex; flex-direction:column; justify-content:center;
  padding:140px 0 70px;
}
.hero-eyebrow{
  display:inline-flex; align-items:center; gap:9px;
  font-family:var(--font-mono); font-size:12.5px; color:var(--text-dim);
  border:1px solid var(--border); border-radius:999px; padding:6px 14px; margin-bottom:34px; width:fit-content;
}
.hero-eyebrow .lv{ width:7px; height:7px; border-radius:50%; background:#3fe08f; box-shadow:0 0 8px #3fe08f; animation:pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot{ 0%,100%{ opacity:1; transform:scale(1);} 50%{ opacity:.5; transform:scale(1.3);} }

.hero h1{
  font-size:clamp(46px, 8.6vw, 118px);
  line-height:.98;
  font-weight:700;
  letter-spacing:-0.035em;
  margin-bottom:34px;
}
.hero h1 .line{ display:block; overflow:hidden; }
.hero h1 .line span{
  display:inline-block; transform:translateY(110%);
  animation:line-up .9s cubic-bezier(.16,1,.3,1) forwards;
}
.hero h1 .line:nth-child(1) span{ animation-delay:.05s; }
.hero h1 .line:nth-child(2) span{ animation-delay:.18s; }
.hero h1 .line:nth-child(3) span{ animation-delay:.31s; }
@keyframes line-up{ to{ transform:translateY(0); } }
.hero h1 .grad{
  background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent;
  background-size:220% 100%; animation:grad-shift 7s ease-in-out infinite;
}
@keyframes grad-shift{ 0%,100%{ background-position:0% 50%; } 50%{ background-position:100% 50%; } }
.hero h1 .outline{
  color:transparent; -webkit-text-stroke:1.5px rgba(243,244,251,.55);
}

.hero-term{ font-family:var(--font-mono); font-size:15px; color:var(--cyan); margin-bottom:34px; min-height:24px; opacity:0; animation:fade-up .7s ease .8s forwards; }
.hero-term .caret{ display:inline-block; width:8px; height:16px; background:var(--cyan); margin-left:2px; vertical-align:middle; animation:blink 1s step-end infinite; }
@keyframes blink{ 50%{ opacity:0; } }
@keyframes fade-up{ from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none; } }

.hero-sub{ font-size:16px; color:var(--text-dim); max-width:58ch; margin-bottom:36px; opacity:0; animation:fade-up .7s ease .95s forwards; }
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:56px; opacity:0; animation:fade-up .7s ease 1.1s forwards; }
.btn-solid, .btn-line{
  font-family:var(--font-mono); font-size:13.5px; font-weight:500; padding:14px 26px; border-radius:10px;
  display:inline-flex; align-items:center; gap:8px;
}
.btn-solid{ background:var(--text); color:#08040f; }
.btn-line{ border:1px solid var(--border-strong); color:var(--text); }
.btn-line:hover{ border-color:var(--accent); }

.hero-stats{ display:flex; flex-wrap:wrap; gap:0; border-top:1px solid var(--border); padding-top:26px; opacity:0; animation:fade-up .7s ease 1.25s forwards; }
.hstat{ flex:1 1 0; min-width:110px; padding-right:20px; }
.hstat b{ display:block; font-family:var(--font-display); font-size:30px; font-weight:700; }
.hstat span{ font-size:12.5px; color:var(--text-faint); font-family:var(--font-mono); }

/* marquee */
.marquee-wrap{
  position:relative; z-index:2; border-top:1px solid var(--border); border-bottom:1px solid var(--border);
  padding:16px 0; overflow:hidden;
}
.marquee-track{ display:flex; width:max-content; animation:marquee 32s linear infinite; }
.marquee-track span{ font-family:var(--font-mono); font-size:13px; color:var(--text-faint); padding:0 28px; white-space:nowrap; border-right:1px solid var(--border); }
.marquee-track span b{ color:var(--text-dim); font-weight:500; }
@keyframes marquee{ from{ transform:translateX(0);} to{ transform:translateX(-50%);} }

/* ============ SECTION SCAFFOLD ============ */
section{ position:relative; z-index:2; }
.sec-pad{ padding:120px 0; }
.sec-eyebrow{ font-family:var(--font-mono); font-size:12.5px; color:var(--text-faint); margin-bottom:14px; display:flex; align-items:center; gap:10px; }
.sec-eyebrow::before{ content:"//"; color:var(--text-faint); }
.sec-title{ font-size:clamp(28px,4vw,46px); font-weight:700; margin-bottom:16px; max-width:20ch; letter-spacing:-0.02em; }
.sec-desc{ font-size:15.5px; color:var(--text-dim); max-width:64ch; margin-bottom:48px; }

/* ---- overview cards ---- */
.case-grid-overview{ display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
.ov-card{
  position:relative; border:1px solid var(--border); border-radius:18px; overflow:hidden; background:var(--panel);
  transition:transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s ease;
}
.ov-card:hover{ border-color:var(--border-strong); transform:translateY(-6px); }
.ov-thumb{ aspect-ratio:16/10; overflow:hidden; position:relative; }
.ov-thumb img{ width:100%; height:100%; object-fit:cover; transition:transform .6s cubic-bezier(.2,.8,.2,1); }
.ov-card:hover .ov-thumb img{ transform:scale(1.08) rotate(-0.6deg); }
.ov-thumb::after{ content:""; position:absolute; inset:0; background:linear-gradient(180deg, transparent 35%, rgba(6,7,12,.9)); }
.ov-idx{
  position:absolute; top:12px; left:12px; z-index:2;
  font-family:var(--font-mono); font-size:11.5px; color:#fff;
  border:1px solid rgba(255,255,255,.35); border-radius:999px; padding:3px 10px; backdrop-filter:blur(6px); background:rgba(0,0,0,.25);
}
.ov-body{ padding:16px 18px 20px; position:relative; z-index:2; }
.ov-type{ font-family:var(--font-mono); font-size:11.5px; margin-bottom:8px; }
.ov-title{ font-family:var(--font-display); font-size:17px; font-weight:700; margin-bottom:6px; }
.ov-desc{ font-size:13px; color:var(--text-faint); line-height:1.6; }

/* ============ CASE (chapter) ============ */
.case{ padding:150px 0 110px; border-top:1px solid var(--border); position:relative; overflow:clip; }

.ghost-num{
  position:absolute; top:56px; right:0; z-index:0;
  font-family:var(--font-display); font-weight:700;
  font-size:clamp(120px, 20vw, 300px);
  line-height:1; color:transparent;
  -webkit-text-stroke:1px rgba(255,255,255,.09);
  user-select:none; pointer-events:none;
}

.case-top{ display:flex; align-items:baseline; gap:18px; margin-bottom:22px; position:relative; z-index:1; }
.case-idx{ font-family:var(--font-mono); font-size:14px; font-weight:700; color:var(--accent); transition:color .5s ease; }
.case-cat{ font-family:var(--font-mono); font-size:12.5px; color:var(--text-faint); }

.case-layout{ display:grid; grid-template-columns:0.84fr 1.16fr; gap:60px; align-items:start; position:relative; z-index:1; }
.case-side{ position:sticky; top:100px; }

.case-title{ font-size:clamp(30px,3.8vw,50px); font-weight:700; margin-bottom:16px; line-height:1.06; letter-spacing:-0.02em; }
.case-tagline{ font-size:16.5px; color:var(--accent); font-weight:500; margin-bottom:20px; transition:color .5s ease; }
.case-desc{ font-size:14.5px; color:var(--text-dim); margin-bottom:30px; }

.meta-rows{ border-top:1px solid var(--border); margin-bottom:30px; }
.meta-row{ display:flex; justify-content:space-between; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); font-family:var(--font-mono); font-size:12.5px; }
.meta-row .k{ color:var(--text-faint); }
.meta-row .v{ color:var(--text-dim); text-align:right; }

.case-metrics{ display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--border); border-radius:12px; overflow:hidden; margin-bottom:0; }
.cmetric{ background:var(--bg-soft); padding:16px 16px; }
.cmetric b{ display:block; font-family:var(--font-display); font-size:21px; font-weight:700; }
.cmetric span{ font-family:var(--font-mono); font-size:11px; color:var(--text-faint); }

/* ---- screenshot: wipe reveal frame ---- */
.frame{
  border-radius:16px; border:1px solid var(--border); background:var(--panel);
  padding:9px; margin-bottom:12px; cursor:zoom-in; transition:border-color .2s ease;
}
.frame:hover{ border-color:var(--border-strong); }
.frame-bar{ display:flex; align-items:center; gap:6px; padding:6px 8px 12px; }
.frame-bar i{ width:9px; height:9px; border-radius:50%; background:rgba(255,255,255,.16); }
.frame-url{ margin-left:8px; font-family:var(--font-mono); font-size:11.5px; color:var(--text-faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.frame-shot{ border-radius:10px; overflow:hidden; background:#050608; }
.frame-shot img{
  width:100%; height:auto; display:block;
  clip-path:inset(0 100% 0 0);
  transition:clip-path 1.15s cubic-bezier(.16,1,.3,1), opacity .16s ease;
}
.frame-shot.revealed img{ clip-path:inset(0 0 0 0); }
.frame-caption{ font-family:var(--font-mono); font-size:11.5px; color:var(--text-faint); text-align:center; padding:12px 4px 30px; }

/* ---- filmstrip thumbnails (horizontal scroll) ---- */
.filmstrip{
  display:flex; gap:10px; overflow-x:auto; padding-bottom:10px; margin-bottom:36px;
  scroll-snap-type:x proximity;
  scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent;
}
.filmstrip::-webkit-scrollbar{ height:5px; }
.filmstrip::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:4px; }
.thumb{
  flex:0 0 132px; scroll-snap-align:start;
  border:1px solid var(--border); border-radius:9px; overflow:hidden; background:var(--panel);
  transition:border-color .15s ease, transform .2s ease;
}
.thumb img{ width:100%; aspect-ratio:16/10; object-fit:cover; opacity:.68; transition:opacity .15s ease; }
.thumb span{ display:block; font-family:var(--font-mono); font-size:10.5px; color:var(--text-faint); padding:5px 7px; border-top:1px solid var(--border); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.thumb:hover{ transform:translateY(-2px); }
.thumb:hover img, .thumb.active img{ opacity:1; }
.thumb.active{ border-color:var(--border-strong); }
.thumb.active span{ color:var(--text); }

/* ---- feature cards (editorial numbered list) ---- */
.feat-head{ display:flex; align-items:center; gap:10px; margin:8px 0 18px; }
.feat-head h4{ font-size:19px; font-weight:700; }
.feat-head small{ font-family:var(--font-mono); font-size:11px; color:var(--text-faint); }
.feat-grid{ display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--border); border-radius:14px; overflow:hidden; margin-bottom:44px; }
.feat{ position:relative; background:var(--bg-soft); padding:22px 22px 24px; transition:background .2s ease; }
.feat:hover{ background:#11131d; }
.feat .fn{ font-family:var(--font-mono); font-size:11px; color:var(--text-faint); margin-bottom:10px; display:block; }
.feat h5{ font-size:14.5px; font-weight:600; margin-bottom:8px; }
.feat p{ font-size:13px; color:var(--text-faint); line-height:1.7; }

/* ---- tech stack pills ---- */
.stack-row{ display:flex; flex-wrap:wrap; gap:9px; margin-bottom:8px; }
.stack-pill{ font-family:var(--font-mono); font-size:12px; color:var(--text-dim); border:1px solid var(--border); border-radius:999px; padding:5px 13px; transition:border-color .2s ease, color .2s ease; }
.stack-pill:hover{ border-color:var(--accent); color:var(--text); }

/* ---- ppt gallery grid ---- */
.gallery{ display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:44px; }
.gallery-item{ cursor:zoom-in; }
.gallery-thumb{ border:1px solid var(--border); border-radius:10px; overflow:hidden; aspect-ratio:16/10; background:var(--panel); }
.gallery-thumb img{ width:100%; height:100%; object-fit:cover; opacity:.86; transition:opacity .18s ease, transform .4s cubic-bezier(.2,.8,.2,1); }
.gallery-item:hover .gallery-thumb img{ opacity:1; transform:scale(1.06); }
.gallery-cap{ font-family:var(--font-mono); font-size:11px; color:var(--text-faint); margin-top:7px; }
.gallery-cap b{ color:var(--text-dim); margin-right:5px; }

/* ============ ABILITY ============ */
.ability-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--border); border-radius:16px; overflow:hidden; }
.ability{ background:var(--bg-soft); padding:28px 22px; transition:background .2s ease; }
.ability:hover{ background:#11131d; }
.ability .ico{ font-size:22px; margin-bottom:14px; }
.ability h4{ font-size:16px; margin-bottom:14px; }
.ability ul li{ font-size:12.5px; color:var(--text-faint); padding:5px 0 5px 14px; position:relative; line-height:1.55; }
.ability ul li::before{ content:"›"; position:absolute; left:0; color:var(--violet); }

/* ============ ABOUT ============ */
.about-panel{
  border:1px solid var(--border); border-radius:22px; padding:44px;
  background:var(--panel);
}
.about-panel p{ font-size:15.5px; color:var(--text-dim); line-height:1.85; margin-bottom:16px; }
.about-panel p:last-child{ margin-bottom:0; }
.about-panel b{ color:var(--text); }

/* ============ FOOTER ============ */
footer{ position:relative; z-index:2; border-top:1px solid var(--border); padding:34px 0 40px; }
.foot-row{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; font-family:var(--font-mono); font-size:12px; color:var(--text-faint); }

/* ============ TOTOP ============ */
.totop{
  position:fixed; right:24px; bottom:24px; z-index:60; width:44px; height:44px; border-radius:50%;
  border:1px solid var(--border-strong); background:rgba(10,12,20,.7); backdrop-filter:blur(8px);
  color:#fff; font-size:16px; display:flex; align-items:center; justify-content:center;
  opacity:0; transform:translateY(10px); pointer-events:none; transition:opacity .2s ease, transform .2s ease, border-color .3s ease;
}
.totop.show{ opacity:1; transform:none; pointer-events:auto; }
.totop:hover{ border-color:var(--accent); }

/* ============ LIGHTBOX ============ */
.lightbox{
  position:fixed; inset:0; z-index:300; background:rgba(4,5,9,.94); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.lightbox.open{ opacity:1; pointer-events:auto; }
.lightbox img{ max-width:88vw; max-height:80vh; border-radius:10px; box-shadow:0 30px 90px rgba(0,0,0,.6); }
.lb-cap{ position:absolute; bottom:34px; left:0; right:0; text-align:center; color:var(--text-dim); font-family:var(--font-mono); font-size:12.5px; }
.lb-btn{
  position:absolute; top:50%; transform:translateY(-50%); width:42px;height:42px; border-radius:50%;
  background:rgba(255,255,255,.06); border:1px solid var(--border); color:#fff; font-size:20px;
  display:flex; align-items:center; justify-content:center;
}
.lb-btn:hover{ border-color:var(--accent); }
.lb-prev{ left:20px; } .lb-next{ right:20px; }
.lb-close{ top:24px; right:20px; transform:none; }

/* ============ REVEAL (fade blocks) ============ */
.reveal{ opacity:0; transform:translateY(24px); transition:opacity .7s ease, transform .7s ease; }
.reveal.in{ opacity:1; transform:none; }

/* ============ RESPONSIVE ============ */
@media (max-width:980px){
  .case-layout{ grid-template-columns:1fr; gap:36px; }
  .case-side{ position:static; }
  .case-grid-overview{ grid-template-columns:1fr 1fr; }
  .feat-grid{ grid-template-columns:1fr; }
  .ability-grid{ grid-template-columns:1fr 1fr; }
  .nav-links{ display:none; }
  .nav-menu-btn{ display:flex; align-items:center; justify-content:center; width:38px; height:38px; border:1px solid var(--border-strong); border-radius:9px; }
  .ghost-num{ font-size:120px; top:20px; }
}
@media (max-width:640px){
  .wrap{ padding:0 20px; }
  .case-grid-overview{ grid-template-columns:1fr; }
  .ability-grid{ grid-template-columns:1fr; }
  .case-metrics{ grid-template-columns:1fr; }
  .hero{ padding-top:110px; }
  .sec-pad{ padding:80px 0; }
  .case{ padding:90px 0 60px; }
  .ghost-num{ display:none; }
}
