/* ── Design tokens ── */
:root {
  --bg: #0a0b0f;
  --bg-elevated: #12141c;
  --bg-card: #161922;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --text-muted: #8b92a8;
  --accent: #6ee7b7;
  --accent-alt: #a78bfa;
  --accent-warm: #fbbf24;
  --gradient-app: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
  --gradient-game: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 72px;
  --container: min(1120px, 100% - 48px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Noise overlay */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  width: var(--container);
  margin-inline: auto;
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10, 11, 15, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.header.scrolled {
  border-bottom-color: var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
}

.logo-mark {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  background: rgba(110, 231, 183, 0.12);
  padding: 6px 10px;
  border-radius: 8px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.nav-cta {
  color: var(--bg) !important;
  background: var(--gradient-app);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
}

.nav-cta:hover {
  filter: brightness(1.08);
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px 28px;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav:not([hidden]) {
  display: flex;
}

.mobile-nav a {
  font-size: 1.1rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: calc(var(--header-h) + 48px) 24px 80px;
  max-width: 1200px;
  margin-inline: auto;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: rgba(110, 231, 183, 0.25);
  top: -80px;
  right: 10%;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: rgba(167, 139, 250, 0.2);
  bottom: 10%;
  left: -60px;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black, transparent);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 6px 14px 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient-app);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text.alt {
  background: var(--gradient-game);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient-app);
  color: #0a0b0f;
  box-shadow: 0 8px 32px rgba(110, 231, 183, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.btn-full {
  width: 100%;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hero-stats dt {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.hero-stats dd {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Phone mock */
.hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.phone-mock {
  width: 280px;
  padding: 12px;
  background: linear-gradient(145deg, #2a2d3a, #1a1c24);
  border-radius: 36px;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-screen {
  position: relative;
  aspect-ratio: 9/16;
  background: var(--bg-elevated);
  border-radius: 26px;
  overflow: hidden;
  padding: 20px;
}

.app-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  animation: float 4s ease-in-out infinite;
}

.card-1 { top: 18%; left: 8%; animation-delay: 0s; }
.card-2 { top: 42%; right: 5%; animation-delay: 0.8s; }
.card-3 { bottom: 28%; left: 12%; animation-delay: 1.6s; }

.card-icon { font-size: 1.25rem; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.code-snippet {
  position: absolute;
  bottom: 12%;
  right: 8%;
  left: 8%;
  padding: 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.code-snippet .kw { color: var(--accent-alt); }
.code-snippet .fn { color: var(--accent); }

/* ── Sections ── */
.section {
  padding: 100px 24px;
}

.section-dark {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 56px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s, transform 0.3s;
}

.about-card:hover {
  border-color: rgba(110, 231, 183, 0.3);
  transform: translateY(-4px);
}

.about-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.about-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.service-card {
  padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.service-app::before {
  background: var(--gradient-app);
}

.service-game::before {
  background: var(--gradient-game);
}

.service-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(110, 231, 183, 0.15);
  color: var(--accent);
  margin-bottom: 12px;
}

.service-badge.game {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-alt);
}

.service-header h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.service-list {
  list-style: none;
  margin-bottom: 24px;
}

.service-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.service-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

.service-game .service-list li::before {
  color: var(--accent-alt);
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-tags span {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: var(--text-muted);
}

/* Work */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 700px;
  margin-inline: auto;
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
}

.work-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
}

.work-body {
  padding: 12px;
  flex: 1;
}

.work-body h3 {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.work-body p {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.work-thumb {
  height: 100px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.work-thumb-1 {
  background: linear-gradient(135deg, #1e3a2f 0%, #0f1f18 50%, #2d1f4e 100%);
}

.work-thumb-2 {
  background: linear-gradient(135deg, #2d3a1e 0%, #1a2410 50%, #3d2a1a 100%);
}

.work-thumb-3 {
  background: linear-gradient(135deg, #1e2a3a 0%, #101820 50%, #1e3a4a 100%);
}

.work-thumb-4 {
  background: linear-gradient(135deg, #3a2a1e 0%, #241810 50%, #4a301e 100%);
}

.work-thumb-5 {
  background: linear-gradient(135deg, #1a3a3a 0%, #0f2020 50%, #1e4a3a 100%);
}

.work-thumb-6 {
  background: linear-gradient(135deg, #3a2a1a 0%, #201510 50%, #4a301a 100%);
}

.work-thumb-7 {
  background: linear-gradient(135deg, #1f2f4a 0%, #0f1726 50%, #263c5f 100%);
}

.work-thumb-8 {
  background: linear-gradient(135deg, #24403a 0%, #10211d 50%, #33524d 100%);
}

.work-qrcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.work-qrcode-dual {
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
}

.qrcode-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.work-qrcode img {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  object-fit: cover;
}

.qrcode-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

.work-type {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-meta span {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--accent);
  opacity: 0.9;
}

/* Stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stack-group h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.stack-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-items span {
  font-size: 0.9rem;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Contact */
.contact-section {
  padding-bottom: 120px;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-copy h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 12px 0 16px;
}

.contact-copy p {
  color: var(--text-muted);
}

.wechat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.wechat-card img {
  width: 180px;
  height: 180px;
  padding: 6px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  object-fit: contain;
  flex-shrink: 0;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.wechat-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.wechat-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form label span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted, #6b7280);
  text-align: center;
}

.form-note {
  font-size: 0.85rem;
  color: var(--accent);
  text-align: center;
}

.form-note[hidden] {
  display: none;
}

/* Footer */
.footer {
  padding: 32px 24px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: flex-end;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.bottom-element {
  text-align: center;
  padding: 0 24px 24px;
}

.bottom-element a {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.bottom-element a:hover {
  color: var(--text);
}

/* Reveal animation
   默认可见，只有 JS 就绪时才启用 reveal 初始隐藏，避免本地 file:// 或脚本异常时整块内容消失。 */
[data-reveal] {
  opacity: 1;
  transform: none;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js [data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(var(--header-h) + 32px);
  }

  .hero-desc {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .phone-mock {
    width: 220px;
  }

  .about-grid,
  .services-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-inner {
    grid-template-columns: 1fr;
  }

  .wechat-card {
    max-width: 420px;
  }
}

@media (min-width: 641px) {
  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }

  .menu-btn {
    display: flex;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }

  .wechat-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .work-qrcode-dual {
    flex-direction: column;
    align-items: center;
  }

  .stat-divider {
    display: none;
  }
}
