/*
  Nexus System Template
  https://templatemo.com/tm-629-nexus-system
*/

:root {
  --titanium: #F4F5F6; /* brushed titanium, cool metallic light grey */
  --carbon: #0D0E15; /* carbon matte, deep light-absorbing dark */
  --volt: #D1FF00; /* acid volt, electric neon accent */
  --steel: #D9E0E4; /* muted steel lines and borders */
  --graphite: #1A1D1A; /* deep graphite grey with a whisper of green */
  --white: #FFFFFF;
  --hud-h: 60px;
  --ease-silk: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: auto; }

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
  background: var(--titanium);
  color: var(--carbon);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

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

button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }

.mono { font-family: 'JetBrains Mono', monospace; }

/* ---------- scroll spacer creates the 500vh track (five cards) ---------- */
.scroll-spacer { height: 500vh; }

/* ---------- z-depth card engine ---------- */
.zcard {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  transform-origin: top center;
  will-change: transform, opacity;
  overflow: hidden;
}

.zcard[data-card="1"] { z-index: 10; }
.zcard[data-card="2"] { z-index: 20; transform: translateY(100%); }
.zcard[data-card="3"] { z-index: 30; transform: translateY(100%); }
.zcard[data-card="4"] { z-index: 40; transform: translateY(100%); }
.zcard[data-card="5"] { z-index: 50; transform: translateY(100%); }

/* ---------- card 1: the floating hero ---------- */
.card-hero {
  background: var(--titanium);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-stage {
  position: relative;
  text-align: center;
  z-index: 5;
  padding: 0 24px;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--carbon);
  background: var(--volt);
  display: inline-block;
  padding: 7px 14px 7px 18px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(56px, 13vw, 180px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--carbon);
}

.hero-sub {
  margin: 32px auto 0;
  max-width: 480px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: #4B515C;
}

.hero-scroll-hint {
  position: absolute;
  bottom: calc(var(--hud-h) + 28px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #6A7077;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-scroll-hint::after {
  content: "";
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--carbon), transparent);
  animation: hint-drop 2.2s var(--ease-silk) infinite;
}

@keyframes hint-drop {
  0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  56% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* floating translucent glass shapes */
.glass-shape {
  position: absolute;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--steel);
  z-index: 2;
}

.glass-a {
  width: 220px;
  height: 220px;
  top: 12%;
  left: 8%;
  border-radius: 32px;
  animation: bob-a 9s ease-in-out infinite;
}

.glass-b {
  width: 150px;
  height: 150px;
  bottom: 18%;
  right: 10%;
  border-radius: 50%;
  animation: bob-b 7s ease-in-out infinite;
}

.glass-c {
  width: 110px;
  height: 110px;
  top: 20%;
  right: 22%;
  border-radius: 20px;
  transform: rotate(18deg);
  animation: bob-c 11s ease-in-out infinite;
}

@keyframes bob-a {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-26px); }
}

@keyframes bob-b {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(22px); }
}

@keyframes bob-c {
  0%, 100% { transform: translateY(0) rotate(18deg); }
  50% { transform: translateY(-18px) rotate(24deg); }
}

/* faint engineering grid behind the hero */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--steel) 1px, transparent 1px), linear-gradient(90deg, var(--steel) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.35;
  z-index: 1;
}

/* ---------- card 2: the engineered image overlay ---------- */
.card-macro { background: var(--carbon); }

.macro-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.macro-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13, 14, 21, 0.25), rgba(13, 14, 21, 0.05) 40%, rgba(13, 14, 21, 0.35));
}

.crosshair-v, .crosshair-h { position: absolute; background: rgba(255, 255, 255, 0.4); }

.crosshair-v { top: 0; bottom: 0; left: 62%; width: 1px; }

.crosshair-h { left: 0; right: 0; top: 40%; height: 1px; }

