/* =============================================
   PORTFOLIO — Dark Cyberpunk Design System
   ============================================= */

/* ----- CSS Custom Properties ----- */
:root {
  --bg-deep: #09090B;
  --bg-surface: #13131A;
  --bg-elevated: #1A1A25;
  --accent-primary: #8B5CF6;
  --accent-glow: #A78BFA;
  --accent-cyan: #22D3EE;
  --text-primary: #F1F1F3;
  --text-secondary: #9CA3AF;
  --text-dim: #6B7280;
  --border-subtle: #1F1F2B;

  --font-display: 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans CJK SC', sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'SF Mono', 'Consolas', 'Courier New', monospace;

  --max-width: 1200px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-display);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ----- Container ----- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 3rem);
}

/* ----- Section ----- */
.section {
  padding: clamp(4rem, 10vw, 8rem) 0;
  position: relative;
}

.section-alt {
  background: var(--bg-surface);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: clamp(2rem, 5vw, 4rem);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
  border-radius: 2px;
}

/* ----- Neon Text Utilities ----- */
.neon-text {
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5),
               0 0 40px rgba(139, 92, 246, 0.3),
               0 0 80px rgba(139, 92, 246, 0.1);
}

.neon-text-cyan {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.5),
               0 0 40px rgba(34, 211, 238, 0.3);
}

.accent-cyan { color: var(--accent-cyan); }

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.nav.scrolled {
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 1px 0 var(--border-subtle), 0 4px 24px rgba(0, 0, 0, 0.4);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 3rem);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

/* Language Toggle */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color 0.2s;
}

.lang-toggle:hover { border-color: var(--accent-primary); }

.lang-option {
  padding: 0.25rem 0.6rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-dim);
}

.lang-option.active {
  background: var(--accent-primary);
  color: #fff;
}

.lang-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
  margin: 0 2px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* =============================================
   HERO
   ============================================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: var(--nav-height) 1rem 2rem;
}

/* Background grid */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black 30%, transparent 70%);
}

/* Scan-line overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
}

/* Ambient glow orb */
.hero-glow-orb {
  position: absolute;
  width: clamp(300px, 50vw, 600px);
  height: clamp(300px, 50vw, 600px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbPulse 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes orbPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

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

.hero-greeting {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-name-cn {
  display: inline;
}

.hero-name-sep {
  color: var(--text-dim);
  font-weight: 200;
  margin: 0 0.1em;
}

.hero-name-en {
  display: inline;
}

.hero-typing {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.typing-cursor {
  color: var(--accent-primary);
  font-weight: 300;
  animation: blink 0.8s step-end infinite;
}

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

.hero-desc {
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.8rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 32px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
}

/* Scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  animation: fadeInUp 2s ease 1s both;
  z-index: 2;
}

.scroll-dot {
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.3; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   ABOUT
   ============================================= */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.about-avatar {
  position: relative;
  width: 180px;
  height: 180px;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  overflow: hidden;
}

.avatar-placeholder svg {
  width: 60%;
  height: 60%;
}

.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-primary);
  border-right-color: var(--accent-cyan);
  animation: ringSpin 4s linear infinite;
}

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

.about-stats {
  display: flex;
  gap: 1.5rem;
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 1.3vw, 1rem);
}

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

/* =============================================
   SKILLS
   ============================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.skill-category:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.06);
}

.skill-cat-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all 0.25s;
}

.skill-tag:hover {
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
  transform: translateY(-1px);
}

.skill-tag:nth-child(3n+1):hover { border-color: rgba(139, 92, 246, 0.4); color: var(--accent-glow); box-shadow: 0 0 12px rgba(139, 92, 246, 0.2); }

/* =============================================
   TIMELINE (Experience)
   ============================================= */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
    var(--accent-primary),
    rgba(139, 92, 246, 0.3) 60%,
    transparent
  );
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 1.5rem;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translateX(-5px);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6),
              0 0 24px rgba(139, 92, 246, 0.3);
}

.timeline-item:nth-child(2) .timeline-dot {
  width: 10px; height: 10px;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.timeline-item:nth-child(3) .timeline-dot {
  width: 8px; height: 8px;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.3);
}

.timeline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.timeline-item:first-child .timeline-card {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.08);
}

.timeline-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
}

.timeline-card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
}

.timeline-item:nth-child(2) .timeline-card-accent {
  background: linear-gradient(90deg, var(--accent-glow), var(--accent-primary));
}

.timeline-item:nth-child(3) .timeline-card-accent {
  background: var(--accent-primary);
  opacity: 0.6;
}

.timeline-card-body {
  padding: 1.5rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-company {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.timeline-role {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.timeline-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.timeline-bullets li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.6;
}

.timeline-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-primary);
  font-size: 0.7rem;
}

/* =============================================
   PROJECTS
   ============================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
}

.project-card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-primary));
}

.project-card-body {
  padding: 1.5rem;
}

.project-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.project-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.project-tags span {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-glow);
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.project-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-bullets li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.project-bullets li::before {
  content: '›';
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 1rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-primary);
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--accent-glow);
}

/* =============================================
   EDUCATION
   ============================================= */
.edu-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: border-color 0.3s;
}

.edu-card:last-child { margin-bottom: 0; }

.edu-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
}

.edu-card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
}

.edu-card-body {
  padding: 1.5rem;
}

.edu-card-secondary {
  opacity: 0.7;
}

.edu-card-secondary:hover { opacity: 1; }

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.edu-school {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.edu-degree {
  font-size: 0.9rem;
  color: var(--accent-cyan);
}

.edu-degree-dim {
  color: var(--text-dim);
}

.edu-date {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1.5rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.contact-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.08);
}

.contact-icon {
  color: var(--accent-primary);
  margin-bottom: 0.3rem;
}

.contact-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-all;
}

/* QR code card */
.contact-card-qr {
  cursor: pointer;
}

.contact-card-qr:hover {
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.08);
}

/* QR modal overlay */
.qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.qr-modal.open {
  opacity: 1;
  visibility: visible;
}

.qr-modal-content {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 16px 48px rgba(139, 92, 246, 0.15);
  transform: scale(0.95);
  transition: transform 0.3s;
}

.qr-modal.open .qr-modal-content {
  transform: scale(1);
}

.qr-modal-image {
  width: 280px;
  height: 360px;
  border-radius: 12px;
  margin-bottom: 1rem;
  object-fit: contain;
}

.qr-modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.qr-modal-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.qr-modal-close {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.qr-modal-close:hover {
  opacity: 0.85;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.back-to-top {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: all 0.3s;
}

.back-to-top:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

/* =============================================
   TOOLTIP
   ============================================= */
.tooltip {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--accent-primary);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.3s ease;
}

.tooltip[hidden] {
  display: none;
}

/* =============================================
   SCROLL REVEAL ANIMATIONS
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* Staggered reveal for skill categories */
.skill-category {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.skill-category.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* =============================================
   RESPONSIVE — Tablet
   ============================================= */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }

  .about-visual {
    flex-direction: row;
    justify-content: center;
    gap: 3rem;
  }

  .about-avatar {
    width: 140px;
    height: 140px;
  }
}

/* =============================================
   RESPONSIVE — Mobile
   ============================================= */
@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 9, 11, 0.96);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .nav-links.active {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 1.2rem;
  }

  .hamburger { display: flex; }

  .about-visual {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .about-avatar {
    width: 140px;
    height: 140px;
  }

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

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

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-dot {
    left: -1.5rem;
  }

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

  .hero-name {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .footer .container {
    flex-direction: column;
    gap: 1rem;
  }
}
