/* SwiftSpeed — design tokens */
:root {
  --bg: #0a0d14;
  --bg-elevated: #0f141f;
  --surface: rgba(20, 26, 39, 0.72);
  --surface-solid: #141a27;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.24);
  --text: #e8ecf4;
  --text-dim: #8b95a8;
  --text-faint: #5c6678;
  --accent: #22d3ee;
  --accent-2: #2dd4a7;
  --green: #34d399;
  --amber: #f59e0b;
  --red: #f87171;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

body::before {
  /* subtle instrument-grid backdrop */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 50% -180px, rgba(34, 211, 238, 0.07), transparent 65%),
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
}

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

button {
  font-family: inherit;
}

/* ---------------- nav ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 13, 20, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px clamp(18px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}

.brand-logo {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 26px;
  font-size: 14px;
}

.nav-links a {
  color: var(--text-dim);
  transition: color 0.18s ease;
}

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

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

.lang-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.lang-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(148, 163, 184, 0.1);
}

.net-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
  max-width: 44vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex: none;
}

/* ---------------- hero ---------------- */

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(72px, 11vw, 132px) clamp(18px, 4vw, 40px) clamp(48px, 6vw, 80px);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.4px;
  margin-bottom: 26px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.hero-title {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 560px;
  margin: 22px auto 0;
  font-size: 16px;
  color: var(--text-dim);
}

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

.hero-trust {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.22s ease,
    border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  user-select: none;
}

.btn-primary {
  color: #04121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 24px rgba(34, 211, 238, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 32px rgba(34, 211, 238, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  color: var(--text-dim);
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.05);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(148, 163, 184, 0.1);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-start {
  min-width: 180px;
  padding: 14px 34px;
  font-size: 15px;
}

.btn-start.running .start-icon {
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------- console ---------------- */

.console {
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 20, 0.5);
  flex-wrap: wrap;
}

.console-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.console-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.console-dot.live {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.console-dot.done {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.console-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.console-body {
  padding: clamp(22px, 4vw, 36px);
}

.phase-track {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 3vw, 28px);
  margin-bottom: 20px;
}

.phase {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--font-mono);
  transition: all 0.25s ease;
}

.phase-num {
  opacity: 0.6;
}

.phase.active {
  color: var(--accent);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.07);
}

.phase.done {
  color: var(--green);
}

/* ---------------- gauge ---------------- */

.gauge-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.gauge {
  width: min(280px, 74vw);
  height: min(280px, 74vw);
}

.gauge-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.12);
  stroke-width: 13;
}

.gauge-value {
  fill: none;
  stroke: url(#gaugeGrad);
  stroke-width: 13;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 140px 140px;
  transition: stroke-dashoffset 0.16s linear;
}

.gauge-glow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 13;
  opacity: 0;
  filter: blur(9px);
  transition: opacity 0.3s ease;
}

.gauge-wrap.measuring .gauge-glow {
  opacity: 0.4;
  animation: gauge-pulse 1.5s ease-in-out infinite;
}

@keyframes gauge-pulse {
  0%,
  100% {
    opacity: 0.22;
  }
  50% {
    opacity: 0.5;
  }
}

.gauge-speed {
  font-size: 46px;
  font-weight: 700;
  fill: var(--text);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.gauge-unit {
  font-size: 13px;
  fill: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.gauge-label {
  font-size: 13px;
  fill: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.console-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

/* ---------------- quick stats ---------------- */

.quick-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 26px;
}

.quick-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 13px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 13, 20, 0.4);
}

.qs-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.qs-value {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------------- chart ---------------- */

.chart-panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px 12px;
  background: rgba(10, 13, 20, 0.35);
}

.chart-head {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.legend-dot.down {
  background: var(--accent);
}

.legend-dot.up {
  background: var(--green);
}

.chart-unit {
  margin-left: auto;
  color: var(--text-faint);
}

.chart-panel canvas {
  width: 100%;
  height: 200px;
  display: block;
}

/* ---------------- results ---------------- */

.results {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.results-head h2 {
  font-size: 15px;
  font-weight: 700;
}

.grade {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.grade.excellent {
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.grade.good {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.grade.fair {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.grade.poor {
  color: var(--red);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 13, 20, 0.4);
}

.rc-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.rc-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.rc-unit {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.rc-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 5px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ---------------- history ---------------- */

.history {
  margin-top: 24px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-tip {
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
  padding: 12px 0;
  font-family: var(--font-mono);
}

.history-item {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 13, 20, 0.35);
  font-size: 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.history-item .hi-time {
  color: var(--text-dim);
  font-size: 11px;
}

.history-item .hi-val {
  font-weight: 600;
  color: var(--text);
}

.history-item .hi-val.dim {
  color: var(--text-dim);
  font-weight: 400;
}

.hi-grade {
  color: var(--accent);
}

/* ---------------- sections ---------------- */

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) clamp(18px, 4vw, 40px) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(34px, 5vw, 56px);
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-kicker {
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* ---------------- features ---------------- */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

.feature {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.feature-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 1px;
}

.feature h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 10px 0 8px;
}

.feature p {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 440px;
}

/* ---------------- stats band ---------------- */

.stats-band {
  max-width: 1120px;
  margin: clamp(56px, 8vw, 90px) auto 0;
  padding: clamp(28px, 4vw, 44px) clamp(18px, 4vw, 40px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.stat-num {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--text), var(--text-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ---------------- how ---------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 40px;
  position: relative;
}

.steps::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--line);
}

.step {
  position: relative;
  padding-top: 46px;
}

.step-num {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.step h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--text-dim);
}

/* ---------------- faq ---------------- */

.faq {
  padding-bottom: clamp(72px, 10vw, 110px);
}

.faq-list {
  max-width: 760px;
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: color 0.18s ease;
}

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

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-dim);
  transition: transform 0.2s var(--ease-out), color 0.18s ease;
  flex: none;
}

.faq-item[open] summary {
  color: var(--accent);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--accent);
}

.faq-item p {
  padding: 0 0 18px;
  font-size: 14px;
  color: var(--text-dim);
  max-width: 640px;
}

/* ---------------- footer ---------------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(18px, 4vw, 40px) 34px;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.footer-brand {
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ---------------- reveal ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------------- responsive ---------------- */

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

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .steps::before {
    display: none;
  }

  .step {
    padding-top: 0;
    padding-left: 52px;
  }

  .stats-band {
    grid-template-columns: repeat(2, 1fr);
    gap: 26px 20px;
  }
}

@media (max-width: 640px) {
  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-stat:last-child {
    grid-column: 1 / -1;
  }

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

  .history-item {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

  .history-item .hi-time {
    grid-column: 1 / -1;
  }

  .console-meta {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 420px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

/* ---------------- reduced motion ---------------- */

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gauge-wrap.measuring .gauge-glow,
  .console-dot.live {
    animation: none;
  }

  .btn,
  .btn-primary:hover {
    transform: none;
  }
}
