/* ============================================================
   YunZhongTech · Homepage Styles
   ============================================================ */

/* ── Hero Section ── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--space-24) + 48px) 0 var(--space-20);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: var(--z-particles);
  pointer-events: none;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  /* Ambient spotlight moves dynamically with the mouse cursor */
  background:
    linear-gradient(90deg, rgba(5, 7, 11, 0.92) 0%, rgba(5, 7, 11, 0.52) 48%, rgba(5, 7, 11, 0.82) 100%),
    radial-gradient(circle at calc(72% + var(--mouse-x, 0) * 12%) calc(42% + var(--mouse-y, 0) * 12%), rgba(24, 214, 198, 0.22) 0%, transparent 28rem),
    radial-gradient(circle at calc(20% + var(--mouse-x, 0) * 8%) calc(20% + var(--mouse-y, 0) * 8%), rgba(47, 141, 255, 0.16) 0%, transparent 24rem);
  pointer-events: none;
  transition: background 0.5s var(--ease-out-quart);
}

.hero__shell {
  width: min(100%, var(--max-width-lg));
  margin-inline: auto;
  padding-inline: var(--content-padding);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.82fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.hero__content {
  position: relative;
  z-index: var(--z-base);
  text-align: left;
  max-width: 760px;
  padding: 0;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-highlight);
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.3s forwards;
}

.hero__eyebrow::before {
  content: '';
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
}

.hero__title {
  font-size: clamp(3.75rem, 7.4vw, 7.5rem);
  font-weight: var(--weight-black);
  line-height: 0.98;
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.5s forwards;
}

/* 中文版专属：防止汉字在超大屏（≥1621px，字号触及120px上限）时跨字符软换行。
   <br> 硬换行不受影响，"数智融合 / 生命科学前沿"两行结构完全保留。
   :lang(en) 版本不绑定，避免拉丁长词组出现水平溢出。 */
:lang(zh) .hero__title {
  white-space: nowrap;
}

.hero__title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px);
}

.hero__subtitle {
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.7s forwards;
}

.hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.8s forwards;
}

.hero__proof span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(184, 217, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(9, 22, 34, 0.56);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}

.hero__cta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-4);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.9s forwards;
}

.hero__visual {
  position: relative;
  z-index: var(--z-base);
  min-height: 560px;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid rgba(184, 217, 255, 0.16);
  background: rgba(9, 22, 34, 0.64);
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.48),
    0 0 80px rgba(24, 214, 198, 0.12);
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  animation: heroVisualIn 1s var(--ease-out-expo) 0.65s forwards;
  
  /* 3D Perspective and Stacking Context */
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out-quart), box-shadow 0.6s var(--ease-out-quart);
}

.hero__visual::before,
.hero__visual::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__visual::before {
  background:
    linear-gradient(180deg, rgba(5, 7, 11, 0.1), rgba(5, 7, 11, 0.6)),
    radial-gradient(circle at 72% 24%, rgba(24, 214, 198, 0.22), transparent 18rem);
  z-index: 1;
}

.hero__visual::after {
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 76%, transparent);
  opacity: 0.48;
  z-index: 2;
}

.hero__visual-img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.08) brightness(0.82);
  transform: scale(1.08);
  transition: transform 0.6s var(--ease-out-quart);
}

.hero__visual-panel {
  position: absolute;
  z-index: 3;
  width: auto;
  max-width: 80%;
  padding: var(--space-4);
  /* 真正的玻璃质感：使用微亮白光折射的斜向渐变，而非暗色块 */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  /* 模拟玻璃侧边切角折射的半透明白边 */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  /* 双重投影：外部深色阴影拉开立体空间 + 内部微弱边缘高光 */
  box-shadow: 
    0 24px 50px rgba(0, 0, 0, 0.65),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
  
  /* 2D Stacking transform to resolve Chromium backdrop-filter ghosting bug */
  transform: translate(0, 0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.6s var(--ease-out-quart);
}

/* ── 3D Interactive Parallax Hover Effect (Desktop Only) ── */
@media (hover: hover) {
  .hero:hover .hero__visual {
    /* Dynamic 3D tilt based on cursor position anywhere in the hero section */
    transform: rotateX(calc(var(--mouse-y, 0) * -8deg)) rotateY(calc(var(--mouse-x, 0) * 8deg)) scale(1.01);
    box-shadow:
      0 48px 140px rgba(0, 0, 0, 0.54),
      0 0 100px rgba(24, 214, 198, 0.2);
  }
  
  .hero:hover .hero__visual-img {
    /* Background moves in opposite direction of the cursor for visual depth */
    transform: scale(1.08) translate(calc(var(--mouse-x, 0) * -16px), calc(var(--mouse-y, 0) * -16px));
  }
  
  .hero:hover .hero__visual-panel {
    /* Translate in 2D only to prevent browser splitting backdrop-filter into a separate glitched 3D layer */
    transform: translate(calc(var(--mouse-x, 0) * 20px), calc(var(--mouse-y, 0) * 20px));
  }
}

.hero__visual-panel--top {
  top: var(--space-5);
  left: var(--space-5);
}

.hero__visual-panel--bottom {
  right: var(--space-5);
  bottom: var(--space-5);
}

.hero__metric {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--text-accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.hero__visual-panel strong {
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s var(--ease-out-expo) 1.5s forwards;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--accent-indigo), transparent);
  animation: scrollPulse 2s infinite;
}

/* ── Mission Section ── */
.mission {
  position: relative;
  padding: var(--space-24) 0;
  overflow: hidden;
}

.mission__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 30% 50%,
    rgba(99, 102, 241, 0.04) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 70% 60%,
    rgba(6, 182, 212, 0.03) 0%,
    transparent 40%
  );
  pointer-events: none;
}

