/* ========================================
   Fonts
   ======================================== */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========================================
   CSS Variables
   ======================================== */

:root {
  --color-secondary: #38f9d7;
  --accent-rgb: 56, 249, 215;
  --blue-rgb: 96, 165, 250;
  --white-rgb: 240, 245, 255;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;

  --font-display: 'Space Grotesk', sans-serif;
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Reset & Base
   ======================================== */

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: #050510;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: -30%;
  width: 160%;
  height: 160%;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(25, 10, 60, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(10, 40, 60, 0.3) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 80%, rgba(15, 25, 50, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(20, 15, 45, 0.25) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  animation: nebulaDrift 60s ease-in-out infinite alternate;
}

@keyframes nebulaDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(5%, -3%) scale(1.02); }
  66%  { transform: translate(-4%, 4%) scale(0.98); }
  100% { transform: translate(3%, -2%) scale(1.01); }
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* Starfield background */
.starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

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

/* ========================================
   Page Indicator
   ======================================== */

.page-nav {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-nav::before {
  content: '';
  position: absolute;
  left: calc((8px - var(--dot-w, 8px)) / 2);
  top: var(--dot-top, 0px);
  width: var(--dot-w, 8px);
  height: var(--dot-height, 8px);
  border-radius: var(--dot-br, 50%);
  background: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.2);
  pointer-events: none;
}

.page-dot {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--white-rgb), 0.15);
}

.page-dot span {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-cn);
  font-size: 12px;
  color: rgba(var(--white-rgb), 0.5);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.page-dot:hover span {
  opacity: 1;
}

.page-dot.active span {
  color: var(--color-secondary);
}


/* ========================================
   Cursor Glow
   ======================================== */

.cursor-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(67,233,123,0.06),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-glow.active {
  opacity: 1;
}

/* ========================================
   Hero Section
   ======================================== */

.section-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 8%;
  padding-bottom: 10vh;
  z-index: 2;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  max-width: 700px;
}

@keyframes heroFadeUp {
  0%   { opacity: 0; transform: translateY(25px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 24px;
  background: linear-gradient(90deg, #38f9d7, #60a5fa, #38f9d7);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 2s linear infinite, heroFadeUp 0.8s ease-out both;
  animation-delay: 0s, 0.2s;
}

@keyframes logoShimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 300% center; }
}

.hero-title {
  font-family: var(--font-cn);
  font-size: clamp(18px, 3.2vw, 32px);
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.4;
  color: rgba(var(--white-rgb), 0.95);
  margin-bottom: 24px;
  opacity: 0;
  animation: heroFadeUp 0.8s ease-out 0.6s both;
}

.hero-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: heroFadeUp 0.8s ease-out 1s both;
}

.hero-tag {
  display: inline-block;
  padding: clamp(5px, 0.8vw, 8px) clamp(12px, 2vw, 20px);
  font-family: var(--font-cn);
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 100px;
  background: rgba(var(--accent-rgb), 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 28%;
  left: 8%;
  padding: 12px;
  cursor: pointer;
  opacity: 0;
  animation: heroFadeUp 0.8s ease-out 1.4s both;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid #38f9d7;
  border-bottom: 2px solid #60a5fa;
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
  50%      { transform: rotate(45deg) translateY(10px); opacity: 1; }
}

/* Globe canvas */
.globe-canvas {
  position: absolute;
  right: -20%;
  top: 50%;
  transform: translateY(-50%);
  width: 800px;
  height: 800px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 30%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 30%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
}

/* ========================================
   Section Common Layout
   ======================================== */

.section-hero,
.section-about,
.section-constellation,
.section-works,
.section-contact {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.section-about,
.section-constellation,
.section-works,
.section-contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
  padding: 18vh 24px 60px;
}

/* ========================================
   About / Narrative Section
   ======================================== */

.about-inner {
  max-width: 900px;
  width: 100%;
  margin: 40px auto auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}

/* Timeline */
.timeline {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 700px;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.5s ease-out, transform 0.5s var(--ease-spring);
}

.timeline-node.show {
  opacity: 1;
  transform: scale(1);
}

/* Planet base */
.timeline-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.8);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.4), 0 0 16px rgba(var(--accent-rgb), 0.15);
  margin: 0 auto;
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: rgba(var(--accent-rgb), 0.6);
  letter-spacing: 2px;
}

