/* ========================================
   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-primary: #00d4aa;
  --color-blue: #4d9fff;
  --accent-rgb: 0, 212, 170;
  --blue-rgb: 77, 159, 255;
  --white-rgb: 230, 237, 243;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --bg-deep: #0a0b14;

  --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: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 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.025;
  pointer-events: none;
  z-index: 0;
}

.particle-canvas {
  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;
  transition: top 0.15s ease-out, height 0.15s ease-out;
}

.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-primary);
}

/* ========================================
   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(0, 212, 170, 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, #00d4aa, #4d9fff, #00d4aa);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 3s 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 var(--color-primary);
  border-bottom: 2px solid var(--color-blue);
  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; }
}

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

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

.section-about,
.section-projects,
.section-story,
.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;
}

.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;
}

/* Section dividers */
.section-about::before,
.section-projects::before,
.section-story::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-projects::after,
.section-story::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;
}

/* ========================================
   About 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);
}

.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);
}

.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;
}

.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(var(--blue-rgb), 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, #00d4aa, #4d9fff, #00d4aa);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 3s linear infinite;
}

.stat-plus {
  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-cn);
  font-size: clamp(16px, 2.2vw, 22px);
  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;
}

/* ========================================
   Projects Section
   ======================================== */

.section-projects .section-title {
  margin-bottom: 80px;
}

.projects-inner {
  width: 100%;
  max-width: 1200px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  perspective: 1200px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  overflow: hidden;
  cursor: default;
  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), 0.25);
  transition: transform 0.45s var(--ease-smooth), opacity 0.45s var(--ease-smooth), filter 0.45s var(--ease-smooth), box-shadow 0.45s var(--ease-smooth), background 0.3s ease;
}

.project-card-1 { --glow-rgb: 0, 212, 170;   --card-bg: 0, 42, 34;    --card-bg-a: 0.3;  --hover-bg: 0, 56, 45;    --hover-bg-a: 0.65; }
.project-card-2 { --glow-rgb: 77, 159, 255;   --card-bg: 16, 42, 76;   --card-bg-a: 0.3;  --hover-bg: 20, 52, 92;   --hover-bg-a: 0.65; }
.project-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; }
.project-card-4 { --glow-rgb: 52, 211, 153;   --card-bg: 10, 50, 36;   --card-bg-a: 0.25; --hover-bg: 14, 62, 45;   --hover-bg-a: 0.6; }
.project-card-5 { --glow-rgb: 251, 146, 60;   --card-bg: 62, 36, 10;   --card-bg-a: 0.3;  --hover-bg: 76, 44, 14;   --hover-bg-a: 0.65; }
.project-card-6 { --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; }

/* Card light sweep */
.project-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;
}

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

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

.project-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);
}

/* Depth interaction */
.project-card.depth-active {
  transform: translateY(-12px) scale(1.05);
  z-index: 10;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45), 0 0 30px rgba(var(--glow-rgb), 0.15);
}

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

.project-card.depth-dimmed {
  opacity: 0.4;
  filter: brightness(0.6);
}

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

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

/* Card content */
.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.project-emoji {
  font-size: 28px;
  line-height: 1;
}

.project-version {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: rgba(var(--glow-rgb), 0.6);
  letter-spacing: 1px;
  padding: 2px 10px;
  border: 1px solid rgba(var(--glow-rgb), 0.15);
  border-radius: 100px;
}

.project-card h3 {
  font-family: var(--font-cn);
  font-size: 18px;
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  margin-bottom: 12px;
  transition: color 0.3s;
}

.project-card p {
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.7;
  color: rgba(var(--white-rgb), 0.5);
  flex: 1;
  transition: color 0.3s;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.project-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(var(--glow-rgb), 0.7);
  padding: 3px 10px;
  border: 1px solid rgba(var(--glow-rgb), 0.12);
  border-radius: 100px;
  background: rgba(var(--glow-rgb), 0.04);
}

/* ========================================
   Story Section
   ======================================== */

.section-story {
  justify-content: center;
  padding-top: 0;
}

.story-inner {
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.story-text p {
  font-family: var(--font-cn);
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 2;
  color: rgba(var(--white-rgb), 0.7);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.story-quote {
  font-family: var(--font-cn);
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 400;
  line-height: 1.8;
  text-align: center;
  letter-spacing: 2px;
  color: rgba(var(--accent-rgb), 0.5);
  border: none;
  padding: 0;
  margin: 0;
}

/* ========================================
   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;
}

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

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

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

.contact-icon {
  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;
}

/* QR code popup */
.contact-wechat-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(var(--accent-rgb), 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 {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  margin-bottom: 8px;
}

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

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

/* Copyright */
.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; }
}

/* ========================================
   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;
  }

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

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

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

  .section-about,
  .section-projects,
  .section-story,
  .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-title {
    font-size: clamp(22px, 5vw, 28px);
  }

  .cursor-glow {
    display: none;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    perspective: none;
  }

  .project-card {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }

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

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

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

  .contact-links {
    gap: 32px;
  }

  .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;
  }

  .story-inner {
    gap: 36px;
  }
}
