@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;700&display=swap");

:root {
  --blue-950: hsl(233, 26%, 24%);
  --green-500: hsl(136, 64%, 51%);
  --cyan-400: hsl(192, 69%, 51%);
  --gray-600: hsl(233, 8%, 62%);
  --gray-100: hsl(220, 16%, 96%);
  --gray-50: hsl(0, 0%, 98%);
  --white: hsl(0, 100%, 100%);
}

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

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
}

body {
  font-family: "Public Sans", sans-serif;
  font-size: 14px;
  background-color: var(--gray-50);
  color: var(--blue-950);
}

main {
  text-align: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  background-color: var(--white);
  height: 64px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
}

.container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.nav {
  display: none;
}

/* Added underline effect for desktop nav items */
.nav__list {
  list-style: none;
  display: flex;
  gap: 2rem;
  height: 100%;
  align-items: center;
}

.nav__item {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
}

.nav__item a {
  color: var(--gray-600);
  transition: color 0.2s;
  padding: 0 0.25rem;
}

.nav__item a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--green-500), var(--cyan-400));
  opacity: 0;
  transition: opacity 0.3s;
}

.nav__item a:hover {
  color: var(--blue-950);
}

.nav__item a:hover::after {
  opacity: 1;
}

.header__cta {
  display: none;
}

/* Added close icon styling and toggle behavior */
.hamburger,
.close-icon {
  background: none;
  border: none;
  cursor: pointer;
  z-index: 200;
  padding: 0;
}

.close-icon {
  display: none;
}

.close-icon.active {
  display: block;
}

.hamburger.hidden {
  display: none;
}

/* ------------------------------------------------------------
   MOBILE MENU OVERLAY
-------------------------------------------------------------*/
.mobile-menu {
  text-align: center;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(45, 49, 77, 0.8), transparent);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu__panel {
  background: var(--white);
  padding: 2rem 1.5rem;
  margin: 1.5rem;
  border-radius: 8px;
}

.mobile-menu__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-menu__item a {
  color: var(--blue-950);
  font-size: 1.125rem;
  transition: color 0.3s ease-in-out;
}

.mobile-menu__item a:hover {
  color: var(--cyan-400);
}

/* ------------------------------------------------------------
   BUTTONS
-------------------------------------------------------------*/
.cta-btn {
  border: none;
  padding: 0.875rem 2.0063rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(15deg, var(--cyan-400), var(--green-500));
  transition: opacity 0.2s;
}

.cta-btn:hover {
  opacity: 0.7;
}

/* ------------------------------------------------------------
   HERO SECTION
-------------------------------------------------------------*/
.hero {
  width: 100%;
  position: relative;
  display: grid;
  grid-template-rows: 21.5rem auto;
}

.hero__image-wrapper {
  background-image: url(./images/bg-intro-mobile.svg);
  background-repeat: no-repeat;
  background-size: cover;
}

.hero__image-mockups {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 326px;
}

.hero__text {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 1.6rem;
  padding: 2.5rem 1.75rem 4rem;
}

.hero__title {
  font-size: clamp(2.3rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.2;
}

.hero__description {
  color: var(--gray-600);
  line-height: 1.5;
}

/* ------------------------------------------------------------
   WHY CHOOSE SECTION
-------------------------------------------------------------*/
.why {
  background: var(--gray-100);
}

.why__title {
  font-weight: 300;
  font-size: 2rem;
  line-height: 1.2;
}

.why__description {
  color: var(--gray-600);
  margin: 1rem 0 3rem;
  line-height: 1.5;
}

.why__benefits {
  display: grid;
  gap: 2rem;
}

.benefit-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 1.5rem;
}

.benefit-card__title {
  font-size: 1.5rem;
  font-weight: 300;
  margin-top: 1rem;
}

.benefit-card__text {
  color: var(--gray-600);
  line-height: 1.5;
}

/* ------------------------------------------------------------
   ARTICLES SECTION
-------------------------------------------------------------*/
.why,
.articles {
  padding: 4rem 1.5rem;
}