.node-dot {
  position: absolute;
  left: 62%;
  top: 40%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--volt);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 6px rgba(209, 255, 0, 0.25), 0 0 24px 4px rgba(209, 255, 0, 0.8);
  animation: node-pulse 2.6s ease-in-out infinite;
}

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(209, 255, 0, 0.25), 0 0 24px 4px rgba(209, 255, 0, 0.8); }
  50% { box-shadow: 0 0 0 12px rgba(209, 255, 0, 0.12), 0 0 36px 8px rgba(209, 255, 0, 0.95); }
}

.node-box {
  position: absolute;
  left: calc(62% + 28px);
  top: calc(40% + 28px);
  width: 280px;
  max-width: calc(100vw - 48px);
  background: rgba(13, 14, 21, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(217, 224, 228, 0.3);
  color: var(--titanium);
  padding: 20px;
}

.node-box-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--volt);
  margin-bottom: 14px;
}

.node-stat {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(217, 224, 228, 0.15);
}

.node-stat:last-child { border-bottom: none; }

.node-stat span:last-child { color: #E3FF7A; }

.macro-caption {
  position: absolute;
  left: 40px;
  bottom: calc(var(--hud-h) + 36px);
  color: var(--titanium);
  max-width: 420px;
}

.macro-caption .mono {
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: #E3FF7A;
  display: block;
  margin-bottom: 14px;
}

.macro-caption h2 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* ---------- card 3: the kinetic accordion fold ---------- */
.card-fold { background: var(--white); display: flex; flex-direction: column; }

.fold-head {
  padding: 28px 40px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.fold-head h2 { font-size: clamp(22px, 3vw, 34px); font-weight: 700; letter-spacing: -0.02em; }

.fold-head .mono { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: #6A7077; }

.accordion {
  flex: 1;
  display: flex;
  width: 100%;
  margin-top: 24px;
  border-top: 1px solid var(--steel);
}

.slice {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--steel);
  background: var(--white);
  transition: flex-grow 1.2s var(--ease-silk);
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.slice:last-child { border-right: none; }

.slice.active { flex-grow: 3.7; }

.slice-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.2s var(--ease-silk), transform 1.2s var(--ease-silk);
}

.slice.active .slice-img { opacity: 1; transform: scale(1); }

.slice-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 14, 21, 0.75), rgba(13, 14, 21, 0) 55%);
  opacity: 0;
  transition: opacity 1.2s var(--ease-silk);
}

.slice.active .slice-shade { opacity: 1; }

.slice-idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 0 calc(var(--hud-h) + 28px);
  align-items: center;
  transition: opacity 0.6s var(--ease-silk);
}

.slice.active .slice-idle { opacity: 0; }

.slice-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--carbon);
  letter-spacing: 0.2em;
}

.slice-idle-title {
  writing-mode: vertical-rl;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--carbon);
}

.slice-reveal {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: calc(var(--hud-h) + 28px);
  color: var(--titanium);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s var(--ease-silk), transform 1.2s var(--ease-silk);
}

.slice.active .slice-reveal { opacity: 1; transform: translateY(0); }

.slice-reveal .mono {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #E3FF7A;
  display: block;
  margin-bottom: 10px;
}

.slice-reveal h3 { font-size: clamp(20px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; white-space: nowrap; }

.slice-reveal p { font-size: 14px; line-height: 1.6; max-width: 380px; color: rgba(244, 245, 246, 0.85); }

.slice:focus-visible { outline: 2px solid var(--carbon); outline-offset: -2px; }

/* ---------- card 4: the matrix tabs and signature ---------- */
.card-matrix {
  background: var(--graphite);
  color: var(--titanium);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.matrix-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px clamp(28px, 5vw, 80px) calc(var(--hud-h) + 40px);
}

.matrix-left .mono-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--volt);
  margin-bottom: 20px;
}

.matrix-left h2 {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 40px;
}

