:root {
  --night-bg: #1a1b26;
  --day-bg: #7aa2f7;
  --parchment: #f2e8cf;
  --text-dark: #383e56;
  --accent: #bb9af7;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Press Start 2P', cursive; /*[cite: 3] */
  image-rendering: pixelated;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color, #1a1b26);
  background-image:
    linear-gradient(0deg, rgba(0,0,0,0.12) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0,0,0,0.12) 2px, transparent 2px),
    radial-gradient(circle 2px, rgba(187,154,247,0.3) 2px, transparent 2px),
    radial-gradient(circle 2px, rgba(122,162,247,0.25) 2px, transparent 2px),
    radial-gradient(circle 2px, rgba(255,255,255,0.2) 2px, transparent 2px),
    radial-gradient(circle 2px, rgba(255,255,255,0.1) 2px, transparent 2px);
  background-size: 8px 8px, 8px 8px, 32px 32px, 48px 48px, 64px 64px, 80px 80px;
  background-position: 0 0, 0 0, 0 0, 8px 16px, 24px 8px, 40px 32px;
  color: #fff;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

/* Diagonal Background Logic[cite: 3] */
.bg-night, .bg-day {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.bg-day {
  background: linear-gradient(var(--day-bg), #fff);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* Status Bar[cite: 3] */
.status-bar {
  position: fixed;
  top: 0; width: 100%; height: 35px;
  background: rgba(26, 27, 38, 0.9);
  display: flex; justify-content: space-between;
  align-items: center; padding: 0 20px;
  border-bottom: 2px solid var(--accent);
  z-index: 1000;
}

.bar-section a {
  color: #fff; text-decoration: none; font-size: 12px; margin: 0 10px;
}

/* Parchment Styling[cite: 3] */
.parchment-card {
  background: var(--parchment);
  color: var(--text-dark);
  padding: 25px;
  border: 4px solid var(--text-dark);
  box-shadow: 8px 8px 0px rgba(0,0,0,0.4);
  margin-bottom: 40px;
  position: relative;
}

.hero { height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
h1 { font-size: 2.5rem; text-shadow: 4px 4px var(--night-bg); margin-bottom: 15px; }

.content-section { max-width: 900px; margin: 0 auto; padding: 60px 20px; }

.skills-grid span {
  display: inline-block; background: var(--text-dark); color: #fff;
  padding: 8px; margin: 5px; font-size: 10px;
}

.projects-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

.project-image { width: 100%; height: 150px; object-fit: cover; border: 2px solid var(--text-dark); margin-bottom: 15px; cursor: pointer; }

.quest-btn {
  transition: 0.2s ease, transform 0.2s ease;
  display: inline-block; background: var(--text-dark); color: #fff;
  padding: 10px; margin-top: 15px; text-decoration: none; font-size: 10px;
}
.quest-btn:hover {
  background: var(--accent);
  transition: background 0.2s ease;
  transform: scale(1.05);
}
.img-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  display: none; align-items: center; justify-content: center; z-index: 2000;
}
/* Update the existing parchment-card with smoother transitions */
.parchment-card {
  /* ... existing styles ... */
  transition: transform 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67), 
              box-shadow 0.2s ease,
              border-color 0.2s ease;
  cursor: pointer;
  will-change: transform;
}

/* Hover State: Lift the card and deepen the shadow[cite: 3] */
.parchment-card:hover {
  transition: 150ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  transform: translate(-4px, -4px);
  box-shadow: 14px 14px 0px rgba(0, 0, 0, 0.5);
  border-color: var(--accent);
}

/* Active State: "Push" the card into the desk when clicked[cite: 3] */
.parchment-card:active {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.4);
}

.social-bar {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.social-bar a {
  color: var(--text-dark);
  font-size: 32px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-bar a:hover {
  color: var(--accent);
  transform: scale(1.2);
}

/* Entrance Animation for scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Optional: Subtle "floating" idle animation for featured projects */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

.project-box.featured {
  animation: float 3s ease-in-out infinite;
}

.heatmap-card {
  position: relative;
}

.heatmap-card h2 {
  margin-bottom: 20px;
}

.tooltip {
  position: fixed;
  background: var(--text-dark);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  line-height: 1.6;
  padding: 8px 10px;
  border: 2px solid var(--accent);
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  image-rendering: pixelated;
}

.year-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.year-btn {
  background: var(--text-dark);
  color: #fff;
  border: 2px solid var(--text-dark);
  padding: 6px 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  image-rendering: pixelated;
}

.year-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.year-btn:active {
  transform: translate(1px, 1px);
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.year-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--text-dark);
  min-width: 80px;
  text-align: center;
}

.contribution-canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 2px solid var(--text-dark);
  display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .status-bar {
    padding: 0 10px;
    height: 40px;
  }

  .bar-section a {
    font-size: 8px;
    margin: 0 5px;
  }

  .hero {
    height: 60vh;
    padding-top: 40px;
  }

  h1 {
    font-size: 1.5rem;
    text-align: center;
    padding: 0 10px;
  }

  .sub-label {
    font-size: 8px;
    text-align: center;
    padding: 0 15px;
  }

  .content-section {
    padding: 30px 15px;
  }

  .parchment-card {
    padding: 15px;
    border-width: 3px;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.4);
    margin-bottom: 25px;
  }

  .parchment-card h2,
  .section-title {
    font-size: 14px;
  }

  .parchment-card p {
    font-size: 9px;
    line-height: 1.6;
  }

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

  .project-image {
    height: 120px;
  }

  .quest-btn {
    padding: 8px;
    font-size: 9px;
    text-align: center;
    width: 100%;
  }

  .skills-grid span {
    font-size: 9px;
    padding: 6px;
  }

  .social-bar a {
    font-size: 28px;
  }

  .social-bar {
    gap: 20px;
  }

  .parchment-card:hover {
    transform: none;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.4);
  }
}