/* =============================================
   PURVAL SINGH — MINIMALISTIC CV
   A modern, dark-themed, elegant resume
   ============================================= */

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

:root {
  /* Color System */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-card: #161618;
  --bg-card-hover: #1c1c1f;
  --bg-chip: rgba(255, 255, 255, 0.04);
  --bg-chip-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --text-accent: #60a5fa;

  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.1);
  --accent-glow: rgba(96, 165, 250, 0.15);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --divider: rgba(255, 255, 255, 0.04);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ---------- Container ---------- */
.cv-container {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg);
}

@media (max-width: 768px) {
  .cv-container {
    padding: var(--space-xl) var(--space-md);
  }
}

/* ---------- Header ---------- */
.cv-header {
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.header-top {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.avatar-ring {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent), #818cf8, #c084fc);
  animation: ringPulse 4s ease-in-out infinite;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-primary);
  display: block;
}

.header-info {
  flex: 1;
  min-width: 0;
}

.name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(52, 211, 153, 0.15);
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse 2s ease-in-out infinite;
}

.header-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-chip);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.link-chip:hover {
  background: var(--bg-chip-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.link-chip svg {
  opacity: 0.7;
  transition: opacity var(--duration-fast);
}

.link-chip:hover svg {
  opacity: 1;
}

/* ---------- Section Divider ---------- */
.section-divider {
  height: 1px;
  background: var(--divider);
  margin: var(--space-xl) 0;
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.5;
}

/* ---------- Section ---------- */
.cv-section {
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.6;
  font-weight: 500;
}

/* ---------- About ---------- */
.about-text {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 600px;
}

/* ---------- Timeline (Education / Experience) ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.timeline-item {
  position: relative;
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--duration-normal) var(--ease-out);
}

.timeline-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.timeline-subtitle {
  font-size: 0.85rem;
  color: var(--text-accent);
  font-weight: 500;
  margin-top: 2px;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.timeline-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Experience Highlight ---------- */
.experience-highlight {
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, var(--bg-card), rgba(96, 165, 250, 0.03));
}

.experience-highlight:hover {
  border-left-color: #818cf8;
}

.experience-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-md);
}

.experience-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.15);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.skill-category-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-chip);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: default;
}

.skill-tag:hover {
  background: var(--accent-soft);
  border-color: rgba(96, 165, 250, 0.2);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.project-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--accent);
  transition: background var(--duration-normal);
}

.project-card:hover .project-icon {
  background: var(--accent-glow);
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
  margin-bottom: var(--space-md);
}

.project-meta {
  display: flex;
  gap: var(--space-sm);
}

.project-tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.12);
  font-weight: 500;
}

/* ---------- Interests ---------- */
.interests-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.interest-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: default;
}

.interest-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  color: var(--text-primary);
}

.interest-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ---------- Footer ---------- */
.cv-footer {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--divider);
  text-align: center;
}

.footer-text {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.footer-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  opacity: 0.6;
}

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

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

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.1); }
  50% { box-shadow: 0 0 20px 2px rgba(96, 165, 250, 0.06); }
}

/* ---------- Scroll-triggered Animation Classes ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

/* ---------- Print Styles ---------- */
@media print {
  .grain { display: none; }
  
  body {
    background: white;
    color: #111;
  }

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

  .link-chip,
  .skill-tag,
  .project-card,
  .interest-item,
  .timeline-item {
    border-color: #ddd;
    background: #fafafa;
  }

  .avatar-ring {
    background: #ddd;
  }

  .section-number {
    color: #333;
  }

  .name { color: #111; }
  .tagline { color: #555; }
  .about-text { color: #333; }
  .timeline-title { color: #111; }
  .timeline-subtitle { color: #2563eb; }
  .timeline-description { color: #444; }
  .skill-tag { color: #333; }
  .project-title { color: #111; }
  .project-desc { color: #444; }
  .footer-text, .footer-date { color: #888; }
  .status-badge { color: #16a34a; border-color: #16a34a; background: rgba(22, 163, 74, 0.05); }
  .status-dot { background: #16a34a; }
  .section-title { color: #333; }
  .skill-category-title { color: #666; }
  .section-divider { background: #eee; }
  .section-divider::after { background: linear-gradient(90deg, #2563eb, transparent); }
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .header-top {
    flex-direction: column;
    text-align: center;
  }

  .avatar-ring {
    width: 72px;
    height: 72px;
  }

  .name {
    font-size: 1.5rem;
  }

  .header-links {
    justify-content: center;
  }

  .status-badge {
    margin: 0 auto;
  }

  .timeline-header {
    flex-direction: column;
    gap: var(--space-xs);
  }

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