.matrix-tab {
  display: block;
  width: 100%;
  text-align: left;
  padding: 22px 24px;
  border-left: 2px solid rgba(217, 224, 228, 0.2);
  transition: border-color 0.5s var(--ease-silk), background 0.5s var(--ease-silk);
}

.matrix-tab .tab-line {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.matrix-tab .tab-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #6A7077;
  transition: color 0.5s var(--ease-silk);
}

.matrix-tab .tab-name {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(244, 245, 246, 0.55);
  transition: color 0.5s var(--ease-silk);
}

.matrix-tab p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(244, 245, 246, 0.6);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s var(--ease-silk), opacity 0.7s var(--ease-silk);
}

.matrix-tab.active {
  border-left-color: var(--volt);
  background: rgba(209, 255, 0, 0.08);
}

.matrix-tab.active .tab-num { color: var(--volt); }

.matrix-tab.active .tab-name { color: var(--titanium); }

.matrix-tab.active p { max-height: 120px; opacity: 1; }

.matrix-tab:focus-visible { outline: 2px solid var(--volt); outline-offset: -2px; }

.matrix-right { position: relative; overflow: hidden; }

.matrix-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1s var(--ease-silk), transform 1.4s var(--ease-silk);
}

.matrix-img.active { opacity: 1; transform: scale(1); }

.matrix-img-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(26, 29, 26, 0.55), rgba(26, 29, 26, 0) 45%);
  pointer-events: none;
}

.matrix-caption {
  position: absolute;
  right: 28px;
  bottom: calc(var(--hud-h) + 24px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--titanium);
  background: rgba(26, 29, 26, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(217, 224, 228, 0.25);
  padding: 10px 16px;
}

/* ---------- the permanent hud signature bar ---------- */
.hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--hud-h);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(20px, 4vw, 40px);
  background: rgba(244, 245, 246, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--steel);
}

.hud-brand {
  font-weight: 300;
  letter-spacing: 0.22em;
  font-size: 13px;
  color: var(--carbon);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.hud-brand .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 0 1px rgba(13, 14, 21, 0.35);
}

/* 底栏品牌 logo：按 svg 原始比例 92.1:82.31 缩放，垂直居中 */
.hud-brand .hud-logo {
  width: auto;
  height: 25px;
  display: block;
  object-fit: contain;
  flex: none;
}

.hud-credit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #6A7077;
  white-space: nowrap;
}

.hud-credit a { color: var(--carbon); border-bottom: 1px solid var(--volt); padding-bottom: 1px; }

.hud-progress {
  flex: 1;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-track {
  flex: 1;
  height: 2px;
  background: var(--steel);
  position: relative;
  overflow: hidden;
}

.hud-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--volt);
}

.hud-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--carbon);
  min-width: 44px;
  text-align: right;
}

.hud-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 20px;
  border-left: 1px solid var(--steel);
}

.hud-arrow {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--steel);
  background: var(--white);
  color: var(--carbon);
  transition: background 0.4s var(--ease-silk), border-color 0.4s var(--ease-silk), color 0.4s var(--ease-silk), opacity 0.4s var(--ease-silk);
}

.hud-arrow svg { width: 14px; height: 14px; display: block; }

.hud-arrow:hover:not(:disabled) {
  background: var(--volt);
  border-color: var(--carbon);
  color: var(--carbon);
}

.hud-arrow:disabled { opacity: 0.3; cursor: default; }

