/* ─── Page grid ─────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: grid;
  grid-template-rows: 56px 1fr auto;
}

/* ─── Canvas particle layer ─────────────────────────────── */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* ─── Nav ───────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid rgba(232, 119, 34, 0.15);
  backdrop-filter: blur(10px);
  background: rgba(13, 13, 13, 0.6);
}

.nav-brand {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.brand-orange {
  color: #e87722;
}

.brand-coding {
  color: #ffffff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: rgba(232, 160, 80, 0.55);
  font-size: 18px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.nav-links a:hover {
  color: #e87722;
}

.nav-links .nav-daily {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.nav-daily img {
  opacity: 1;
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
}

.avatar-wrap {
  position: relative;
  margin-bottom: 8px;
}

.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 119, 34, 0.3) 0%, transparent 70%);
  animation: avatar-pulse 3s ease-in-out infinite;
}

@keyframes avatar-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%       { transform: scale(1.12); opacity: 1;   }
}

.avatar-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: block;
  position: relative;
  overflow: hidden;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(232, 119, 34, 0.2);
}

.hero-title {
  font-size: 13px;
  color: rgba(255, 240, 220, 0.75);
  letter-spacing: 1px;
  font-weight: 400;
  margin: 0;
}

.divider {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 119, 34, 0.7), transparent);
  margin: 4px 0;
}

/* ─── Projects section ──────────────────────────────────── */
.projects-section {
  padding: 16px 40px 28px;
}

.projects-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

.section-row {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 12px;
}

.section-row.labels {
  margin-bottom: 6px;
}

.section-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(232, 119, 34, 0.7);
  text-transform: uppercase;
  font-weight: 600;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(232, 119, 34, 0.15);
}

.oss-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* ─── Project cards ─────────────────────────────────────── */
.project-card {
  background: rgba(232, 119, 34, 0.05);
  border: 1px solid rgba(232, 119, 34, 0.18);
  border-radius: 10px;
  padding: 14px;
  color: inherit;
  transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  gap: 7px;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: visible;
}

.project-card:hover {
  background: rgba(232, 119, 34, 0.12);
  border-color: rgba(232, 119, 34, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 119, 34, 0.1);
}

.side-card {
  height: 100%;
}

.project-name {
  font-size: 13px;
  font-weight: 600;
  color: #e87722;
}

.project-desc {
  font-size: 11px;
  color: rgba(232, 180, 120, 0.55);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(232, 160, 80, 0.45);
  margin-top: 2px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e87722;
  flex-shrink: 0;
}

.side-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  letter-spacing: 1px;
  color: #e87722;
  background: rgba(232, 119, 34, 0.1);
  border: 1px solid rgba(232, 119, 34, 0.25);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 600;
  text-transform: uppercase;
  width: fit-content;
}

/* ─── Description popover ───────────────────────────────── */
.project-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(20, 14, 8, 0.92);
  border: 1px solid rgba(232, 119, 34, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 11px;
  color: rgba(232, 180, 120, 0.85);
  line-height: 1.6;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(232, 119, 34, 0.08);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.project-card:hover .project-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ─── Shimmer skeleton ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(232, 119, 34, 0.06) 25%,
    rgba(232, 119, 34, 0.13) 50%,
    rgba(232, 119, 34, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .oss-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  /* Allow page to scroll on small screens */
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .page {
    height: auto;
    min-height: 100vh;
    grid-template-rows: 56px auto auto;
  }

  /* Nav */
  nav {
    padding: 0 16px;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-daily-label {
    display: none;
  }

  /* Hero */
  .hero {
    padding: 28px 20px 20px;
    gap: 8px;
  }

  /* Stack OSS grid + side card vertically */
  .section-row {
    grid-template-columns: 1fr;
  }

  .section-row.labels {
    grid-template-columns: 1fr;
  }

  /* Hide the "Side Project" label on mobile (card has the badge) */
  .section-row.labels .section-label:last-child {
    display: none;
  }

  .projects-section {
    padding: 12px 16px 28px;
  }

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

  .side-card {
    height: auto;
  }

  /* Popovers don't work on touch — show full text inline instead */
  .project-popover {
    display: none;
  }

  .project-desc {
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
  }
}
