/* ============================================================
   紫狐数据 ZiFox — Premium Purple Theme
   Senior Developer · Laravel/Livewire/FluxUI · advanced CSS
   ============================================================ */

/* ---------- Design Tokens (Light default) ---------- */
:root {
  --bg: #f6f4ff;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1a1230;
  --text-soft: #574e72;
  --muted: #8a83a0;
  --border: rgba(124, 58, 237, 0.14);
  --border-strong: rgba(124, 58, 237, 0.28);
  --primary: #7c3aed;
  --primary-500: #8b5cf6;
  --accent: #a855f7;
  --accent-2: #c084fc;
  --glow: rgba(139, 92, 246, 0.30);
  --glow-soft: rgba(168, 85, 247, 0.16);
  --code-bg: #f3effe;
  --code-text: #2c2348;
  --shadow-sm: 0 4px 18px rgba(76, 29, 149, 0.06);
  --shadow-md: 0 18px 50px rgba(76, 29, 149, 0.10);
  --shadow-lg: 0 30px 80px rgba(76, 29, 149, 0.16);
  --radius: 20px;
  --radius-lg: 28px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: "Outfit", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

/* ---------- Dark tokens ---------- */
[data-theme="dark"] {
  --bg: #0b0814;
  --bg-2: #120c22;
  --surface: rgba(30, 21, 53, 0.62);
  --surface-solid: #160f2b;
  --text: #f3eeff;
  --text-soft: #c6bce4;
  --muted: #8d84ab;
  --border: rgba(167, 139, 250, 0.16);
  --border-strong: rgba(167, 139, 250, 0.30);
  --primary: #a855f7;
  --primary-500: #a855f7;
  --accent: #c084fc;
  --accent-2: #d8b4fe;
  --glow: rgba(168, 85, 247, 0.42);
  --glow-soft: rgba(168, 85, 247, 0.20);
  --code-bg: #150f29;
  --code-text: #e7defb;
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* ---------- System (follows OS) ---------- */
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0b0814;
    --bg-2: #120c22;
    --surface: rgba(30, 21, 53, 0.62);
    --surface-solid: #160f2b;
    --text: #f3eeff;
    --text-soft: #c6bce4;
    --muted: #8d84ab;
    --border: rgba(167, 139, 250, 0.16);
    --border-strong: rgba(167, 139, 250, 0.30);
    --primary: #a855f7;
    --primary-500: #a855f7;
    --accent: #c084fc;
    --accent-2: #d8b4fe;
    --glow: rgba(168, 85, 247, 0.42);
    --glow-soft: rgba(168, 85, 247, 0.20);
    --code-bg: #150f29;
    --code-text: #e7defb;
    --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.4s var(--ease);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; }
.icon { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Layout helpers ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 130px) 24px;
}
.grad {
  background: linear-gradient(100deg, var(--primary) 0%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
.section__head { max-width: 720px; margin-bottom: 56px; }
.section__title {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.section__lead { margin-top: 16px; color: var(--text-soft); font-size: 1.05rem; max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
  white-space: nowrap;
  will-change: transform;
}
.btn .icon { width: 1.1em; height: 1.1em; }
.btn--lg { padding: 15px 28px; font-size: 1.02rem; }
.btn--primary {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 10px 30px var(--glow);
}
.btn--primary:hover { box-shadow: 0 16px 44px var(--glow); transform: translateY(-2px); }
.btn--solid {
  background: var(--text);
  color: var(--bg);
}
.btn--solid:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn--ghost:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* Magnetic wrapper transition fallback */
[data-magnetic] { transition: transform 0.25s var(--ease); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 70px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 18px var(--glow);
}
.brand__mark .icon { width: 22px; height: 22px; }
.brand__text { font-size: 1.12rem; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 6px; }
.brand__sub { font-size: 0.7rem; font-weight: 600; color: var(--muted); letter-spacing: 0.12em; }

/* 水平排版 Logo：用真实图片替代文字+狐狸图标的组合 */
.brand--logo { gap: 8px; }
.brand-img { display: block; height: 38px; width: auto; user-select: none; -webkit-user-drag: none; }
.brand-img--footer { height: 44px; }
.nav__links { display: flex; gap: 28px; margin-left: 18px; }
.nav__links a { font-size: 0.95rem; color: var(--text-soft); font-weight: 500; transition: color 0.25s; position: relative; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--text-soft);
  transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease);
  overflow: hidden;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.theme-toggle .icon { position: absolute; width: 20px; height: 20px; transition: opacity 0.3s, transform 0.4s var(--ease); }
.icon-sun, .icon-moon, .icon-monitor { opacity: 0; transform: scale(0.6) rotate(-30deg); }
:root[data-theme="light"] .icon-sun,
:root[data-theme="dark"] .icon-moon,
:root[data-theme="system"] .icon-monitor { opacity: 1; transform: scale(1) rotate(0); }

.nav__login { padding: 9px 16px; }
.nav__burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); place-items: center; color: var(--text); }
.nav__mobile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 24px 24px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav__mobile a { padding: 12px 8px; color: var(--text-soft); font-weight: 500; border-radius: 10px; }
.nav__mobile a:hover { background: var(--glow-soft); color: var(--text); }
.nav__mobile .btn { justify-content: center; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__glow {
  position: absolute; z-index: 0;
  width: 720px; height: 720px;
  top: -160px; right: -120px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  filter: blur(20px);
  pointer-events: none;
}
.hero__inner {
  position: relative; z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 500; color: var(--text-soft);
  backdrop-filter: blur(10px);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--glow-soft); animation: pulse 2.4s infinite; }