.hud-arrow:focus-visible { outline: 2px solid var(--carbon); outline-offset: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .glass-a { width: 140px; height: 140px; left: 4%; }
  .glass-b { width: 100px; height: 100px; right: 6%; }
  .glass-c { width: 80px; height: 80px; right: 12%; }
  .crosshair-v { left: 50%; }
  .node-dot { left: 50%; }
  .node-box { left: 24px; right: 24px; width: auto; top: calc(40% + 28px); }
  .macro-caption { left: 24px; right: 24px; }
  .accordion { flex-direction: column; }
  .slice { border-right: none; border-bottom: 1px solid var(--steel); }
  .slice:last-child { border-bottom: none; }
  .slice-idle { flex-direction: row; align-items: center; justify-content: space-between; padding: 0 24px; }
  .slice-idle-title { writing-mode: horizontal-tb; letter-spacing: 0.08em; }
  .slice-reveal { left: 24px; right: 24px; bottom: 20px; }
  .slice-reveal h3 { white-space: normal; }
  .fold-head { padding: 20px 24px 0; flex-direction: column; gap: 6px; }
  .accordion { margin-top: 16px; }
  .card-matrix { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .matrix-left { padding: 40px 24px 24px; justify-content: flex-start; }
  .matrix-left h2 { margin-bottom: 20px; }
  .matrix-tab { padding: 14px 16px; }
  .matrix-caption { right: 16px; bottom: calc(var(--hud-h) + 16px); }
  .matrix-axes { grid-template-columns: 1fr; gap: 8px; margin-bottom: 14px; }
  .matrix-intersection { margin-bottom: 16px; padding: 12px 14px; font-size: 12px; }
  .formula-term { font-size: 12px; padding: 8px 12px; box-shadow: 3px 3px 0 rgba(13, 14, 21, 0.12); }
  .formula-label { font-size: 10px; }
  .matrix-formula-note { font-size: 12px; }
  .hud-credit { display: none; }
  .hud-pct { display: none; }
  /* fabric card responsive */
  .card-fabric { padding: 24px 16px calc(var(--hud-h) + 24px); }
  .fabric-layer { grid-template-columns: 1fr; gap: 8px; }
  .fabric-layer::before { display: none; }
  .layer-label { padding: 10px 12px; }
  .layer-nodes { grid-template-columns: repeat(2, 1fr); }
  .fabric-layer[data-layer="app"] .layer-nodes { grid-template-columns: repeat(2, 1fr); }
  .fabric-detail {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "title" "desc" "state" "metrics";
    gap: 10px;
  }
  .detail-metrics { gap: 18px; }
  .metric { text-align: left; }
}

@media (max-height: 540px) {
  .hero-title { font-size: clamp(40px, 10vh, 90px); }
  .hero-sub { display: none; }
  .matrix-tab p { display: none; }
}

/* ---------- hero pills (Mchoy capability tags) ---------- */
.hero-pills {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.hero-pill {
  font-family: 'JetBrains Mono', 'Noto Sans SC', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  border: 1px solid var(--carbon);
  color: var(--carbon);
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.4s var(--ease-silk), color 0.4s var(--ease-silk), box-shadow 0.4s var(--ease-silk);
}

.hero-pill:hover {
  background: var(--volt);
  box-shadow: 4px 4px 0 var(--carbon);
}

.hero-sub strong { font-weight: 700; background: var(--volt); padding: 0 4px; color: var(--carbon); }

/* ---------- card 5: service fabric ---------- */
.card-fabric {
  position: relative;
  background: var(--carbon);
  color: var(--titanium);
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 5vh, 56px) clamp(24px, 5vw, 72px) calc(var(--hud-h) + 32px);
  overflow-y: auto;
  overflow-x: clip; /* 视频圆角裁切跟随卡片，同时保留内部纵向滚动（替代 overflow:hidden） */
}

/* card 5 视频背景层：铺满卡片、置于最底层、点击穿透，不影响原有内容交互 */
.fabric-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 铺满卡片，不变形 */
  z-index: 0;             /* 最底层 */
  pointer-events: none;   /* 点击可穿透，不影响按钮/文字 */
  opacity: 0.55;          /* 降低亮度，保证前景文字可读 */
}

/* 原有内容抬升到视频之上（含详情面板 fabric-detail） */
.card-fabric .fabric-head,
.card-fabric .fabric-stack,
.card-fabric .fabric-detail {
  position: relative;
  z-index: 1;
}

/* 用户偏好减少动态效果时暂停背景视频 */
@media (prefers-reduced-motion: reduce) {
  .fabric-bg-video { display: none; }
}