.timeline-label {
  font-family: var(--font-cn);
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* Meteor connecting line */
.timeline-line {
  position: relative;
  flex: 1;
  height: 2px;
  margin: 0 -4px 36px;
}

.timeline-line::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.35), rgba(67, 233, 123, 0.15));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease-out;
}

.timeline-line.show::before {
  transform: scaleX(1);
}

.timeline-meteor {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -30px;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), rgba(var(--accent-rgb),0.8), #fff);
  box-shadow: 0 0 6px rgba(var(--accent-rgb),0.5), 0 0 12px rgba(var(--accent-rgb),0.2);
  opacity: 0;
}

.timeline-meteor.show {
  animation: meteorSweep 0.5s ease-out forwards;
}

@keyframes meteorSweep {
  0%   { left: -30px; opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Stats */
.about-stats {
  display: flex;
  justify-content: center;
  gap: 80px;
  width: 100%;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(90deg, #38f9d7, #60a5fa, #38f9d7);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 2s linear infinite;
}

.stat-plus,
.stat-unit {
  font-size: 0.5em;
}

.stat-label {
  font-family: var(--font-cn);
  font-size: clamp(14px, 1.6vw, 16px);
  color: rgba(var(--white-rgb), 0.85);
  letter-spacing: 1px;
}

/* Quote */
.about-quote {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  line-height: 1.8;
  text-align: center;
  max-width: 600px;
  letter-spacing: 2px;
  color: rgba(var(--accent-rgb), 0.5);
  margin-top: 20px;
}

/* ========================================
   Constellation Section
   ======================================== */

.section-title {
  font-family: var(--font-cn);
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 500;
  letter-spacing: 2px;
  color: rgba(var(--accent-rgb), 0.7);
  margin-bottom: 52px;
  text-align: center;
}

/* Constellation container */
.constellation {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 5 / 3;
}

/* SVG connection lines */
.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-line {
  stroke: rgba(var(--accent-rgb), 0.25);
  stroke-width: 1;
  filter: drop-shadow(0 0 2px rgba(var(--accent-rgb), 0.2));
}

@keyframes lineFlow {
  0%   { stroke-dashoffset: 16; }
  100% { stroke-dashoffset: 0; }
}

.constellation-line.flowing {
  stroke-dasharray: 8 8;
  animation: lineFlow 1.5s linear infinite;
}

/* Constellation meteor — shooting star streak */
.constellation-meteor {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

.constellation-meteor.active {
  opacity: 1;
}

.constellation-meteor::before {
  content: '';
  position: absolute;
  top: -1px;
  right: 0;
  width: 200px;
  height: 2px;
  background: linear-gradient(to right,
    transparent,
    rgba(var(--accent-rgb), 0.06) 40%,
    rgba(255, 255, 255, 0.3) 75%,
    #fff
  );
}

.constellation-meteor::after {
  content: '';
  position: absolute;
  top: -2.5px;
  right: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px #fff, 0 0 10px rgba(var(--accent-rgb), 0.5);
}

/* Star nodes */
.star-node {
  position: absolute;
  cursor: default;
  opacity: 0;
  transition: opacity 0.5s ease-out;
  z-index: 2;
  text-align: left;
  transform: translate(-3px, -3px);
}

.star-node.visible { opacity: 1; }

.star-0 { left: 50%; top: 6%; }
.star-2 { left: 84%; top: 27%; }
.star-4 { left: 84%; top: 73%; }
.star-6 { left: 50%; top: 94%; }
.star-5 { left: 16%; top: 73%; }
.star-3 { left: 16%; top: 27%; }

/* Star core — matches background starfield */
.star-core {
  position: relative;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 0 0 12px;
  background: #fff;
  box-shadow: 0 0 2px #fff, 0 0 6px rgba(255, 255, 255, 0.4);
  animation: starTwinkle 3s ease-in-out infinite;
  transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;
}

.star-core::before,
.star-core::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.star-core::before {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.star-core::after {
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.star-core.flash {
  box-shadow: 0 0 6px #fff, 0 0 14px rgba(255, 255, 255, 0.5), 0 0 28px rgba(255, 255, 255, 0.15);
}

.star-core.flash::before,
.star-core.flash::after {
  opacity: 1;
}

.star-0 .star-core { animation-delay: 0s; }
.star-2 .star-core { animation-delay: -1.5s; }
.star-3 .star-core { animation-delay: -2.2s; }
.star-4 .star-core { animation-delay: -0.4s; }
.star-5 .star-core { animation-delay: -1.1s; }
.star-6 .star-core { animation-delay: -1.8s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.5; }
  20% { opacity: 0.9; }
  40% { opacity: 0.4; }
  60% { opacity: 1; }
  80% { opacity: 0.6; }
}

/* Star info — floating below star */
.star-info {
  width: 210px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.star-node.show-info .star-info {
  opacity: 1;
  transform: translateY(0);
}

.star-0 .star-info,
.star-6 .star-info {
  text-align: center;
  transform: translateX(-50%) translateY(8px);
  margin-left: 1.5px;
}

.star-0.show-info .star-info,
.star-6.show-info .star-info {
  transform: translateX(-50%) translateY(0);
}

.star-3 .star-info,
.star-5 .star-info {
  text-align: right;
  transform: translateX(-100%) translateY(8px);
  margin-left: -12px;
}

.star-3.show-info .star-info,
.star-5.show-info .star-info {
  transform: translateX(-100%) translateY(0);
}

.star-info h3 {
  font-family: var(--font-cn);
  font-size: 18px;
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  letter-spacing: 1px;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.star-node:hover .star-info h3 {
  color: rgba(var(--white-rgb), 1);
}

.star-info p {
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(var(--white-rgb), 0.55);
  transition: color 0.3s;
}

.star-node:hover .star-info p {
  color: var(--text-secondary);
}

/* ========================================
   Works Section
   ======================================== */

.section-works .section-title {
  margin-bottom: 118px;
}

.works-inner {
  width: 100%;
  max-width: 1400px;
}

.works-grid {
  display: flex;
  justify-content: center;
  width: 100%;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.works-grid .work-card + .work-card {
  margin-left: 14px;
}

.works-grid .work-card:nth-child(1) { transform: translateZ(0); }
.works-grid .work-card:nth-child(2) { transform: translateZ(3px); }
.works-grid .work-card:nth-child(3) { transform: translateZ(6px); }
.works-grid .work-card:nth-child(4) { transform: translateZ(9px); }
.works-grid .work-card:nth-child(5) { transform: translateZ(12px); }

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 260px;
  flex-shrink: 0;
  padding: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(90deg, transparent, rgba(var(--glow-rgb), 0.2) 50%, transparent) top / 100% 2px no-repeat,
    rgba(var(--card-bg), var(--card-bg-a));
  border: 1px solid rgba(var(--glow-rgb), var(--border-a, 0.25));
}

.work-card-1 { --glow-rgb: 250, 204, 60;  --card-bg: 62, 50, 10; --card-bg-a: 0.3;  --hover-bg: 76, 62, 14; --hover-bg-a: 0.65; }
.work-card-2 { --glow-rgb: 96, 165, 250;  --card-bg: 16, 42, 76; --card-bg-a: 0.3;  --hover-bg: 20, 52, 92; --hover-bg-a: 0.65; }
.work-card-3 { --glow-rgb: 167, 139, 250; --card-bg: 45, 20, 72; --card-bg-a: 0.25; --hover-bg: 55, 28, 85; --hover-bg-a: 0.6; }
.work-card-4 { --glow-rgb: 56, 249, 215;  --card-bg: 12, 54, 40; --card-bg-a: 0.25; --hover-bg: 16, 66, 50; --hover-bg-a: 0.6; }
.work-card-5 { --glow-rgb: 251, 113, 133; --card-bg: 72, 18, 30; --card-bg-a: 0.35; --hover-bg: 90, 24, 38; --hover-bg-a: 0.65; }

.work-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(var(--glow-rgb), 0.1) 45%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(var(--glow-rgb), 0.1) 55%,
    transparent 60%
  );
  background-size: 250% 100%;
  background-position: 200% 0;
  border-radius: 16px;
  pointer-events: none;
  z-index: 1;
  transition: none;
}

.work-card:hover::before {
  animation: cardSweep 0.6s ease-out forwards;
}

@keyframes cardSweep {
  from { background-position: 200% 0; }
  to { background-position: -50% 0; }
}

.work-card:hover {
  background:
    linear-gradient(90deg, transparent, rgba(var(--glow-rgb), 0.6) 50%, transparent) top / 100% 2px no-repeat,
    rgba(var(--hover-bg), var(--hover-bg-a));
  border-color: rgba(var(--glow-rgb), 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--glow-rgb), 0.08);
}

.work-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  margin-bottom: 14px;
  transition: color 0.45s var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-card h3::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(var(--glow-rgb));
  flex-shrink: 0;
}

.work-card:hover h3 {
  color: #fff;
}

.work-card p {
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.7;
  color: rgba(var(--white-rgb), 0.55);
  transition: color 0.45s var(--ease-smooth);
}

.work-card:hover p {
  color: var(--text-secondary);
}

/* Depth interaction */
.section-works .work-card {
  transition: transform 0.45s var(--ease-smooth), opacity 0.45s var(--ease-smooth), scale 0.45s var(--ease-smooth), filter 0.45s var(--ease-smooth), box-shadow 0.45s var(--ease-smooth);
}

.section-works .work-card.depth-active {
  transform: translateY(-18%) translateZ(80px) scale(1.12);
  z-index: 10;
  opacity: 1;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45), 0 0 30px rgba(var(--glow-rgb), 0.15);
  transition: all 0.5s var(--ease-spring);
}

.section-works .work-card:nth-child(odd).depth-active {
  transform: translateY(-18%) translateZ(80px) scale(1.12) rotate(-2.5deg);
}
.section-works .work-card:nth-child(even).depth-active {
  transform: translateY(-18%) translateZ(80px) scale(1.12) rotate(2.5deg);
}

.section-works .work-card.depth-active h3 { color: #fff; }
.section-works .work-card.depth-active p { color: var(--text-secondary); }

.section-works .work-card.depth-dimmed {
  opacity: 0.4;
  z-index: 1;
  scale: 0.95;
  filter: brightness(0.6);
  animation: none;
  transition: all 0.45s var(--ease-smooth);
}



/* Idle floating — staggered per card */
.section-works .work-card-1 { animation: cardFloat 5s ease-in-out infinite; }
.section-works .work-card-2 { animation: cardFloat 4.5s ease-in-out infinite 0.8s; }
.section-works .work-card-3 { animation: cardFloat 5.5s ease-in-out infinite 1.6s; }
.section-works .work-card-4 { animation: cardFloat 4s ease-in-out infinite 0.4s; }
.section-works .work-card-5 { animation: cardFloat 4.8s ease-in-out infinite 1.2s; }

@keyframes cardFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

/* Video card play indicator */
.work-card-5::after {
  content: '▶';
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(var(--glow-rgb), 0.6);
  border: 1px solid rgba(var(--glow-rgb), 0.25);
  border-radius: 50%;
  z-index: 2;
  animation: playPulse 2s ease-in-out infinite;
}

@keyframes playPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--glow-rgb), 0.25);
    border-color: rgba(var(--glow-rgb), 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(var(--glow-rgb), 0);
    border-color: rgba(var(--glow-rgb), 0.5);
  }
}