.mission__content {
  position: relative;
  text-align: center;
  max-width: 920px;
  margin-inline: auto;
}

.mission__quote {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 5rem);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-8);
}

.mission__desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ── Matrix / Business Section ── */
.matrix {
  position: relative;
}

.matrix__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.matrix__card {
  position: relative;
  container-type: inline-size;
  container-name: card;
  padding: 8cqw;
  background: linear-gradient(180deg, rgba(14, 34, 49, 0.72), rgba(7, 15, 24, 0.84));
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-slow) var(--ease-out-expo);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.matrix__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 207, 131, 0.65), rgba(24, 214, 198, 0.55), transparent);
  opacity: 0.62;
  transition: opacity var(--duration-slow);
}

.matrix__card:hover {
  transform: translateY(-8px);
  border-color: var(--color-border-glow);
  box-shadow: var(--shadow-glow);
  background: var(--glass-bg-hover);
}

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

.matrix__card-icon {
  font-size: clamp(1.8rem, 9.5cqw, 2.2rem);
  margin-bottom: 5cqw;
  display: block;
}

.matrix__card-title {
  font-size: clamp(1.1rem, 7cqw, 1.45rem);
  font-weight: var(--weight-bold);
  margin-bottom: 2.5cqw;
}

.matrix__card-status {
  font-size: clamp(0.7rem, 3.8cqw, 0.8rem);
  color: var(--text-accent);
  font-family: var(--font-mono);
  margin-bottom: 4cqw;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.matrix__card-desc {
  font-size: clamp(0.78rem, 4.2cqw, 0.9rem);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: 5cqw;
  flex-grow: 1;
}

.matrix__card-media {
  position: relative;
  margin: 5cqw 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(184, 217, 255, 0.12);
  aspect-ratio: 1.618 / 1;
}

.matrix__card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(5, 9, 14, 0.52));
  pointer-events: none;
  z-index: 3;
}

.matrix__card-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.86) contrast(1.04);
  transition: transform var(--duration-slow) var(--ease-out-expo), opacity var(--duration-slow) ease;
  z-index: 1;
}

.matrix__card-media canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

.matrix__card:hover .matrix__card-media img,
.matrix__card:hover .matrix__card-media canvas {
  transform: scale(1.045);
}


.matrix__card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2cqw;
}

.matrix__card-tags .tag {
  font-size: clamp(0.68rem, 3.8cqw, 0.78rem);
  padding: 1.5cqw 3.5cqw;
  border-radius: var(--radius-md);
}

/* ── Stats Section ── */
.stats-section {
  position: relative;
  overflow: hidden;
}

.stats-section__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(24, 214, 198, 0.08), transparent 34rem),
    linear-gradient(180deg, var(--color-void) 0%, var(--color-deep-space) 50%, var(--color-void) 100%);
  pointer-events: none;
}

/* ── News Section (Home) ── */
.news-home__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.news-home__more {
  text-align: center;
  margin-top: var(--space-10);
}

/* ── CTA Section ── */
.cta-section {
  position: relative;
  text-align: center;
  padding: var(--space-32) 0;
  overflow: hidden;
}

.cta-section__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(99, 102, 241, 0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.cta-section__title {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-6);
}

.cta-section__desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

/* ── Video Player Section ── */
.video-section {
  position: relative;
  padding: var(--space-20) 0;
}

.video-container {
  position: relative;
  max-width: 1100px;
  margin-inline: auto;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: var(--glass-border);
  box-shadow: 0 32px 110px rgba(0, 0, 0, 0.42), 0 0 70px rgba(24, 214, 198, 0.1);
}

.video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-nebula-dark);
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: rgba(10, 10, 15, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-out-expo);
}

.video-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.video-play-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  border: 2px solid rgba(99, 102, 241, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-expo);
  padding-left: 4px;
}

.video-play-btn:hover {
  background: rgba(99, 102, 241, 0.35);
  transform: scale(1.1);
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.35);
  border-color: rgba(99, 102, 241, 0.7);
}

.video-label {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
}


/* ── Keyframe Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scrollPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.5);
    transform-origin: top;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
  }
}

@keyframes heroVisualIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Responsive: Home ── */
@media (max-width: 1024px) {
  .hero__shell {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .hero__content {
    text-align: center;
    margin-inline: auto;
  }

  .hero__eyebrow,
  .hero__cta,
  .hero__proof {
    justify-content: center;
  }

  .hero__visual {
    min-height: 420px;
    width: min(100%, 760px);
    margin-inline: auto;
  }

  .hero__visual-img {
    min-height: 420px;
  }

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

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

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: calc(var(--space-20) + 48px) 0 var(--space-12);
  }

  .hero__title {
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .hero__subtitle {
    font-size: var(--text-base);
  }

  .hero__visual {
    min-height: 320px;
  }

  .hero__visual-img {
    min-height: 320px;
  }

  .hero__visual-panel {
    padding: var(--space-2) var(--space-3);
    width: auto;
    max-width: 75%;
    border-radius: var(--radius-md);
  }

  .hero__visual-panel strong {
    font-size: var(--text-xs);
  }

  .hero__metric {
    font-size: 0.58rem;
    margin-bottom: 2px;
  }

  .hero__visual-panel--top {
    top: var(--space-3);
    left: var(--space-3);
  }

  .hero__visual-panel--bottom {
    right: var(--space-3);
    bottom: var(--space-3);
  }

  .matrix__grid {
    grid-template-columns: 1fr;
  }

  .news-home__grid {
    grid-template-columns: 1fr;
  }

  .mission__quote {
    font-size: var(--text-3xl);
  }

  .hero__scroll-indicator {
    display: none;
  }
}
