/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */

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

:root {
  /* Dark Theme (Default) */
  --bg-primary: #0a0e27;
  --bg-secondary: #151932;
  --bg-card: #0b0d18;
  --text-primary: #ffffff;
  --text-secondary: #b4b4c8;
  --accent-red: #dc2626;
  --accent-red-hover: #ef4444;
  --border-color: #2d3350;
  --shadow: rgba(0, 0, 0, 0.3);
}

body.light-theme {
  /* Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #ffffff;
  --text-primary: #0a0e27;
  --text-secondary: #4a5568;
  --accent-red: #dc2626;
  --accent-red-hover: #ef4444;
  --border-color: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Oxygen", "Ubuntu", "Cantarell", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */

.navbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
  position: relative;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  order: 1;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
  order: 2;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-red);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-red);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  order: 3;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background-color: var(--bg-card);
  border-color: var(--accent-red);
}

.theme-icon {
  display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  order: 4;
  margin-left: auto;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 20px;
}

.hero-content {
  max-width: 800px;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.ownership-line {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-style: italic;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: inline-block;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--accent-red);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 2px solid var(--accent-red);
}

.btn-secondary:hover {
  background-color: var(--accent-red);
  color: #ffffff;
  transform: translateY(-2px);
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
  padding: 5rem 20px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 3rem;
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.projects-section {
  background-color: var(--bg-secondary);
}

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

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

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

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.project-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-completed {
  background-color: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.status-progress {
  background-color: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

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

.tech-tag {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.project-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-red);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--accent-red-hover);
}

.project-link svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about-section {
  background-color: var(--bg-primary);
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

/* ============================================
   TECH STACK SECTION
   ============================================ */

.techstack-section {
  background-color: var(--bg-secondary);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.tech-item {
  text-align: center;
  padding: 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.tech-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-red);
  box-shadow: 0 4px 12px var(--shadow);
}

.tech-icon {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}

.tech-name {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact-section {
  background-color: var(--bg-primary);
  text-align: center;
}

.contact-message {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  min-width: 150px;
  transition: all 0.3s ease;
}

.contact-link:hover {
  border-color: var(--accent-red);
  transform: translateY(-5px);
  box-shadow: 0 4px 12px var(--shadow);
}

.contact-link svg {
  color: var(--accent-red);
}

.contact-link span {
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 20px;
  text-align: center;
}

.footer p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer-brand {
  font-weight: 700;
  color: var(--text-primary);
}

.footer-brand .brace {
  color: var(--accent-red);
}

.footer-brand .labs {
  color: var(--accent-red);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  /* Navigation */
  .nav-container {
    flex-wrap: nowrap;
  }

  .nav-links {
    position: fixed;
    top: 73px;
    right: -100%;
    background-color: var(--bg-secondary);
    flex-direction: column;
    width: 100%;
    padding: 2rem;
    gap: 1.5rem;
    transition: right 0.3s ease;
    border-top: 1px solid var(--border-color);
    align-items: flex-start;
    order: 2;
  }

  .nav-links.active {
    right: 0;
  }

  .mobile-menu-toggle {
    display: flex;
    order: 4;
    margin-left: auto;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .theme-toggle {
    order: 3;
  }

  /* Hero Section */
  .hero-title {
    font-size: 2.5rem;
  }

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

  .hero-description {
    font-size: 1rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  /* Section Titles */
  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  /* Projects Grid */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Tech Grid */
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
  }

  /* Contact Links */
  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-link {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

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

  .section {
    padding: 3rem 20px;
  }

  .project-card {
    padding: 1.5rem;
  }

  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus Styles */
a:focus,
button:focus {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}