.fabric-head { margin-bottom: clamp(16px, 3vh, 30px); }

.fabric-head .mono-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--volt);
  margin-bottom: 12px;
}

.fabric-head h2 {
  font-size: clamp(24px, 3.4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.fabric-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.fabric-layer {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 14px;
  align-items: stretch;
  position: relative;
}

.fabric-layer::before {
  content: "";
  position: absolute;
  left: 175px;
  right: 0;
  top: -5px;
  height: 1px;
  background: linear-gradient(90deg, rgba(209,255,0,0.5), transparent);
}

.fabric-layer:first-child::before { display: none; }

.layer-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border: 1px solid rgba(217, 224, 228, 0.22);
  background: rgba(244, 245, 246, 0.05);
}

.layer-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--carbon);
  background: var(--volt);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.layer-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.layer-name em {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: #8A9099;
  text-transform: uppercase;
}

.layer-nodes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.fabric-layer[data-layer="app"] .layer-nodes { grid-template-columns: repeat(3, 1fr); }

.svc-node {
  position: relative;
  text-align: left;
  padding: 14px 14px 12px 38px;
  border: 1px solid rgba(217, 224, 228, 0.2);
  background: rgba(244, 245, 246, 0.04);
  color: var(--titanium);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.4s var(--ease-silk), background 0.4s var(--ease-silk), transform 0.4s var(--ease-silk);
}

.svc-node:hover {
  border-color: var(--volt);
  background: rgba(209, 255, 0, 0.1);
  transform: translateY(-2px);
}

.svc-node.active {
  border-color: var(--volt);
  background: rgba(209, 255, 0, 0.14);
  box-shadow: inset 3px 0 0 var(--volt);
}

.svc-node .svc-status {
  position: absolute;
  left: 14px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 0 3px rgba(209, 255, 0, 0.18);
  animation: svc-heartbeat 2.4s ease-in-out infinite;
}

.node-core .svc-status { background: #7CF9FF; box-shadow: 0 0 0 3px rgba(124, 249, 255, 0.18); }

@keyframes svc-heartbeat {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.svc-node { font-size: 14px; font-weight: 600; }

.svc-node small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #8A9099;
  text-transform: uppercase;
}

/* fabric detail console */
.fabric-detail {
  margin-top: 14px;
  border: 1px solid rgba(217, 224, 228, 0.25);
  background: linear-gradient(135deg, rgba(209, 255, 0, 0.07), rgba(244, 245, 246, 0.03));
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "head state"
    "title metrics"
    "desc metrics";
  gap: 6px 28px;
  align-items: center;
}

.detail-head { grid-area: head; display: flex; align-items: center; gap: 16px; }

.detail-head .mono {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--volt);
}

.detail-state {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-area: state;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--volt);
}

.detail-state .svc-status { position: static; animation: svc-heartbeat 2.4s ease-in-out infinite; }

.fabric-detail h3 { grid-area: title; font-size: clamp(18px, 2vw, 24px); font-weight: 700; }

.fabric-detail p { grid-area: desc; font-size: 13px; line-height: 1.6; color: rgba(244, 245, 246, 0.72); max-width: 560px; }

.detail-metrics {
  grid-area: metrics;
  display: flex;
  gap: 26px;
}

.metric { display: flex; flex-direction: column; gap: 4px; text-align: right; }

.metric span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #8A9099;
  text-transform: uppercase;
}

.metric strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--volt);
}

/* ---------- static top bar (scrolls away, not viewport-fixed) ---------- */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60; /* above the fixed hero card (z-index:10), below later cards as you scroll */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
  pointer-events: none; /* let scroll/drag pass through empty areas */
}

.top-bar > a,
.top-bar .top-actions { pointer-events: auto; }

/* right-side action cluster: language switcher + GitHub */
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- language switcher ---------- */
.lang-switch {
  position: relative;
  display: inline-block;
}

