/* main.css */
/* Base theme variables */
:root {
  /* Light theme variables */
  --bg: hsl(0, 0%, 95%);
  --card-bg: hsla(0, 0%, 100%, 0.7);
  --text: hsl(220, 20%, 20%);
  --accent: hsl(210, 100%, 50%);
  --glass: rgba(0, 0, 0, 0.05);
  --shadow: rgba(0, 0, 0, 0.1);
  --gradient-1: hsl(210, 100%, 90%);
  --gradient-2: hsl(280, 100%, 90%);
}

[data-theme="dark"] {
  --bg: hsl(220, 15%, 10%);
  --card-bg: hsla(220, 15%, 20%, 0.6);
  --text: hsl(0, 0%, 95%);
  --accent: hsl(200, 80%, 60%);
  --glass: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.5);
  --gradient-1: hsl(220, 30%, 15%);
  --gradient-2: hsl(280, 30%, 15%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  background-attachment: fixed;
  background-size: 400% 400%;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s ease;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

header.hero {
  padding: 6rem 2rem 4rem;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

header.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--accent);
  letter-spacing: -1px;
  animation: slideDown 0.8s ease backwards;
}

header.hero p {
  margin-top: 1rem;
  font-size: clamp(1rem, 2vw, 1.5rem);
  opacity: 0.8;
  animation: slideUp 0.8s ease 0.2s backwards;
}

nav.nav {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  animation: fadeIn 1s ease 0.4s backwards;
}

nav.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: var(--glass);
  backdrop-filter: blur(5px);
  border: 1px solid transparent;
}

nav.nav a:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 20px var(--shadow);
}

button#theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--glass);
  backdrop-filter: blur(5px);
  border: 1px solid var(--glass);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.3s, background 0.3s;
  z-index: 100;
}

button#theme-toggle:hover {
  transform: rotate(30deg) scale(1.1);
  background: var(--card-bg);
}

main {
  padding: 0 1.5rem;
}

section.card {
  background: var(--card-bg);
  margin: 3rem auto;
  padding: 2.5rem;
  max-width: 900px;
  border-radius: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass);
  box-shadow: 0 10px 40px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(30px);
}

section.card.visible {
  animation: slideUpFade 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

section.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 50px var(--shadow);
}

section.card h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 2rem;
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

section.card h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

section.card:hover h2::after {
  width: 100%;
}

section.card ul {
  padding-left: 1.5rem;
}

section.card li {
  margin-bottom: 0.8rem;
}

section.card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

section.card a::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--accent);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

section.card a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

footer.footer {
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
  opacity: 0.8;
  margin-top: 4rem;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  header.hero {
    min-height: 50vh;
    padding: 5rem 1rem 3rem;
  }

  section.card {
    padding: 1.5rem;
    margin: 2rem auto;
  }

  section.card h2 {
    font-size: 1.5rem;
  }
}