:root {
  --background: #ffffff;
  --foreground: #171717;
  --card: #ffffff;
  --card-foreground: #171717;
  --popover: #ffffff;
  --popover-foreground: #171717;
  --primary: #171717;
  --primary-foreground: #fafafa;
  --secondary: #f3f4f6;
  --secondary-foreground: #171717;
  --muted: #f3f4f6;
  --muted-foreground: #737373;
  --accent: #f3f4f6;
  --accent-foreground: #171717;
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  --border: #e5e7eb;
  --input: #e5e7eb;
  --ring: #171717;
  --radius: 0.5rem;
}

.dark {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #171717;
  --card-foreground: #fafafa;
  --popover: #171717;
  --popover-foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #171717;
  --secondary: #262626;
  --secondary-foreground: #fafafa;
  --muted: #262626;
  --muted-foreground: #a3a3a3;
  --accent: #262626;
  --accent-foreground: #fafafa;
  --destructive: #ef4444;
  --destructive-foreground: #fafafa;
  --border: #262626;
  --input: #262626;
  --ring: #d4d4d4;
}

/* Glassy navbar */
header {
  top: 0;
  left: 0;
  right: 0;
  height: 3.5rem;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.78) 100%
  ) !important;
  backdrop-filter: blur(20px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(200%) !important;
  border-bottom: 1px solid rgba(229, 231, 235, 0.6) !important;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -2px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.6) !important;
}

.dark header {
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.88) 0%,
    rgba(10, 10, 10, 0.72) 100%
  ) !important;
  border-bottom: 1px solid rgba(38, 38, 38, 0.6) !important;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.2),
    0 2px 4px -2px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
}

header nav {
  height: 100%;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

/* Navigation button */
.nav-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  color: var(--foreground);
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.nav-btn .icon {
  height: 1.25rem;
  width: 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .nav-btn {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
  }

  .nav-btn .icon {
    height: 1.125rem;
    width: 1.125rem;
  }
}

* {
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Mobile nav */
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--foreground);
  background-color: var(--secondary);
  transition: all 0.2s ease;
}

.mobile-nav-btn:hover {
  background-color: var(--accent);
}

.mobile-nav-btn .icon {
  height: 1.25rem;
  width: 1.25rem;
}

/* Social buttons */
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--muted-foreground);
  transition: all 0.2s ease;
}

.social-btn:hover {
  border-color: var(--primary);
  background-color: var(--primary);
  color: var(--primary-foreground);
  transform: translateY(-1px);
}

/* Skill pills (in project cards) */
.skill-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background-color: var(--secondary);
  padding: 0.25rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  color: var(--secondary-foreground);
  white-space: nowrap;
}

/* Skill tags — matches adithyask.com style */
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background-color: var(--secondary);
  padding: 0.375rem 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--secondary-foreground);
  white-space: nowrap;
  cursor: default;
  transition: all 0.2s ease;
}

.skill-tag:hover {
  background-color: var(--accent);
}

.skill-tag.hidden-lib {
  display: none;
}

.skill-tag .icon {
  height: 0.875rem;
  width: 0.875rem;
  flex-shrink: 0;
}

/* Filter buttons */
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  background-color: var(--muted);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.filter-btn .icon {
  height: 0.875rem;
  width: 0.875rem;
  flex-shrink: 0;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  width: 1rem;
  height: 1rem;
  font-size: 0.625rem;
  background-color: var(--primary-foreground);
  color: var(--primary);
}

.filter-btn.active .filter-count {
  background-color: var(--primary-foreground);
  color: var(--primary);
}

