/* ================================
   Zhang Yu Resume - Modern Dark Theme
   ================================ */

:root {
  /* Color Palette - Midnight Blue */
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-hover: #232d42;
  
  /* Accent Colors */
  --accent-primary: #60a5fa;
  --accent-secondary: #a78bfa;
  --accent-tertiary: #34d399;
  --accent-warm: #fbbf24;
  
  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-accent: rgba(96, 165, 250, 0.3);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  
  /* Typography */
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  /* Spacing */
  --container-max: 900px;
  --section-gap: 2.5rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Gradient Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(96, 165, 250, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(167, 139, 250, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ================================
   Header
   ================================ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 2rem;
  margin-bottom: var(--section-gap);
  border-bottom: 1px solid var(--border-subtle);
}

.name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 400;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

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

.contact-item .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ================================
   Sections
   ================================ */
.section {
  margin-bottom: var(--section-gap);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.section-icon {
  color: var(--accent-primary);
  font-size: 1rem;
}

/* ================================
   Highlights
   ================================ */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: all 0.25s ease;
}

.highlight-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.highlight-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.highlight-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ================================
   Timeline (Work Experience)
   ================================ */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

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

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translateX(-4px);
  box-shadow: 0 0 0 4px var(--bg-primary);
}

.timeline-content {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.company {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.position {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.period {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ================================
   Tech Tags
   ================================ */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tech-tag.primary {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
  color: var(--accent-primary);
}

.tech-tag.secondary {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--accent-secondary);
}

.tech-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ================================
   Projects
   ================================ */
.project {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
}

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

.project:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.project.compact {
  padding: 1rem 1.25rem;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.project-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-role {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-tertiary);
  border-radius: 4px;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.project-tech {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(96, 165, 250, 0.08);
  border-radius: 6px;
  display: inline-block;
}

.project-points {
  list-style: none;
  padding: 0;
}

.project-points li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.project-points li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
}

.project-points li strong {
  color: var(--text-primary);
  font-weight: 500;
}

.project-points li:last-child {
  margin-bottom: 0;
}

/* ================================
   Achievements
   ================================ */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.achievement-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
}

.achievement-block h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-warm);
  margin-bottom: 0.75rem;
}

.achievement-block ul {
  list-style: none;
}

.achievement-block li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  padding-left: 1rem;
  position: relative;
}

.achievement-block li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ================================
   Education
   ================================ */
.education {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
}

.edu-school {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.edu-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ================================
   Footer
   ================================ */
.footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1.25rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .name {
    font-size: 2rem;
  }

  .contact-info {
    width: 100%;
  }

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

  .timeline-content {
    flex-direction: column;
    gap: 0.25rem;
  }

  .period {
    margin-left: 0;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .highlight-grid {
    grid-template-columns: 1fr;
  }

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

/* ================================
   Print Styles
   ================================ */
@media print {
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-subtle: #e2e8f0;
  }

  body {
    background: white;
    color: black;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body::before {
    display: none;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .section, .project, .timeline-item {
    opacity: 1;
    transform: none;
  }

  .name {
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    color: var(--text-primary);
  }

  .contact-item {
    background: none;
    border: none;
    padding: 0.2rem 0.5rem;
  }

  .project:hover,
  .highlight-card:hover {
    transform: none;
    box-shadow: none;
  }
}

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

.header {
  animation: fadeInUp 0.6s ease forwards;
}

.highlights {
  animation: fadeInUp 0.6s ease 0.1s forwards;
}