.hero__title {
  margin: 22px 0 18px;
  font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero__lead { color: var(--text-soft); font-size: 1.12rem; max-width: 52ch; }
.hero__cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 36px; margin-top: 44px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.stat span { font-size: 0.85rem; color: var(--muted); }

/* Hero panel */
.hero__panel { position: relative; }
.codecard {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.codecard__bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.codecard__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.codecard__bar span:nth-child(1) { background: #f0a8d0; }
.codecard__bar span:nth-child(2) { background: #d8b4fe; }
.codecard__bar span:nth-child(3) { background: #a5b4fc; }
.codecard__label { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.codecard__code { padding: 18px 18px; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7; color: var(--code-text); overflow-x: auto; }
.c-key { color: var(--accent); font-weight: 500; }
.c-str { color: #e079b0; }
.c-com { color: var(--muted); font-style: italic; }
.c-prop { color: var(--primary-500); }
.c-fn { color: #5b9cf0; }
.c-num { color: #f0a85b; }

.floatcard {
  position: absolute;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  animation: floaty 6s ease-in-out infinite;
}
.floatcard .icon { color: var(--accent); }
.floatcard strong { display: block; font-size: 0.92rem; }
.floatcard span { font-size: 0.78rem; color: var(--muted); }
.floatcard--1 { top: -22px; left: -34px; }
.floatcard--2 { bottom: 26px; right: -28px; animation-delay: 1.6s; }

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  backdrop-filter: blur(14px);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  transform-style: preserve-3d;
}
.feature:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-6px); }
.feature__icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  margin-bottom: 18px;
  box-shadow: 0 10px 26px var(--glow);
}
.feature__icon .icon { width: 26px; height: 26px; }
.feature h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: 8px; }
.feature p { color: var(--text-soft); font-size: 0.96rem; }

/* ---------- Skills ---------- */
.section--skills { background:
  radial-gradient(60% 40% at 80% 0%, var(--glow-soft), transparent 70%);
  border-radius: 40px;
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}
.skill {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  transform-style: preserve-3d;
}
.skill::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), var(--glow-soft), transparent 60%);
  opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none;
}
.skill:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-6px); }
.skill:hover::before { opacity: 1; }
.skill__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.skill__icon {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--glow-soft);
  border: 1px solid var(--border);
  color: var(--primary);
}
.skill__icon .icon { width: 24px; height: 24px; }
.tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--glow-soft); color: var(--primary);
  border: 1px solid var(--border);
}
.skill h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; }
.skill p { color: var(--text-soft); font-size: 0.9rem; line-height: 1.55; }

/* ---------- APIs ---------- */
.apis__inner {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center;
}
.apis__list { margin: 22px 0 28px; display: flex; flex-direction: column; gap: 12px; }
.apis__list li { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 0.98rem; }
.apis__list .icon { color: var(--accent); width: 20px; height: 20px; }
.codecard--api .codecard__bar { gap: 7px; }
.codecard--api .codecard__code { font-size: 0.8rem; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  backdrop-filter: blur(14px);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}
.step:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.step__num {
  display: inline-grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 1.2rem; font-weight: 600;
  width: 54px; height: 54px; border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; margin-bottom: 18px;
  box-shadow: 0 10px 26px var(--glow);
}
.step h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 14px; }
.step code { font-family: var(--font-mono); font-size: 0.82rem; background: var(--glow-soft); padding: 2px 7px; border-radius: 6px; color: var(--primary); }
.step__link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 600; color: var(--primary); margin-right: 16px; }
.step__link .icon { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.step__link:hover .icon { transform: translateX(3px); }

/* ---------- CTA ---------- */
.cta { position: relative; padding: clamp(70px, 9vw, 120px) 24px; overflow: hidden; }
.cta__glow {
  position: absolute; inset: auto 0 -40% 0; height: 80%;
  background: radial-gradient(60% 100% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
.cta__inner {
  position: relative; z-index: 2;
  max-width: 760px; margin: 0 auto; text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 70px);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}
.cta__title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; }
.cta__lead { color: var(--text-soft); margin: 14px auto 30px; font-size: 1.08rem; max-width: 46ch; }
.cta__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 60px 24px 36px;
  display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px;
}
.footer__brand p { color: var(--text-soft); margin-top: 14px; max-width: 34ch; font-size: 0.95rem; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer__col h4 { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer__col a { display: block; color: var(--text-soft); font-size: 0.95rem; padding: 6px 0; transition: color 0.25s; }
.footer__col a:hover { color: var(--primary); }
.footer__bar {
  max-width: var(--maxw); margin: 0 auto; padding: 20px 24px 40px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--muted);
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px var(--glow-soft); } 50% { box-shadow: 0 0 0 8px transparent; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__panel { max-width: 520px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .skill-grid { grid-template-columns: repeat(3, 1fr); }
  .apis__inner { grid-template-columns: 1fr; gap: 32px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav__links, .nav__login { display: none; }
  .nav__burger { display: grid; }
  .feature-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(3, 1fr); }
  .floatcard--1 { left: -10px; } .floatcard--2 { right: -6px; }
  .hero__stats { gap: 24px; }
}
@media (max-width: 460px) {
  .skill-grid { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr; }
  .hero__cta .btn { flex: 1; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
