/* ==========================================================================
   MATRIX 美翠克斯 — 精密数据仪器视觉
   ========================================================================== */

:root {
  --ink: #06090f;
  --ink-2: #0a0e17;
  --ink-3: #0e1420;
  --ink-4: #0b111e;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #e7ecf5;
  --muted: #8a93a6;
  --faint: #5c6474;
  --signal: #00e676;
  --green-deep: #00c853;
  --live: #e9fff4;

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo,
    Consolas, monospace;

  --container: 1120px;
  --pad: clamp(20px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: rgba(0, 230, 118, 0.25);
  color: #fff;
}

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

ul {
  list-style: none;
}

/* --------------------------------------------------------------------------
   滚动进度条
   -------------------------------------------------------------------------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  background: linear-gradient(90deg, var(--signal), var(--green-deep));
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   连续坐标网格（整页底纹，呼应 GIS / 矩阵）
   -------------------------------------------------------------------------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 40%, transparent 100%);
}

.rail-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   容器与区块骨架
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.section {
  position: relative;
  z-index: 1;
  padding: clamp(88px, 11vw, 148px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-title {
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--text);
}

.section-note,
.section-desc {
  color: var(--muted);
}

.section-note {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
}

.section-desc {
  margin-top: 16px;
  font-size: clamp(16px, 1.6vw, 18px);
  max-width: 560px;
}

/* --------------------------------------------------------------------------
   滚动显隐（配合 JS，no-js 时内容始终可见）
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}

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

/* --------------------------------------------------------------------------
   导航
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color 0.35s ease, border-color 0.35s ease,
    backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(6, 9, 15, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: block;
  overflow: visible;
}

.brand-path {
  fill: none;
  stroke: url(#brandGrad);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-node {
  fill: var(--signal);
}

.brand-node-live {
  fill: var(--live);
  filter: drop-shadow(0 0 4px rgba(233, 255, 244, 0.8));
}

.brand-word {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
}

.brand-word .letter {
  display: inline-block;
  animation: letter-drop 1.5s var(--ease) both;
}

.brand-word .letter:nth-child(1) { animation-delay: 0s; }
.brand-word .letter:nth-child(2) { animation-delay: 0.09s; }
.brand-word .letter:nth-child(3) { animation-delay: 0.18s; }
.brand-word .letter:nth-child(4) { animation-delay: 0.27s; }
.brand-word .letter:nth-child(5) { animation-delay: 0.36s; }
.brand-word .letter:nth-child(6) { animation-delay: 0.45s; }

@keyframes letter-drop {
  0% {
    opacity: 0;
    transform: translateY(-14px);
    color: var(--live);
  }
  55% {
    opacity: 1;
    transform: translateY(0);
    color: var(--signal);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    color: var(--text);
  }
}

.brand-word::after {
  content: "";
  display: inline-block;
  width: 0.3em;
  height: 0.72em;
  margin-left: 0.14em;
  background: var(--signal);
  vertical-align: baseline;
  animation: brand-blink 1.2s linear infinite;
}

@keyframes brand-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.25s var(--ease);
}

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

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
}

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

.nav-toggle.open span:nth-child(1) {
  transform: translateY(3.25px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0.02em;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--signal), var(--green-deep));
  color: #04121a;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.18),
    0 12px 34px -12px rgba(0, 230, 118, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.28),
    0 16px 40px -12px rgba(0, 200, 83, 0.6);
}

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

.btn-ghost:hover {
  border-color: var(--signal);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-contours {
  position: absolute;
  top: -18%;
  right: -12%;
  width: 64vw;
  height: 64vw;
  max-width: 900px;
  max-height: 900px;
  z-index: 0;
  border-radius: 50%;
  background-image: repeating-radial-gradient(
    circle at 50% 50%,
    rgba(0, 230, 118, 0.055) 0px,
    rgba(0, 230, 118, 0.055) 1px,
    transparent 1px,
    transparent 22px
  );
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 72%);
  mask-image: radial-gradient(circle, #000 30%, transparent 72%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 120px var(--pad) 96px;
  animation: hero-rise 0.9s var(--ease) both;
}

.hero-kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--signal);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(16px, 1.9vw, 19px);
  line-height: 1.75;
  max-width: 540px;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-coord {
  position: absolute;
  left: var(--pad);
  bottom: 28px;
  z-index: 1;
  display: flex;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   光标聚光卡片
   -------------------------------------------------------------------------- */
.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(0, 230, 118, 0.09),
    transparent 62%
  );
  pointer-events: none;
  z-index: 0;
}