.article__figure {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.article__image {
  object-fit: cover;
  height: 100%;
  width: 100%;
}

.articles__title {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 3rem;
}

.articles__grid {
  display: grid;
  gap: 1.5rem;
}

.article {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
}

.article__content {
  text-align: start;
  padding: 1.5rem 2.1rem 1.75rem;
}

.article__author {
  font-size: 0.625rem;
  color: var(--gray-600);
}

.article__title {
  margin: 0.75rem 0;
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.3;
}

.article__title a {
  color: var(--blue-950);
  transition: color 0.3s;
}
.article__title a:hover {
  color: var(--green-500);
}

.article__text {
  color: var(--gray-600);
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   FOOTER
-------------------------------------------------------------*/
.footer__inner {
  background: var(--blue-950);
  color: var(--white);
  padding: 3.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.footer__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.footer__links {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.footer__links a {
  color: var(--white);
  font-weight: 300;
  transition: color 0.3s ease-in-out;
}

.footer__links a:hover {
  color: var(--green-500);
}

.footer__social {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer__social li {
  cursor: pointer;
  transition: transform 0.3s;
}
.footer__social li:hover {
  transform: translateY(-2px);
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer__copy {
  color: var(--gray-600);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------
   DESKTOP (min 768px)
-------------------------------------------------------------*/
@media (min-width: 768px) {
  /* Hero */
  .hero {
    text-align: left;
    display: grid;
    grid-template-rows: 26rem;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2rem;
    margin: 64px auto 0;
    padding: 0 0 0 11vw;
  }

  .hero__image-wrapper {
    width: 100%;
    height: 100%;
    order: 2;
    position: relative;
    background-image: url(./images/bg-intro-desktop.svg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: left 470px top -40px;
    background-attachment: fixed;
  }

  .hero__image-mockups {
    top: 50%;
    left: 20%;
    transform: translateY(-50%);
    width: 26rem;
  }

  .hero__text {
    max-width: 380px;
    align-items: flex-start;
    padding: 4rem 0;
    order: 1;
  }

  .hero__description {
    font-size: 1rem;
  }

  /* Why section */
  .why {
    text-align: left;
  }

  .why__title {
    font-size: 2.25rem;
  }

  .why__description {
    max-width: 600px;
    font-size: 1rem;
  }

  .why__benefits {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 4rem;
  }

  .benefit-card {
    align-items: flex-start;
    text-align: left;
  }

  /* Articles */
  .why,
  .articles,
  .footer__inner {
    padding: 5rem 10vw;
  }
  .article {
    transition: transform 0.3s;
  }

  .article:hover {
    transform: translateY(-5px);
  }

  .article__content {
    padding: 1.5rem 1.5rem 1.75rem;
  }

  .articles__title {
    text-align: left;
    font-size: 2.25rem;
  }

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

  /* Footer */
  .footer__inner {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr auto;
    align-items: start;
    text-align: left;
    gap: 3rem 7rem;
  }

  .footer__left {
    align-items: flex-start;
    gap: 3rem;
  }

  .footer__links {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    gap: 1.25rem 7rem;
    text-align: end;
  }

  .footer__bottom {
    grid-column: span 2;
  }

  .footer__copy {
    text-align: end;
  }
}
@media (min-width: 1024px) {
  .hamburger,
  .close-icon {
    display: none !important;
  }

  .nav,
  .header__cta {
    display: block;
  }

  header {
    padding: 0 10vw;
    right: auto;
    left: auto;
  }

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

@media (min-width: 1200px) {
  header {
    padding: 0 11vw;
  }

  .hero {
    grid-template-rows: 41rem;
    padding-left: 11vw;
  }

  .hero__text {
    max-width: 460px;
  }

  .hero__description,
  .why__description {
    font-size: 1.125rem;
  }

  .hero__image-wrapper {
    background-position: left 620px top -230px;
  }

  .hero__image-mockups {
    width: 100%;
    top: -160px;
    left: 22%;
    transform: none;
  }

  .why__title,
  .articles__title {
    font-size: 2.5rem;
  }

  .why__description {
    max-width: 650px;
  }

  .why,
  .articles {
    padding: 5rem 11vw;
  }

  .footer__inner {
    grid-template-columns: auto auto 2fr;
    grid-template-rows: initial;
    padding: 3rem 11vw;
    gap: 8rem;
  }

  .footer__links {
    text-align: start;
  }

  .footer__bottom {
    align-items: flex-end;
    justify-self: end;
    grid-column: initial;
  }

  .why__benefits,
  .articles__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
