:root {
  --bg-dark: #000000;
  --bg-dark-elev: #111216;
  --bg-light: #ffffff;
  --bg-gray: #f5f5f7;
  --ink-light: #f5f5f7;
  --ink-light-muted: #a1a1a6;
  --ink-dark: #1d1d1f;
  --ink-dark-muted: #6e6e73;
  --blue: #2997ff;
  --blue-deep: #0071e3;
  --green: #30d158;
  --amber: #ff9f0a;
  --red: #ff453a;
  --purple: #bf5af2;
  --line-dark: rgba(255, 255, 255, 0.12);
  --line-light: rgba(0, 0, 0, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --max: 1060px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-dark);
  color: var(--ink-light);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  overflow-x: hidden;
  line-height: 1.6;
}

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

button {
  font-family: inherit;
}

.wrap {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

.wrap.narrow {
  width: min(100% - 40px, 760px);
}

.center {
  text-align: center;
}

/* Sticky frosted navigation */
.localnav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(12, 13, 17, 0.78);
  border-bottom: 1px solid var(--line-dark);
}

.ln-inner {
  width: min(100% - 32px, var(--max));
  height: 54px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ln-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  margin-right: auto;
}

.ln-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  color: var(--ink-light-muted);
}

.ln-links a:hover {
  color: var(--ink-light);
}

.ln-lang {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  color: var(--ink-light-muted);
  transition: border-color .2s, color .2s;
}

.ln-lang:hover {
  border-color: rgba(255,255,255,0.35);
  color: var(--ink-light);
}

.ln-cta {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--blue-deep);
  color: #fff;
  transition: background .2s, transform .2s;
}

.ln-cta:hover {
  background: var(--blue);
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 64px 0 88px;
  background:
    radial-gradient(680px 360px at 50% 8%, rgba(41, 151, 255, 0.22), transparent 68%),
    radial-gradient(540px 320px at 78% 35%, rgba(48, 209, 88, 0.12), transparent 70%),
    var(--bg-dark);
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 22px;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.hero-title {
  margin: 0 auto 18px;
  max-width: 820px;
  font-size: clamp(34px, 6.2vw, 64px);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.hero-title .grad {
  background: linear-gradient(120deg, #ffffff 10%, #8cd3ff 55%, #5ce888 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 auto 30px;
  max-width: 650px;
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--ink-light-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

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

.btn-primary {
  background: var(--blue-deep);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--ink-light);
}

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

.hero-fine {
  margin: 0 0 42px;
  font-size: 13px;
  color: var(--ink-light-muted);
}

/* Terminal Simulator Window */
.term-shell {
  width: min(100%, 860px);
  margin-inline: auto;
  border-radius: 20px;
  background: #0d1017;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  text-align: left;
}

.term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 10px;
  flex-wrap: wrap;
}

.lights {
  display: inline-flex;
  gap: 7px;
}

.lights i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.lights i:nth-child(1) { background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }

.term-title {
  font-size: 12px;
  color: var(--ink-light-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.term-controls {
  display: flex;
  gap: 8px;
}

.chip-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-light);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}

.chip-btn.active,
.chip-btn:hover {
  background: rgba(41, 151, 255, 0.22);
  border-color: var(--blue);
}

.term-body {
  padding: 20px 22px 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  color: #e4e7ef;
  min-height: 292px;
}

.term-cmd {
  color: #8cd3ff;
  margin: 0 0 12px;
  word-break: break-all;
}

.term-line {
  margin: 4px 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .28s ease, transform .28s ease;
}

.term-line.show {
  opacity: 1;
  transform: none;
}

.tag-ok { color: var(--green); font-weight: 700; }
.tag-warn { color: var(--amber); font-weight: 700; }
.tag-red { color: var(--red); font-weight: 700; }
.tag-dim { color: #8c93a3; }

/* Sections */
.sec {
  padding: 88px 0;
}

.sec-black {
  background: var(--bg-dark);
  color: var(--ink-light);
}

.sec-white {
  background: var(--bg-light);
  color: var(--ink-dark);
}

.sec-gray {
  background: var(--bg-gray);
  color: var(--ink-dark);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow.blue { color: var(--blue-deep); }
.eyebrow.purple { color: #8944ab; }
.eyebrow.green { color: #198754; }
.eyebrow.on-dark { color: var(--blue); }

.sec-head {
  margin: 0 0 42px;
  font-size: clamp(28px, 4.5vw, 46px);
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.title {
  margin: 0 0 16px;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.14;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.lead {
  margin: 0 auto 44px;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-dark-muted);
}

.sec-black .lead {
  color: var(--ink-light-muted);
}

/* 3 Pillar Cards */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pillar {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-dark-elev);
  border: 1px solid var(--line-dark);
  transition: transform .2s ease, border-color .2s ease;
}

.pillar:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.28);
}

.pl-kicker {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-light-muted);
}

.pl-num {
  margin: 0 0 12px;
  font-size: 56px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.pl-num small {
  font-size: 22px;
  margin-left: 4px;
  font-weight: 650;
}

.pl-funnel .pl-num { color: var(--blue); }
.pl-speed .pl-num { color: var(--green); }
.pl-cost .pl-num { color: var(--purple); }

.pl-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.pl-text {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--ink-light-muted);
  flex: 1;
}

.pl-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}

/* Comparison Cards */
.nv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.nv-card {
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--line-light);
}

.nv-other {
  background: var(--bg-gray);
}

.nv-ours {
  background: linear-gradient(155deg, #0d1626 0%, #101d19 100%);
  color: #fff;
  border-color: rgba(41, 151, 255, 0.35);
}

.nv-head {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  opacity: 0.78;
}

.nv-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 11px;
  font-size: 16px;
}

.nv-big {
  margin: 0 0 18px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  font-weight: 750;
  color: #8cd3ff;
}

.nv-sub {
  margin: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.78);
}

