/* ===== Local fonts (no Google CDN) ===== */
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== Tokens ===== */
:root {
  --bg: #071018;
  --bg-elevated: #0c1824;
  --surface: rgba(14, 28, 42, 0.72);
  --text: #e8f4ff;
  --text-muted: #8aa4b8;
  --cyan: #2ee6c5;
  --cyan-dim: rgba(46, 230, 197, 0.18);
  --lime: #c8f542;
  --line: rgba(46, 230, 197, 0.22);
  --danger: #ff6b7a;
  /* 西文用本地 Chakra Petch；中文走系统字体，国内零外网依赖 */
  --font-display: "Chakra Petch", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

/* ===== Atmosphere ===== */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 70% 10%, rgba(46, 230, 197, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 15% 80%, rgba(200, 245, 66, 0.06), transparent 50%),
    linear-gradient(180deg, #061018 0%, #0a1520 50%, #071018 100%);
}

.grid-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(46, 230, 197, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 230, 197, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  pointer-events: none;
}

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===== Header ===== */
.site-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 clamp(1.25rem, 4vw, 3rem);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(7, 16, 24, 0.85);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  z-index: 101;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--cyan);
  border-radius: 6px;
  position: relative;
  flex-shrink: 0;
}

.logo-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.25s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--cyan);
}

.nav-cta {
  padding: 0.45rem 1rem;
  border: 1px solid var(--cyan);
  color: var(--cyan) !important;
  border-radius: 4px;
  transition: background 0.25s, color 0.25s !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--cyan-dim);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin-inline: auto;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

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

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

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #1ab89a);
  color: #041018;
  box-shadow: 0 0 24px rgba(46, 230, 197, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 0 36px rgba(46, 230, 197, 0.4);
}

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

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: calc(var(--header-h) + 2rem) clamp(1.25rem, 4vw, 3rem) 4rem;
  max-width: 1280px;
  margin: 0 auto;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 34rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.08em;
  background: linear-gradient(105deg, var(--text) 20%, var(--cyan) 55%, var(--lime) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
  animation: brandIn 1s var(--ease) both;
}

.brand-sub {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  animation: fadeUp 0.9s var(--ease) 0.08s both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 1rem;
  animation: fadeUp 0.9s var(--ease) 0.15s both;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 28rem;
  animation: fadeUp 0.9s var(--ease) 0.28s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  animation: fadeUp 0.9s var(--ease) 0.4s both;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(52vh, 420px);
  animation: fadeIn 1.2s var(--ease) 0.2s both;
}

.hero-frame {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 1;
  color: var(--cyan);
  z-index: 1;
}

.hero-glyph {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 28px rgba(46, 230, 197, 0.35));
  animation: floatY 6s ease-in-out infinite;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

.hero-orb--a {
  width: 55%;
  height: 55%;
  top: 10%;
  right: 5%;
  background: rgba(46, 230, 197, 0.35);
  animation: pulseOrb 5s ease-in-out infinite;
}

.hero-orb--b {
  width: 40%;
  height: 40%;
  bottom: 15%;
  left: 10%;
  background: rgba(200, 245, 66, 0.2);
  animation: pulseOrb 7s ease-in-out infinite reverse;
}

@keyframes brandIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulseOrb {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ===== Sections ===== */
.section {
  padding: clamp(4.5rem, 10vw, 7rem) clamp(1.25rem, 4vw, 3rem);
  max-width: var(--max);
  margin: 0 auto;
}

.section-head {
  max-width: 36rem;
  margin-bottom: 2.75rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.section-head p {
  color: var(--text-muted);
}

/* ===== Games / Coming soon ===== */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 50% 60% at 50% 40%, rgba(46, 230, 197, 0.08), transparent 70%),
    rgba(12, 24, 36, 0.4);
}

.coming-soon-frame {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.coming-soon-pulse {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 24px rgba(46, 230, 197, 0.55);
  animation: pulseOrb 2.4s ease-in-out infinite;
}

.coming-soon-label {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cyan);
}

.coming-soon-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== About ===== */
.about {
  max-width: none;
  padding-inline: 0;
  background: linear-gradient(180deg, transparent, rgba(46, 230, 197, 0.04), transparent);
}

.about-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
}

.about-copy p + p {
  margin-top: 1rem;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-left: 1px solid var(--line);
  padding-left: 2rem;
}

.about-stats li {
  display: flex;
  flex-direction: column;
}

.about-stats strong {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.2;
  letter-spacing: 0.12em;
}

.about-stats span {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ===== Tech ===== */
.tech-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 2.5rem;
  counter-reset: tech;
}

.tech-list li {
  position: relative;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
  counter-increment: tech;
}

.tech-list li::before {
  content: counter(tech, decimal-leading-zero);
  position: absolute;
  top: 0.65rem;
  left: 0;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--lime);
}

.tech-list h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  letter-spacing: 0.03em;
}

.tech-list p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Join ===== */
.join {
  max-width: none;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.join-panel {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(46, 230, 197, 0.08), transparent 45%),
    var(--bg-elevated);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: center;
}

.join-panel .section-head {
  margin-bottom: 0;
}

.join-roles {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.join-roles a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.join-roles a::after {
  content: "→";
  color: var(--cyan);
  transition: transform 0.25s var(--ease);
}

.join-roles a:hover,
.join-roles a:focus-visible {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.join-roles a:hover::after {
  transform: translateX(4px);
}

/* ===== Contact ===== */
.contact .section-head {
  margin-bottom: 0;
}

.contact-mail {
  color: var(--cyan);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}

.contact-mail:hover,
.contact-mail:focus-visible {
  border-bottom-color: var(--cyan);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.footer-brand .logo-mark {
  width: 22px;
  height: 22px;
}

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

.site-footer a {
  color: var(--cyan);
  transition: opacity 0.25s;
}

.site-footer a:hover {
  opacity: 0.8;
}

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

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: calc(var(--header-h) + 1.5rem);
    padding-bottom: 3rem;
  }

  .hero-visual {
    order: -1;
    min-height: 240px;
  }

  .hero-frame {
    width: min(100%, 280px);
  }

  .hero-content {
    max-width: none;
    text-align: left;
  }

  .about-layout,
  .join-panel,
  .tech-list {
    grid-template-columns: 1fr;
  }

  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 1.75rem;
    gap: 1.5rem 2.5rem;
  }

}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    background: rgba(7, 16, 24, 0.97);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .site-nav a {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text);
  }

  .nav-cta {
    margin-top: 0.5rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .brand,
  .brand-sub,
  .hero-title,
  .hero-desc,
  .hero-actions,
  .hero-visual,
  .hero-glyph,
  .hero-orb,
  .coming-soon-pulse,
  .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
