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

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
  font-family: 'Courier New', monospace;
  background: var(--bg-primary, #000);
  color: var(--text-primary, #b6fcb6);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

:root {
  --bg-primary: #000;
  --bg-secondary: rgba(0, 0, 0, 0.85);
  --text-primary: #b6fcb6;
  --text-secondary: #a6e9a6;
  --accent-green: #0f0;
  --accent-light: #ccffcc;
  --border-color: #0f0;
  --shadow-color: rgba(0, 255, 0, 0.1);
}

[data-theme="light"] {
  --bg-primary: #f0f8f0;
  --bg-secondary: rgba(255, 255, 255, 0.95);
  --text-primary: #2d5a2d;
  --text-secondary: #4a7c4a;
  --accent-green: #2d8f2d;
  --accent-light: #1a5a1a;
  --border-color: #2d8f2d;
  --shadow-color: rgba(45, 143, 45, 0.1);
}

body {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

body.loaded {
  opacity: 1;
}

canvas#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.main-nav {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid #0f0;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.main-nav a {
  color: #b6fcb6;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: bold;
}

.main-nav a:hover {
  background: rgba(0, 255, 0, 0.1);
  color: var(--accent-light);
  text-shadow: 0 0 3px var(--accent-green);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(0, 255, 0, 0.1);
  transform: scale(1.1);
}

.content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.85);
  max-width: 920px;
  margin: auto;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
}

h1,
h2 {
  color: #ccffcc;
  text-shadow: 0 0 3px #0f0;
  margin-bottom: 0.8rem;
}

p {
  color: #a6e9a6;
  margin-bottom: 1rem;
}

.subtitle {
  font-style: italic;
  color: #6fdc6f;
}

.impact {
  font-size: 1.1rem;
  font-weight: bold;
  color: #8f8;
  margin-top: 1rem;
}

section {
  padding-left: 1rem;
  border-left: 3px solid #0f0;
  margin-bottom: 2rem;
  animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.contact-button,
.social-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  color: #bfffbf;
  background: rgba(0, 255, 0, 0.07);
  border: 1px solid #0f0;
  text-decoration: none;
  border-radius: 8px;
  margin-top: 1rem;
  margin-right: 1rem;
  font-weight: bold;
  transition: all 0.25s ease;
  box-shadow: 0 0 5px #0f0;
}

.contact-button:hover,
.social-button:hover {
  background: rgba(0, 255, 0, 0.2);
  box-shadow: 0 0 12px #0f0;
  color: #cfc;
}

.skills-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.skills-overview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-category {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 0 15px var(--shadow-color);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.skill-category.animate {
  opacity: 1;
  transform: translateY(0);
}

.skill-category h3 {
  color: var(--accent-light);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--accent-green);
  padding-bottom: 0.5rem;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-name {
  color: var(--text-secondary);
  font-weight: bold;
  font-size: 0.9rem;
}

.skill-bar {
  height: 8px;
  background: rgba(0, 255, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-light));
  border-radius: 4px;
  width: 0;
  transition: width 1.5s ease;
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  animation: shimmer 2s infinite;
}

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

.tech-stack-cloud {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 200px;
}

.tech-item {
  background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 0, 0.05));
  color: var(--text-primary);
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
  font-weight: bold;
  opacity: 0;
  transform: translateX(50px);
  animation: slideIn 0.6s ease forwards;
  animation-delay: var(--delay);
  transition: all 0.3s ease;
}

.tech-item:hover {
  transform: translateX(50px) scale(1.05);
  box-shadow: 0 0 15px var(--shadow-color);
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.contact-form input,
.contact-form textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #0f0;
  color: #dff;
  padding: 0.6rem;
  font-family: monospace;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #6f6;
  outline: none;
  box-shadow: 0 0 6px #0f0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 0 15px var(--shadow-color);
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
  transition: left 0.6s ease;
}

.project-card:hover::before {
  left: 100%;
}

.project-card.animate {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  box-shadow: 0 0 25px var(--shadow-color);
  transform: translateY(-8px);
  border-color: var(--accent-light);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.project-header h3 {
  color: var(--accent-light);
  font-size: 1.2rem;
  margin: 0;
}

.project-status {
  background: var(--accent-green);
  color: var(--bg-primary);
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.project-link:hover {
  background: rgba(0, 255, 0, 0.1);
  transform: translateY(-2px);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-stack span {
  background: rgba(0, 255, 0, 0.1);
  color: #6fdc6f;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 255, 0, 0.3);
}

@media screen and (max-width: 768px) {
  .main-nav {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 2rem;
  }
  
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .skills-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .tech-stack-cloud {
    order: -1;
    min-width: auto;
  }
  
  .tech-item {
    display: inline-block;
    margin: 0.3rem;
    transform: translateX(0);
  }
}

@media screen and (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.6rem;
  }

  .contact-button {
    display: block;
    margin-bottom: 1rem;
  }
  
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .project-links {
    flex-wrap: wrap;
  }
  
  .content {
    padding: 1rem;
  }
}
