:root {
  --bg: #07090d;
  --bg-elevated: #0d1017;
  --bg-hover: #121722;
  --text: #f2f5f9;
  --text-muted: #939eae;
  --text-faint: #5e6878;
  --accent: #38d9c0;
  --accent-strong: #5cead3;
  --accent-dim: rgba(56, 217, 192, 0.12);
  --accent-border: rgba(56, 217, 192, 0.34);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --max-w: 1040px;
  --nav-h: 64px;
  --radius: 10px;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "MiSans",
    "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei UI",
    "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono",
    "JetBrains Mono", Menlo, Consolas, monospace;
}

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

html {
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(65% 42% at 50% 0%, rgba(56, 217, 192, 0.085), transparent 70%),
    linear-gradient(to right, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 100% 680px, 64px 64px, 64px 64px;
  background-repeat: no-repeat, repeat, repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:lang(zh-CN) body,
html[lang="zh-CN"] body {
  line-height: 1.75;
}

::selection {
  background: rgba(56, 217, 192, 0.28);
  color: #ffffff;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Header / Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: max(1.5rem, calc((100% - var(--max-w)) / 2 + 1.5rem));
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

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

.nav nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.18s ease;
  white-space: nowrap;
}

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

#lang {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
}

#lang:hover {
  color: var(--accent-strong);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

/* Main sections */
main {
  position: relative;
}

section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(4.5rem, 8vw, 6.5rem) 1.5rem;
}

section + section {
  border-top: 1px solid var(--border);
}

h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

h2::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--accent);
  opacity: 0.85;
}

html[lang="zh-CN"] h2 {
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

/* Hero */
.hero {
  padding-top: clamp(6rem, 15vh, 10rem);
  padding-bottom: clamp(5rem, 10vh, 7.5rem);
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(2.4rem, 6.2vw, 4.5rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 35%, #9ca7b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[lang="zh-CN"] .hero h1 {
  max-width: 14em;
  font-size: clamp(2rem, 5.2vw, 3.85rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.hero p {
  margin-top: 1.6rem;
  max-width: 52ch;
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  line-height: 1.68;
  color: var(--text-muted);
  text-wrap: pretty;
}

html[lang="zh-CN"] .hero p {
  max-width: 38ch;
  line-height: 1.8;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 2.4rem;
  padding: 0.82rem 1.45rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hero .cta {
  background: var(--accent);
  color: #041310;
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 217, 192, 0.16), 0 6px 20px -10px rgba(56, 217, 192, 0.4);
}

.hero .cta::after {
  content: "→";
  font-family: var(--font-mono);
  transition: transform 0.2s ease;
}

.hero .cta:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(92, 234, 211, 0.35), 0 12px 32px -10px rgba(56, 217, 192, 0.65);
}

.hero .cta:hover::after {
  transform: translateX(3px);
}

/* What we do */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2.25rem;
  counter-reset: card;
}

.cards article {
  position: relative;
  counter-increment: card;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem 1.6rem 1.85rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.008) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
}

.cards article::before {
  content: counter(card, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.cards article:hover {
  border-color: var(--accent-border);
  background-color: var(--bg-hover);
  transform: translateY(-2px);
}

.cards h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.35;
}

.cards p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-wrap: pretty;
}

html[lang="zh-CN"] .cards p {
  line-height: 1.75;
}

/* Approach */
.approach ol {
  list-style: none;
  margin-top: 2.25rem;
  counter-reset: step;
  border-top: 1px solid var(--border);
}

.approach li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 1rem;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  font-weight: 450;
  color: var(--text);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.approach li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
}

html[lang="zh-CN"] .approach li {
  letter-spacing: 0;
  line-height: 1.7;
}

/* Contact */
.contact {
  position: relative;
  padding-bottom: clamp(5.5rem, 10vw, 7.5rem);
}

.contact p {
  margin-top: 1.4rem;
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text);
  max-width: 24ch;
}

html[lang="zh-CN"] .contact p {
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.contact .cta {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.contact .cta:hover {
  color: var(--accent-strong);
  border-color: var(--accent-border);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

/* Footer */
footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-faint);
}

/* Responsive */
@media (max-width: 820px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-h: 58px;
  }

  .nav {
    padding-inline: 1.15rem;
    gap: 0.5rem;
  }

  .brand {
    font-size: 0.875rem;
    gap: 0.45rem;
  }

  .brand img {
    width: 24px;
    height: 24px;
  }

  .nav nav {
    gap: 0.75rem;
  }

  .nav nav a {
    font-size: 0.8rem;
  }

  #lang {
    padding: 0.4rem 0.55rem;
    font-size: 0.72rem;
  }

  section {
    padding: 3.75rem 1.15rem;
  }

  .hero {
    padding-top: 4.5rem;
    padding-bottom: 4rem;
  }

  .cards article {
    padding: 1.4rem 1.3rem 1.5rem;
  }

  .approach li {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 1.3rem 0;
  }

  .cta {
    min-height: 44px;
  }

  footer {
    padding: 1.75rem 1.15rem 2.5rem;
  }
}

@media (max-width: 420px) {
  html[lang="en"] .nav nav {
    gap: 0.55rem;
  }

  html[lang="en"] .nav nav a {
    font-size: 0.74rem;
  }

  html[lang="en"] .brand {
    font-size: 0.82rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
