:root {
  /* Nord color palette */
  --nord0: #2e3440;
  --nord1: #3b4252;
  --nord2: #434c5e;
  --nord3: #4c566a;
  --nord4: #d8dee9;
  --nord5: #e5e9f0;
  --nord6: #eceff4;
  --nord7: #8fbcbb;
  --nord8: #88c0d0;
  --nord9: #81a1c1;
  --nord10: #5e81ac;
  --nord11: #bf616a;
  --nord12: #d08770;
  --nord13: #ebcb8b;
  --nord14: #a3be8c;
  --nord15: #b48ead;

  /* Light theme (lighter versions of Nord dark colors) */
  --light-bg: #4a5568;
  --light-card: #5a6478;
  --light-element: #657086;
  --light-hover: #7b8698;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  transition: background-color 0.3s ease;
}

.dark-mode {
  background-color: var(--nord0);
  color: var(--nord6);
}

.light-mode {
  background-color: var(--light-bg);
  color: var(--nord6);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
}

.theme-toggle {
  background-color: var(--nord3);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--nord6);
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.light-mode .theme-toggle {
  background-color: var(--light-hover);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.hidden {
  display: none;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 5rem;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--nord4);
}

.primary-button {
  background-color: var(--nord8);
  color: var(--nord0);
  border: none;
  border-radius: 9999px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.light-mode .primary-button {
  background-color: var(--nord8);
  color: var(--nord6);
}

.primary-button:hover {
  transform: scale(1.05);
}

.primary-button:active {
  transform: scale(0.95);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  margin-bottom: 5rem;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background-color: var(--nord1);
  border-radius: 1rem;
  padding: 2rem;
  transition: transform 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
}

.light-mode .card {
  background-color: var(--light-card);
}

.card:hover {
  transform: translateY(-10px);
  background-color: var(--nord3);
}

.light-mode .card:hover {
  background-color: var(--light-hover);
}

.card-icon {
  margin-bottom: 1rem;
}

.sparkles-icon {
  color: var(--nord8);
}

.sun-icon {
  color: var(--nord13);
}

.moon-icon {
  color: var(--nord15);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--nord4);
}

/* Interactive Playground */
.playground {
  background-color: var(--nord1);
  border-radius: 1.5rem;
  padding: 2.5rem;
  margin-bottom: 5rem;
  text-align: center;
}

.light-mode .playground {
  background-color: var(--light-card);
}

.playground h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.playground-container {
  position: relative;
  height: 300px;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: var(--nord2);
}

.light-mode .playground-container {
  background-color: var(--light-element);
}

.bubble-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.playground-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto; /* Add scrolling */
  max-height: 100%; /* Ensure it doesn't exceed container */
}

.playground-text p {
  font-size: 1rem;
  max-width: 800px;
}

/* Projects Grid */
.projects h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .playground-text {
    padding: 1rem;
  }
  
  .playground-text p {
    font-size: 0.9rem;
  }
}

.project-card {
  background-color: var(--nord1);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.light-mode .project-card {
  background-color: var(--light-card);
}

.project-card:hover {
  transform: scale(1.03);
}

.project-image {
  height: 200px;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-content {
  padding: 1.5rem;
}

.project-content h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.project-content p {
  margin-bottom: 1rem;
  color: var(--nord4);
}

.project-link {
  color: var(--nord8);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Footer */
.footer {
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(76, 86, 106, 0.2);
  text-align: center;
  color: var(--nord4);
}

.light-mode .footer {
  border-top-color: rgba(123, 134, 152, 0.2);
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.slide-up {
  animation: slideUp 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bubble animation */
.bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: bubbleFloat 2s ease-out forwards;
}

@keyframes bubbleFloat {
  0% {
    transform: scale(0);
    opacity: 0.7;
  }
  100% {
    transform: scale(1) translate(var(--tx), var(--ty));
    opacity: 0;
  }
}