/* ================= Reset & Design Tokens ================= */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --accent: #2f9e8f;
  --accent-2: #37bda4;
  --accent-soft: #e9f7f4;
  --bg: #ffffff;
  --bg-alt: #f5faf9;
  --text: #14222a;
  --text-2: #556a72;
  --text-3: #93a7ad;
  --border: #e2eeeb;
  --code-bg: #101c20;
  --shadow: 0 14px 28px rgba(90, 130, 130, .14);
}

body.dark {
  --accent: #35c2a0;
  --accent-2: #4bdcb6;
  --accent-soft: #14292a;
  --bg: #10171a;
  --bg-alt: #151f23;
  --text: #e9f3f1;
  --text-2: #a3b7ba;
  --text-3: #647d82;
  --border: #223035;
  --code-bg: #0a1114;
  --shadow: 0 14px 28px rgba(0, 0, 0, .45);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  transition: background-color .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
  white-space: nowrap;
}

/* ================= Navbar ================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.brand-mark {
  width: 32px;
  height: 32px;
  color: var(--accent);
  transition: transform .25s ease;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: .95rem;
}
.nav-links a {
  color: var(--text-2);
  transition: color .18s ease;
}
.nav-links a:hover { color: var(--accent); }

.theme-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn .icon-moon { display: none; }
body.dark .theme-btn .icon-moon { display: block; }
body.dark .theme-btn .icon-sun { display: none; }

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

/* ================= Hero ================= */
.hero {
  padding: 96px 0 78px;
  text-align: center;
  background: radial-gradient(ellipse 75% 85% at 50% -15%, var(--accent-soft), transparent 68%);
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}

.rotator {
  display: block;
  position: relative;
  height: 1.22em;
  margin-top: .06em;
}
.rotator .word {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--accent);
  opacity: 0;
  transform: translateY(.45em);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .9, .3, 1.1);
  will-change: opacity, transform;
}
.rotator .word.active { opacity: 1; transform: translateY(0); }

.hero-sub {
  max-width: 720px;
  margin: 26px auto 0;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: var(--text-2);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

/* ================= Buttons ================= */
.btn {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 2px solid var(--text);
  border-radius: 3px;
  color: var(--text);
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--text);
  transform: translateX(-101%);
  transition: transform .26s ease;
}
.btn:hover::before { transform: translateX(0); }
.btn:hover { color: var(--bg); }

.btn-solid {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn-solid::before { background: var(--accent-2); }
.btn-solid:hover { color: #fff; border-color: var(--accent-2); }

/* ================= Sections ================= */
.section { padding: 78px 0; }
.section-title {
  font-size: clamp(1.55rem, 3vw, 2rem);
  margin-bottom: 40px;
}

/* ================= Feature grid ================= */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  padding: 30px 24px 28px;
  border: 2px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 0 0 6px 6px;
  background: var(--bg);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border);
  border-top-color: var(--accent-2);
}
.card-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  color: var(--accent);
}
.card-icon svg { width: 100%; height: 100%; }
.card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
  transition: color .2s ease;
}
.card:hover h3 { color: var(--accent); }
.card p {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text-2);
}
.card .card-api {
  display: inline-block;
  margin-top: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  color: var(--accent);
  letter-spacing: .01em;
}

/* ================= Code section ================= */
.code-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.code-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
}

.terminal {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 22px 26px 28px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .28);
  overflow-x: auto;
}
.terminal-dots {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
}
.terminal-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}
.terminal-dots i:nth-child(1) { background: #ff5f57; }
.terminal-dots i:nth-child(2) { background: #febc2e; }
.terminal-dots i:nth-child(3) { background: #28c840; }

.terminal pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84rem;
  line-height: 1.85;
  color: #d6e5e3;
  white-space: pre;
}

.code-copy h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  margin-bottom: 18px;
}
.code-copy p {
  color: var(--text-2);
  margin-bottom: 16px;
  font-size: .96rem;
  line-height: 1.85;
}

/* ================= Quote ================= */
.quote {
  max-width: 900px;
  margin: 0 auto;
  padding: 84px 24px;
  text-align: center;
}
.quote-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.6rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 8px;
}
.quote-text {
  font-size: clamp(1.1rem, 2.3vw, 1.42rem);
  line-height: 1.85;
  margin-bottom: 30px;
  color: var(--text);
}
.quote-author {
  font-weight: 700;
  font-size: .98rem;
}
.quote-role {
  font-size: .86rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ================= Bottom banner ================= */
.bottom-banner {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 74px 0;
}
.banner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px;
}
.banner-grid h3 {
  font-size: 1.12rem;
  margin-bottom: 10px;
}
.banner-grid p {
  font-size: .92rem;
  color: var(--text-2);
  margin-bottom: 14px;
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.link-arrow:hover { border-bottom-color: var(--accent); }
.link-arrow svg { width: 13px; height: 13px; }

/* ================= Footer ================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 68px 0 34px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr);
  gap: 56px;
  margin-bottom: 56px;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.footer-col h4 {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-3);
  margin-bottom: 14px;
  font-weight: 700;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a {
  font-size: .9rem;
  color: var(--text-2);
  transition: color .18s ease;
}
.footer-col a:hover { color: var(--accent); }

.newsletter {
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 28px 26px;
}
.newsletter h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.newsletter p {
  font-size: .88rem;
  color: var(--text-2);
  margin-bottom: 18px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.footer-bottom .legal {
  max-width: 720px;
  font-size: .78rem;
  line-height: 1.8;
  color: var(--text-3);
}
.footer-bottom .legal a { color: var(--text-2); }
.footer-bottom .legal a:hover { color: var(--accent); }

.socials { display: flex; gap: 10px; }
.socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  transition: background-color .2s, transform .2s;
}
.socials a:hover { background: var(--accent); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; }

/* ================= Responsive ================= */
@media (max-width: 1040px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-top { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 860px) {
  .hamburger { display: flex; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 6px 24px 14px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links .theme-btn { margin: 14px 0 4px; }

  .banner-grid { grid-template-columns: 1fr; gap: 34px; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 68px 0 56px; }
  .section { padding: 58px 0; }
  .footer-cols { grid-template-columns: 1fr; }
  .terminal { padding: 18px 16px 22px; }
  .terminal pre { font-size: .76rem; }
}