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

:root {
  --bg-color: #1a1b26;
  --fg-color: #c0caf5;
  --accent-color: #5877E9; 
  --card-bg: #24283b;
  --card-bg-transparent: rgba(36, 40, 59, 0.5);
  --border-color: #414868;
  --header-bg: rgba(36, 40, 59, 0.2);
  --secondary-fg-color: #a9b1d6;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  background-color: var(--bg-color);
  color: var(--fg-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  position: relative;
}

header {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  width: auto;
  z-index: 100;
  
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  background-color: var(--header-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

nav {
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

main {
  padding: 0 2rem;
}

section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 6rem 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  background-color: transparent;
}

section:last-of-type {
  border-bottom: none;
}

footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 6rem 2rem;
  text-align: center;
}

h1, h2, h3 {
  color: var(--fg-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 { font-size: 3rem; }
h2 { font-size: 1.8rem; color: var(--accent-color); font-weight: 700; }
p { max-width: 70ch; color: var(--fg-color); }

.logo {
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
  font-weight: bold;
  color: var(--accent-color);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-svg {
  height: 1.5rem;
  width: 1.5rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: var(--fg-color);
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  display: inline-block;
}
.nav-menu a:hover {
  color: var(--accent-color);
  transform: scale(1.05);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  text-decoration: none;
  color: var(--accent-color);
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease-out;
}

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

.project-card {
  background-color: var(--card-bg-transparent);
  backdrop-filter: blur(5px);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.project-card h3 {
  color: var(--accent-color);
}

.project-card p a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--accent-color);
  transition: color 0.2s ease;
}

.project-card p a:hover {
  color: var(--fg-color);
  border-bottom-color: var(--fg-color);
}

.project-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  background-color: #3b4261;
  color: var(--fg-color);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.skill-category h3 {
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.skill-category ul {
  list-style: none;
}

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

#intro {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#intro h1 {
  color: var(--accent-color);
  text-shadow: none;
  animation: none;
  z-index: 1;
}

.intro-content {
  z-index: 1;
  position: relative;
}

.subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--secondary-fg-color);
  margin-bottom: 1rem;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  background: linear-gradient(-45deg, #1a1b26, #24283b, var(--accent-color), #414868);
  background-size: 400% 400%;
  animation: gradientBG 20s ease infinite;
  opacity: 0.3;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.show {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) {
  .project-card:hover, .button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  }
  .button:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
  }
}

.project-card:active, .button:active {
  transform: translateY(-2px);
  transition: transform 0.1s ease;
}

.hamburger {
  display: none;
  cursor: pointer;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
  background-color: var(--fg-color);
  border-radius: 2px;
}

@media(max-width: 768px) {
  header {
    left: 0.5rem;
    right: 0.5rem;
  }
  
    .hamburger { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 44px; height: 44px; transition: background-color 0.2s ease; }
    .bar { margin: 3px auto; width: 25px; }

    .hamburger.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { transform: translateX(-30px); opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

  .nav-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 10px);
    gap: 0;
    flex-direction: column;
    background-color: var(--card-bg);
    width: 90%;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 50;
  }

  .nav-menu.active {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  }
  
  .nav-menu li {
    padding: 1rem 0;
    width: 100%;
  }

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