.lang-toggle {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--carbon);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--steel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.4s var(--ease-silk), border-color 0.4s var(--ease-silk),
    transform 0.4s var(--ease-silk), box-shadow 0.4s var(--ease-silk);
}

.lang-toggle svg { width: 20px; height: 20px; display: block; }

.lang-toggle:hover {
  background: var(--volt);
  border-color: var(--carbon);
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 rgba(13, 14, 21, 0.25);
}

.lang-toggle:focus-visible { outline: 2px solid var(--carbon); outline-offset: 2px; }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 168px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--steel);
  box-shadow: 0 14px 34px rgba(13, 14, 21, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease-silk), transform 0.3s var(--ease-silk), visibility 0.3s;
  z-index: 10001;
}

.lang-switch.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--carbon);
  white-space: nowrap;
  transition: background 0.25s var(--ease-silk);
}

.lang-menu a:hover { background: var(--volt); }

.lang-menu .lang-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #6A7077;
  letter-spacing: 0.08em;
}

.lang-menu a.is-active {
  background: rgba(209, 255, 0, 0.35);
  font-weight: 700;
}

.lang-menu a.is-active .lang-code::after { content: " ✓"; color: var(--carbon); }

/* ---------- top-left brand logo (borderless) ---------- */
.brand-logo {
  display: flex;
  align-items: center;
  padding: 0;
  background: none;
  border: none;
  transition: transform 0.4s var(--ease-silk), opacity 0.4s var(--ease-silk);
}

.brand-logo img {
  /* 按 svg 原生宽高比 221.52:45.17 等比缩放 */
  height: 60px;
  width: auto;
  display: block;
}

.brand-logo:hover {
  transform: translateY(-2px);
  opacity: 0.82;
}

.brand-logo:focus-visible {
  outline: 2px solid var(--carbon);
  outline-offset: 4px;
}

/* ---------- top-right GitHub link (inside static top bar) ---------- */
.github-link {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--carbon);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--steel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.4s var(--ease-silk), color 0.4s var(--ease-silk),
    border-color 0.4s var(--ease-silk), transform 0.4s var(--ease-silk),
    box-shadow 0.4s var(--ease-silk);
}

.github-link svg {
  width: 20px;
  height: 20px;
  display: block;
}

.github-link:hover {
  background: var(--volt);
  border-color: var(--carbon);
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 rgba(13, 14, 21, 0.25);
}

.github-link:focus-visible {
  outline: 2px solid var(--carbon);
  outline-offset: 2px;
}

/* on dark cards the light chip stays readable; invert subtly while hovering dark zones */
@media (max-width: 900px) {
  .top-bar {
    padding: 12px 16px;
  }

  .top-actions { gap: 8px; }

  .github-link,
  .lang-toggle {
    width: 38px;
    height: 38px;
  }

  .github-link svg,
  .lang-toggle svg {
    width: 18px;
    height: 18px;
  }

  .lang-menu { min-width: 150px; }

  .brand-logo img {
    height: 44px;
  }
}

/* ---------- Arabic RTL support ---------- */
html[dir="rtl"] {
  text-align: right;
}

html[dir="rtl"] .top-bar { flex-direction: row-reverse; }

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
  text-align: right;
}

html[dir="rtl"] .fold-head { flex-direction: row-reverse; }

html[dir="rtl"] .matrix-left,
html[dir="rtl"] .fabric-detail,
html[dir="rtl"] .detail-head { text-align: right; }

html[dir="rtl"] .matrix-tab {
  border-left: none;
  border-right: 2px solid rgba(217, 224, 228, 0.2);
}

html[dir="rtl"] .matrix-tab.active { border-right-color: var(--volt); }

html[dir="rtl"] .matrix-intersection {
  border-left: none;
  border-right: 2px solid var(--volt);
}

html[dir="rtl"] .svc-node {
  padding: 14px 38px 12px 14px;
  text-align: right;
}