.work-card-cta {
  display: block;
  margin-top: 14px;
  font-family: var(--font-cn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(var(--glow-rgb), 0.8);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease, color 0.3s ease;
  pointer-events: none;
}

.work-card.depth-active .work-card-cta {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ========================================
   Video Modal
   ======================================== */

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-modal-content {
  position: relative;
  width: 90vw;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(251, 146, 60, 0.2);
  box-shadow: 0 0 60px rgba(251, 146, 60, 0.08), 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(40px) scale(0.95);
  opacity: 0;
  transition: transform 0.4s var(--ease-reveal), opacity 0.4s ease;
  background: #0a0a0a;
}

.video-modal.active .video-modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.video-modal-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.video-modal-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-modal-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(251, 146, 60, 0.15);
  border-top-color: rgba(251, 146, 60, 0.7);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

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

.video-modal-player {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.video-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.8);
  font-size: 22px;
  line-height: 36px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.video-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

/* ========================================
   Contact Section
   ======================================== */

.section-contact {
  padding-top: 25vh;
  gap: 48px;
}

.contact-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  position: relative;
}

.section-contact .contact-item:nth-child(1) { animation: contactFloat 4s ease-in-out infinite; }
.section-contact .contact-item:nth-child(2) { animation: contactFloat 4.5s ease-in-out infinite 0.6s; }
.section-contact .contact-item:nth-child(3) { animation: contactFloat 3.8s ease-in-out infinite 1.2s; }
.section-contact .contact-item:nth-child(4) { animation: contactFloat 4.2s ease-in-out infinite 1.8s; }

@keyframes contactFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.contact-item:hover {
  color: var(--color-secondary);
  transform: translateY(-4px);
}

.contact-icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  background: rgba(var(--accent-rgb), 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.contact-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  pointer-events: none;
}

.contact-icon svg {
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.contact-item:hover .contact-icon {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.15);
  background: rgba(var(--accent-rgb), 0.06);
}

.contact-item:hover .contact-icon::after {
  animation: iconRipple 1.5s ease-out infinite;
}

@keyframes iconRipple {
  0% { inset: 0; border-color: rgba(var(--accent-rgb), 0.3); opacity: 1; }
  100% { inset: -14px; border-color: rgba(var(--accent-rgb), 0); opacity: 0; }
}

.contact-item:hover .contact-icon svg {
  opacity: 1;
}

.contact-item span {
  font-family: var(--font-cn);
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.contact-wechat-trigger,
.contact-zsxq-trigger {
  perspective: 800px;
}

.contact-qrcode-popup {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) rotateX(-80deg);
  transform-origin: top center;
  padding: 16px;
  background-color: rgba(7, 11, 9, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(67, 233, 123, 0.15);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.45s var(--ease-spring), visibility 0.35s ease;
  pointer-events: none;
  text-align: center;
  z-index: 20;
}

.contact-qrcode-popup img {
  display: block;
  border-radius: 8px;
  margin-bottom: 8px;
}

.contact-zsxq-trigger .contact-qrcode-popup img {
  width: 220px;
  height: auto;
}

.contact-qrcode-popup span {
  font-size: 14px;
  color: var(--text-secondary);
}

.contact-wechat-trigger:hover .contact-qrcode-popup,
.contact-zsxq-trigger:hover .contact-qrcode-popup,
.contact-item.qr-open .contact-qrcode-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) rotateX(0);
  pointer-events: auto;
}