.spotlight:hover::before {
  opacity: 1;
}

.spotlight > * {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   客户类型
   -------------------------------------------------------------------------- */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.client {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

.client:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.client-glyph {
  width: 32px;
  height: 32px;
}

.client span {
  font-size: 15px;
  color: var(--text);
  font-weight: 550;
}

/* --------------------------------------------------------------------------
   核心服务卡片
   -------------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  padding: 36px 34px;
  background: var(--ink-2);
  transition: background-color 0.25s ease;
}

.card:hover {
  background: var(--ink-3);
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(0, 230, 118, 0.06), rgba(0, 200, 83, 0.04));
}

.card-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.card h3 {
  font-size: 19px;
  font-weight: 620;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   配图（插画）容器
   -------------------------------------------------------------------------- */
.media,
.case-media {
  position: relative;
  overflow: hidden;
  background: var(--ink-4);
}

.media {
  aspect-ratio: 16 / 10;
  margin: -1px -1px 24px;
  border-radius: 11px 11px 0 0;
}

.case-media {
  aspect-ratio: 16 / 9;
  margin-bottom: 24px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.media svg,
.case-media svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--ease);
}

.case:hover .case-media svg,
.data-item:hover .media svg {
  transform: scale(1.045);
}

/* --------------------------------------------------------------------------
   大数据能力
   -------------------------------------------------------------------------- */
.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.data-item {
  padding: 0 28px 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
}

.data-index {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--live);
  padding: 3px 9px;
  border: 1px solid rgba(233, 255, 244, 0.3);
  border-radius: 4px;
  margin-bottom: 20px;
}

.data-item h3 {
  font-size: 22px;
  font-weight: 640;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.data-item p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 22px;
}

.data-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-tags li {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 10px;
}

/* --------------------------------------------------------------------------
   案例
   -------------------------------------------------------------------------- */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.case {
  padding: 16px 16px 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
  transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

.case:hover {
  border-color: var(--line-strong);
}

.case-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--signal);
  margin: 8px 16px 14px;
}

.case h3 {
  font-size: 19px;
  font-weight: 620;
  margin: 0 16px 12px;
  letter-spacing: -0.01em;
}

.case p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 16px;
}

/* --------------------------------------------------------------------------
   使命愿景价值观
   -------------------------------------------------------------------------- */
.about .container {
  max-width: 1280px;
}

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

.mvv {
  padding: 34px 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink-2);
}

.mvv h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.mvv p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand .brand-word {
  font-size: 14px;
}

.footer-cn {
  color: var(--faint);
  font-size: 13px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--faint);
  flex-wrap: wrap;
}

.footer-meta a {
  color: var(--signal);
}

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

.footer-meta sup {
  font-size: 0.62em;
  letter-spacing: 0.02em;
  color: var(--signal);
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .data-grid {
    grid-template-columns: 1fr;
  }
  .cases-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(6, 9, 15, 0.96);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 20px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    display: block;
    padding: 14px 0;
    width: 100%;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }
  .nav-toggle {
    display: flex;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
  .mvv-grid {
    grid-template-columns: 1fr;
  }
  .mvv p {
    white-space: normal;
  }
  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .hero-coord {
    gap: 16px;
  }
}

/* --------------------------------------------------------------------------
   减少动效偏好
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-content {
    animation: none;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
  .brand-word .letter {
    animation: letter-drop 1.5s var(--ease) both !important;
  }
  .brand-word::after {
    animation: brand-blink 1.2s linear infinite !important;
  }
}