html[dir="rtl"] .svc-node .svc-status {
  left: auto;
  right: 14px;
}

html[dir="rtl"] .svc-node.active {
  box-shadow: inset -3px 0 0 var(--volt);
}

html[dir="rtl"] .layer-num,
html[dir="rtl"] .node-box-tag,
html[dir="rtl"] .mono { letter-spacing: 0; }

html[dir="rtl"] .hero-eyebrow,
html[dir="rtl"] .mono-tag,
html[dir="rtl"] .macro-caption .mono,
html[dir="rtl"] .slice-reveal .mono { letter-spacing: 0.05em; }

/* Arabic web font stack (Noto Sans SC falls back gracefully; add Noto Kufi/Arabic when available) */
html[dir="rtl"] body {
  font-family: 'Plus Jakarta Sans', 'Noto Kufi Arabic', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
}

html[dir="rtl"] .mono,
html[dir="rtl"] .node-stat,
html[dir="rtl"] .lang-code {
  font-family: 'JetBrains Mono', 'Segoe UI', Tahoma, monospace;
}

/* 窄屏避免左右元素夹住 Hero 标题，logo 进一步收窄 */
@media (max-width: 560px) {
  .brand-logo img {
    height: 36px;
  }
}

/* ---------- prediction matrix: hero formula ---------- */
.matrix-formula {
  margin: 30px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  max-width: 720px;
}

.formula-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: #6A7077;
  width: 100%;
  margin-bottom: 6px;
}

.formula-term {
  font-family: 'JetBrains Mono', 'Noto Sans SC', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 10px 16px;
  border: 1px solid var(--carbon);
  background: var(--white);
  box-shadow: 4px 4px 0 rgba(13, 14, 21, 0.12);
  transition: transform 0.4s var(--ease-silk), background 0.4s var(--ease-silk);
}

.formula-term:hover {
  transform: translateY(-3px);
  background: var(--volt);
}

.formula-op {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--carbon);
}

.matrix-formula-note {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 13px;
  line-height: 1.7;
  color: #6A7077;
}

/* ---------- prediction matrix: axis grid (card 4) ---------- */
.matrix-axes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.axis-cell {
  border: 1px solid rgba(217, 224, 228, 0.22);
  background: rgba(244, 245, 246, 0.05);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.4s var(--ease-silk), background 0.4s var(--ease-silk);
}

.axis-cell:hover {
  border-color: var(--volt);
  background: rgba(209, 255, 0, 0.08);
}

.axis-key {
  font-size: 15px;
  font-weight: 700;
  color: var(--volt);
  letter-spacing: 0.04em;
}

.axis-desc {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(244, 245, 246, 0.62);
}

.matrix-intersection {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(244, 245, 246, 0.78);
  margin-bottom: 26px;
  padding: 14px 16px;
  border-left: 2px solid var(--volt);
  background: rgba(209, 255, 0, 0.06);
}

.matrix-intersection strong {
  color: var(--volt);
  font-weight: 700;
}

/* matrix card spacing: left column holds the axis grid above tabs */
.card-matrix .matrix-left h2 { margin-bottom: 26px; }
.card-matrix .matrix-tabs { margin-top: 4px; }

/* ---------- reduced motion: collapse to a calm static document ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-spacer { display: none; }
  .zcard {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 100vh;
    transform: none !important;
    opacity: 1 !important;
  }
  .glass-a, .glass-b, .glass-c, .node-dot, .hero-scroll-hint::after, .svc-status { animation: none !important; }
  .slice, .slice-img, .slice-shade, .slice-reveal, .matrix-img, .matrix-tab p { transition: none !important; }
  .card-macro, .matrix-right, .card-fabric { min-height: 100vh; }
  .card-fabric { overflow-y: visible; }
  /* 减少动态效果时：矩阵视频保留激活项首帧静态画面，隐藏其余项 */
  video.matrix-img { display: none; }
  video.matrix-img.active { display: block; }
}