/* Interactive 3-Segment Ping Explorer */
.seg-box {
  background: var(--bg-gray);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.seg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.seg-head h3 {
  margin: 0;
  font-size: 20px;
}

.seg-nodes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.seg-btn {
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line-light);
  background: #fff;
  color: var(--ink-dark);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

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

.seg-btn.active {
  border-color: var(--blue-deep);
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.14);
}

.seg-btn strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.seg-btn span {
  font-size: 13px;
  color: var(--ink-dark-muted);
}

.seg-detail {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  border: 1px solid var(--line-light);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.seg-detail small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-dark-muted);
  margin-bottom: 4px;
}

.seg-detail p {
  margin: 0;
  font-size: 14px;
  font-weight: 550;
}

/* Case Study Cards */
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.case-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--line-light);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.case-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.case-metric {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.case-metric del {
  font-size: 16px;
  color: #9b9ba0;
}

.case-metric strong {
  font-size: 32px;
  line-height: 1.1;
  color: #15803d;
}

.case-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.case-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-dark-muted);
}

/* Quick Start Tabs */
.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-dark);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--ink-light-muted);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.tab-btn.active {
  background: #fff;
  color: #000;
}

.tab-panel {
  display: none;
  background: var(--bg-dark-elev);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: left;
}

.tab-panel.active {
  display: block;
}

.step-block {
  margin-bottom: 22px;
}

.step-block:last-child {
  margin-bottom: 0;
}

.step-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 650;
}

.code-box {
  position: relative;
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #d6e4ff;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s, border-color .18s;
}

.copy-btn:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.copy-btn.copied {
  background: #198754;
  border-color: #198754;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.faq-item summary {
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--ink-dark-muted);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--ink-dark-muted);
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--ink-light-muted);
  border-top: 1px solid var(--line-dark);
  padding: 40px 0 56px;
  font-size: 13px;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

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

/* Reveal animation with safe fallback */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}

.js .reveal.visible,
.no-js .reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .term-line {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 860px) {
  .pillars, .nv, .seg-nodes, .seg-detail, .case-grid {
    grid-template-columns: 1fr;
  }
  .ln-links {
    display: none;
  }
  .sec {
    padding: 64px 0;
  }
  .hero {
    padding: 44px 0 64px;
  }
}