.contact-copy {
  margin-top: auto;
  padding-bottom: 40px;
  text-align: center;
  font-size: 14px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, rgba(var(--white-rgb), 0.2), rgba(var(--accent-rgb), 0.4), rgba(var(--white-rgb), 0.2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: copyShimmer 4s linear infinite;
}

@keyframes copyShimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ========================================
   Section Transitions — Cosmic Horizon
   ======================================== */

.section-about::before,
.section-constellation::before,
.section-works::before,
.section-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(var(--accent-rgb), 0.12) 20%,
    rgba(var(--blue-rgb), 0.2) 50%,
    rgba(var(--accent-rgb), 0.12) 80%,
    transparent
  );
  box-shadow:
    0 0 20px 4px rgba(var(--accent-rgb), 0.05),
    0 0 60px 12px rgba(var(--blue-rgb), 0.03);
  pointer-events: none;
  z-index: 1;
}

.section-about::after,
.section-constellation::after,
.section-works::after,
.section-contact::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: radial-gradient(ellipse 70% 100% at 50% 0%,
    rgba(var(--accent-rgb), 0.05) 0%,
    rgba(var(--blue-rgb), 0.025) 40%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* ========================================
   Scroll Reveal
   ======================================== */

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1023px) {
  .about-stats {
    gap: 48px;
  }

  .constellation {
    max-width: 600px;
  }

  .work-card { width: 220px; }
}

