/* Hero section */
.hero {
  background: linear-gradient(
    135deg,
    var(--bg-color) 0%,
    var(--bg-gradient-end) 100%
  );
  padding: 6rem 0 5rem;
  overflow: hidden;
  position: relative;
  color: var(--heading-color);
  border-bottom: 1px solid var(--border-color);
}

.hero .container {
  display: flex;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 2;
}

.hero-content {
  flex: 1;
  max-width: 55%;
  text-align: left;
  animation: fadeInLeft 1s ease-out;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--heading-color);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--primary-color);
}

.hero p.subtitle {
  font-size: 1.25rem;
  color: var(--text-color);
  max-width: 100%;
  margin: 0 0 2.5rem 0;
}

.hero-cta {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
}

.hero-image-container {
  flex-shrink: 0;
  width: 40%;
  max-width: 450px;
  animation: fadeInRight 1s ease-out;
}

.hero-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 99px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Features section */
.features {
  padding: 5rem 0;
  background-color: var(--subtle-bg);
  border-top: 1px solid var(--border-color);
}

.features h2 {
  text-align: center;
  margin-bottom: 3.5rem;
  color: var(--heading-color);
  font-size: 2.2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background-color: var(--bg-color);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent,
    rgba(249, 168, 37, 0.5),
    transparent 30%
  );
  animation: rotate var(--border-anim-speed) linear infinite paused;
  z-index: -2;
  border-radius: inherit;
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-color);
  z-index: -1;
  border-radius: inherit;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: transparent;
}

.feature-card:hover::before {
  animation-play-state: running;
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: inline-block;
  position: relative;
  z-index: 2;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--primary-light);
  position: relative;
  z-index: 2;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--subtle-text);
  position: relative;
  z-index: 2;
}

/* Code highlight section */
.code-highlight {
  padding: 5rem 0;
  background-color: var(--bg-color);
  border-top: 1px solid var(--border-color);
}

.code-highlight h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--heading-color);
  font-size: 2.2rem;
}

.code-highlight pre {
  background-color: var(--code-bg);
  color: #abb2bf;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  font-size: 0.95em;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  line-height: 1.5;
}

.code-highlight pre code .keyword {
  color: #c678dd;
}
.code-highlight pre code .type {
  color: #e5c07b;
}
.code-highlight pre code .string {
  color: #98c379;
}
.code-highlight pre code .number {
  color: #d19a66;
}
.code-highlight pre code .func {
  color: #61afef;
}
.code-highlight pre code .package {
  color: #56b6c2;
}
.code-highlight pre code .comment {
  color: #5c6370;
  font-style: italic;
}

/* CTA section */
.cta-section {
  background-color: var(--subtle-bg);
  color: var(--text-color);
  padding: 5rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--heading-color);
}

.cta-section p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  color: var(--subtle-text);
}

.cta-section .hero-cta {
  justify-content: center;
}

.cta-section .btn-secondary {
  background-color: var(--primary-color);
  color: var(--bg-color);
  border-color: var(--primary-color);
}

.cta-section .btn-secondary:hover {
  background-color: var(--primary-light);
  color: var(--bg-color);
}

/* Animations */
@keyframes rotate {
  100% {
    transform: rotate(1turn);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive styles for homepage */
@media (max-width: 992px) {
  .hero .container {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .hero-image-container {
    display: none;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
    animation: none;
  }

  .hero p.subtitle {
    margin-left: auto;
    margin-right: auto;
    max-width: 650px;
  }

  .hero-cta {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .main-header .container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .main-nav ul {
    justify-content: center;
    gap: 1rem;
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p.subtitle {
    font-size: 1.1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .features,
  .code-highlight,
  .cta-section {
    padding: 4rem 0;
  }

  .features h2,
  .code-highlight h2,
  .cta-section h2 {
    font-size: 1.8rem;
  }

  .features h2 {
    margin-bottom: 2.5rem;
  }

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