/* Contribution calendar */
.activity-chart {
  --activity-gap: 4px;
  --activity-day: 11px;
  --activity-week: calc(var(--activity-day) * 7 + var(--activity-gap) * 6);
  --activity-0: #e2e8f0;
  --activity-1: #86efac;
  --activity-2: #4ade80;
  --activity-3: #22c55e;
  --activity-4: #16a34a;
  width: 100%;
  max-width: 100%;
  min-height: calc(var(--activity-week) + 2rem);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

@media (max-width: 640px) {
  .activity-chart {
    --activity-gap: 3px;
    --activity-day: 10px;
  }
}

.dark .activity-chart {
  --activity-0: #161b22;
  --activity-1: #0e4429;
  --activity-2: #006d32;
  --activity-3: #26a641;
  --activity-4: #39d353;
}

.activity-calendar {
  display: inline-flex;
  flex-direction: column;
  min-width: max-content;
}

.activity-months {
  display: flex;
  gap: var(--activity-gap);
  margin-bottom: var(--activity-gap);
  padding-left: calc(1.25rem + var(--activity-gap));
  font-size: 0.75rem;
  line-height: 1;
  color: var(--muted-foreground);
}

@media (max-width: 640px) {
  .activity-months {
    font-size: 0.625rem;
    padding-left: calc(1rem + var(--activity-gap));
  }
}

.activity-month {
  flex: 0 0 auto;
  text-align: left;
  overflow: hidden;
}

.activity-month-text {
  display: block;
  white-space: nowrap;
  padding-right: 0.375rem;
}

.activity-body {
  display: flex;
  gap: var(--activity-gap);
}

.activity-days-label {
  display: flex;
  flex-direction: column;
  gap: var(--activity-gap);
  font-size: 0.625rem;
  line-height: 1;
  color: var(--muted-foreground);
  height: var(--activity-week);
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .activity-days-label {
    font-size: 0.5rem;
  }
}

.activity-days-label span {
  display: block;
  height: var(--activity-day);
  line-height: var(--activity-day);
}

.activity-grid {
  display: flex;
  gap: var(--activity-gap);
}

.activity-week {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: var(--activity-gap);
}

.activity-day {
  width: var(--activity-day);
  height: var(--activity-day);
  border-radius: 0.125rem;
  background-color: var(--activity-0);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  transition: transform 0.15s ease;
}

.activity-day:hover {
  transform: scale(1.25);
  z-index: 10;
  outline: 1px solid var(--foreground);
}

.dark .activity-day {
  border-color: rgba(255, 255, 255, 0.06);
}

.activity-day[data-level="1"] { background-color: var(--activity-1); }
.activity-day[data-level="2"] { background-color: var(--activity-2); }
.activity-day[data-level="3"] { background-color: var(--activity-3); }
.activity-day[data-level="4"] { background-color: var(--activity-4); }

/* Animations */
section {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.5s ease-out forwards;
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }
section:nth-child(7) { animation-delay: 0.35s; }

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

/* Responsive improvements */
@media (max-width: 640px) {
  main {
    padding-top: 5rem;
  }

  .hero-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.8125rem;
  }

  .hero-content {
    text-align: center;
  }

  .hero-content .flex-wrap {
    justify-content: center;
  }

  .hero .flex.items-start {
    justify-content: center;
  }

  .section-title {
    font-size: 1.125rem;
  }

  .filter-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }

  .filter-btn .icon {
    height: 1rem;
    width: 1rem;
  }

  .skill-tag {
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
  }

  .skill-tag .icon {
    height: 1rem;
    width: 1rem;
  }

}

@media (min-width: 641px) and (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
}

/* Make sure images don't overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Better touch targets on mobile */
@media (max-width: 768px) {
  .nav-btn {
    padding: 0.5rem;
  }

  .nav-btn .icon {
    height: 1.125rem;
    width: 1.125rem;
  }

  .social-btn {
    height: 2.5rem;
    width: 2.5rem;
  }
}

/* Featured Open Source Work repo cards */
.repo-card {
  position: relative;
  display: block;
  border-radius: 0.75rem;
  background: var(--card);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.repo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.4) 0%,
    rgba(168, 85, 247, 0.3) 25%,
    rgba(236, 72, 153, 0.2) 50%,
    rgba(251, 146, 60, 0.2) 75%,
    rgba(99, 102, 241, 0.1) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.repo-card:hover::before {
  opacity: 1;
}

.repo-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.08),
    0 8px 10px -6px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(99, 102, 241, 0.1);
}

.repo-card-content {
  position: relative;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1rem;
  height: 100%;
  transition: background 0.3s ease;
}

.repo-card:hover .repo-card-content {
  background: linear-gradient(135deg, var(--card) 0%, var(--muted) 100%);
}

/* Decorative shimmer animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.repo-card-border {
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99, 102, 241, 0.15) 25%,
    rgba(168, 85, 247, 0.15) 50%,
    rgba(236, 72, 153, 0.15) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  opacity: 0;
  animation: shimmer 3s linear infinite;
  pointer-events: none;
}

.repo-card:hover .repo-card-border {
  opacity: 1;
}

/* Staggered fade-in for repo cards */
.opensource-grid .repo-card {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  animation: cardFadeIn 0.5s ease-out forwards;
}

.opensource-grid .repo-card:nth-child(1) { animation-delay: 0.05s; }
.opensource-grid .repo-card:nth-child(2) { animation-delay: 0.1s; }
.opensource-grid .repo-card:nth-child(3) { animation-delay: 0.15s; }
.opensource-grid .repo-card:nth-child(4) { animation-delay: 0.2s; }
.opensource-grid .repo-card:nth-child(5) { animation-delay: 0.25s; }
.opensource-grid .repo-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Decorative dots pattern for section */
#opensource {
  position: relative;
}

#opensource::before {
  content: '';
  position: absolute;
  top: 2rem;
  right: -1rem;
  width: 6rem;
  height: 6rem;
  background-image: radial-gradient(circle, rgba(99, 102, 241, 0.15) 1.5px, transparent 1.5px);
  background-size: 12px 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

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

  .repo-card {
    margin: 0;
  }

  #opensource::before {
    display: none;
  }
}