@media (max-width: 767px) {
  html { scroll-snap-type: none; }

  .section-hero,
  .section-about,
  .section-constellation,
  .section-works,
  .section-contact {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  .section-about,
  .section-constellation,
  .section-works,
  .section-contact {
    min-height: auto;
    padding-top: 12vh;
  }

  .about-stats {
    flex-direction: column;
    align-items: center;
    gap: 36px;
  }

  .about-inner {
    gap: 48px;
  }

  .timeline {
    flex-direction: column;
    align-items: center;
  }

  .timeline-line {
    width: 2px;
    height: 40px;
    flex: none;
    margin: 0;
  }

  .timeline-line::before {
    transform-origin: top;
    transform: scaleY(0);
  }

  .timeline-line.show::before {
    transform: scaleY(1);
  }


  .timeline-label {
    font-size: 12px;
  }

  .timeline-meteor {
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 30px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.15), rgba(var(--accent-rgb),0.8), #fff);
  }

  .timeline-meteor.show {
    animation: meteorSweepV 0.5s ease-out forwards;
  }

  @keyframes meteorSweepV {
    0%   { top: -30px; opacity: 1; }
    85%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
  }

  .section-constellation {
    padding: 12vh 20px 40px;
  }

  .constellation {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 0;
    width: 100%;
  }

  .constellation-lines { display: none; }
  .constellation-meteor { display: none; }

  .star-node {
    position: static;
    transform: none;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(var(--accent-rgb), 0.02);
    border: 1px solid rgba(var(--accent-rgb), 0.06);
  }

  .star-0 { order: 1; }
  .star-2 { order: 2; }
  .star-4 { order: 3; }
  .star-6 { order: 4; }
  .star-5 { order: 5; }
  .star-3 { order: 6; }

  .star-core {
    flex-shrink: 0;
    margin: 6px 0 0;
    width: 6px;
    height: 6px;
  }

  .star-core::before,
  .star-core::after {
    display: none;
  }

  .star-info {
    opacity: 1 !important;
    transform: none !important;
    width: auto !important;
    flex: 1;
    text-align: left !important;
    margin-left: 0 !important;
  }
  .star-info h3 { color: rgba(var(--white-rgb), 0.85); font-size: 15px; }
  .star-info p { color: var(--text-secondary); font-size: 14px; }

  .section-title {
    font-size: clamp(22px, 5vw, 28px);
  }

  .cursor-glow {
    display: none;
  }

  .globe-canvas {
    display: none;
  }

  .works-grid {
    flex-direction: column;
    gap: 16px;
    perspective: none;
    transform-style: flat;
  }

  .work-card {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 24px 20px !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  .work-card.reveal {
    transform: translateY(40px) !important;
    opacity: 0 !important;
  }

  .work-card.reveal.visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }

  .work-card::before {
    display: none;
  }

  .work-card-cta {
    display: none;
  }

  .work-card:active {
    border-color: rgba(var(--glow-rgb), 0.35) !important;
    box-shadow: 0 0 16px rgba(var(--glow-rgb), 0.12);
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
  }

  .work-card h3 {
    font-size: 15px;
  }

  .work-card p {
    font-size: 14px;
  }

  .section-contact {
    padding: 12vh 24px 80px;
  }

  .contact-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 16px;
    justify-items: center;
    width: 100%;
    max-width: 280px;
  }

  .contact-icon {
    width: 48px;
    height: 48px;
  }

  .contact-icon svg {
    width: 22px;
    height: 22px;
  }

  .contact-item span {
    font-size: 13px;
  }

  .contact-qrcode-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    transform-origin: center center;
    z-index: 200;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }

  .contact-item.qr-open .contact-qrcode-popup {
    transform: translate(-50%, -50%) scale(1);
  }

  .contact-item.qr-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 199;
  }

  .contact-copy {
    font-size: 12px;
  }

  .page-nav {
    display: none;
  }
}
