/* === FONTS === */

@font-face {
  font-display: swap;
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 300;
  src: url('assets/fonts/public-sans-v21-latin-300.woff2') format('woff2'); 
}

@font-face {
  font-display: swap; 
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/public-sans-v21-latin-regular.woff2') format('woff2'); 
}

@font-face {
  font-display: swap; 
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 700;
  src: url('assets/fonts/public-sans-v21-latin-700.woff2') format('woff2'); 
}

/* === CSS RESET === */

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

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1, h2,
h3, h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input, button,
textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

:root {
  /* == COLOR PALLETTE == */

  /* Primary Color */
  --clr-cyan-400: hsl(192, 69%, 51%);
  --clr-green-500: hsl(136, 64%, 51%);
  --clr-blue-950: hsl(233, 26%, 24%);
  
    /* Neutral Colors */
  --clr-gray-50: hsl(0, 0%, 98%);
  --clr-gray-100: hsl(220, 16%, 96%);
  --clr-gray-600: hsl(233, 8%, 62%);
  --clr-white: hsl(0, 100%, 100%);
  --gradient: linear-gradient(135deg, hsl(192, 69%, 51%), hsl(136, 64%, 51%));
  
  
  /* == TYPOGRAPHY == */

  /* font family */
  --ff-body: 'Public Sans', sans-serif;

  /* font size */
  --fs-body: 1.125rem;

  /* font weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-bold: 700;

  /* Spacing */
  --space-sr:  0.0625rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xlg: 2.5rem;
  --space-xxlg: 3rem;
}

@media (prefers-reduced-motion: reduce) {
  .bar, nav a, nav a::after, .article__card, .article__title--link, .overlay {
    transition: none;
  }
}

@media (hover: hover) {
  .nav__bar a:hover { color: var(--dark-blue); }
  .nav__bar a:hover::after { opacity: 1; transform: scaleX(1); }
  .btn:hover { opacity: 0.75; }
  .footer .footer__nav a:hover { color: var(--clr-green-500); }
  .article__card:hover {transform: scale(1.1);}
  .article__title--link:hover{color: var(--clr-green-500);}
}


body {
  min-height: 100vh;
  color: var(--clr-blue-950);
  font-family: var(--ff-body);
  line-height: 1.5;
}

.site__header {
  position: sticky;
  top: 0;
  height: 4rem;
  width: 100%;
  background: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(var(--space-md), 5vw, 6rem);
  box-shadow: 0 var(--space-sr) 0  rgba(0,0,0,0.07);
  z-index: 200;
}

.overlay {
  position: absolute;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  width: calc(100% - var(--space-xxlg));
  background: var(--clr-white);
  border-radius: var(--space-xs);
  padding: var(--space-xs) var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0.3125rem 0.3125rem 0.3125rem rgba(0,0,0,0.07);
  z-index: 100;
}

.overlay.open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.overlay.open .nav__bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding-block: var(--space-sm);
}

.overlay.open .nav__bar a {
  font-size: clamp(1.5rem, 1.5vw, 2rem);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.site__header .nav__bar {
  display: none;
}

.site__header nav a {
  text-decoration: none;
  font-size: 1.2rem;
  color: var(--clr-blue-950);
  position: relative;
  height: 4rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

/* Gradient underline slides in on hover */
.site__header nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.1875rem;
  background: var(--gradient);
  border-radius: 0.125rem 0.125rem 0 0;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: opacity 0.2s, transform 0.25s;
}

.btn {
  display: inline-block;
  padding: 0.65rem var(--space-sm);
  border-radius: 6.25rem;
  font-size: 0.8em;
  font-weight: var(--fw-bold);
  font-family: inherit;
  text-decoration: none;
  background: var(--gradient);
  color: var(--clr-white);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn1 {
  display: none;
}

.menu--btn {
  top: 1.2rem;
  right: 1.2rem;
  z-index: 200;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem;
  -webkit-tap-highlight-color: transparent;
}

.bar {
  display: block;
  width: 1.625rem;
  height: 0.125rem;
  background: var(--clr-blue-950);
  border-radius: 0.125rem;
  transition: transform 0.35s ease;
  transform-origin: center;
}

.menu--btn.open .bar:nth-child(1) {
  transform: translateY(0.4375rem) rotate(45deg);
}

.menu--btn.open .bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu--btn.open .bar:nth-child(3) {
  transform: translateY(-0.4375rem) rotate(-45deg);
}

.main__content {
  background: var(--clr-gray-100);
}

.hero__container {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--clr-gray-50);
}

.hero__visual {
  position: relative;
  height: 21.875rem;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: url('assets/images/bg-intro-mobile.svg') center / cover no-repeat;
}

.hero__mockup {
  position: absolute;
  z-index: 2;
  width: 100%;
  height: 100%;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem var(--space-md) var(--space-lg);
  margin-block-start: -5rem;
}

.hero__content--heading {
  font-size: clamp(2.3rem, 3.5vw, 5rem);
  font-weight: var(--fw-regular);
  line-height: 1.15;
  color: var(--dark-blue);
  margin-block-end: 1.3rem;
  text-align: center;
}

.hero__content p {
  font-size: clamp(0.9rem, 1.5vw, var(--space-lg));
  line-height: 1.75;
  color: var(--clr-gray-600);
  max-width: 38ch;
  margin-block-end: 1rem;
}

.hero__content button {
  align-self: center;
}

.offers {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--clr-gray-100);
  padding: var(--space-md);
}

.offers__heading {
  font-size: clamp(var(--space-md), 2.5vw, var(--space-xxlg));
  font-weight: var(--fw-light);
}

.offers p {
  color: var(--clr-gray-600);
}

.intro, .card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.card {
  margin-block: var(--space-md);
}

.card .card__heading {
  font-weight: var(--fw-regular);
}

.articles {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-block-start: var(--space-lg);
  background: var(--clr-gray-50);
}

.articles__heading {
  font-size: clamp(var(--space-md), 2.5vw, var(--space-xxlg));
  font-weight: var(--fw-regular);
  margin-block: clamp(var(--space-md), 2.5vw, var(--space-xxlg));
  text-align: center;
} 

.article__wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.article__card .image--container {
  width: 100%;
  height: 11.25rem;
}

.article__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article__card {
  width: 90%;
  max-width: clamp(24rem, 30vw, 40rem);
  height: auto;
  max-height: fit-content;
  background: var(--clr-white);
  border-top-left-radius: var(--space-sm);
  border-top-right-radius: var(--space-sm);
  box-shadow: 0.3125rem 0.3125rem 0.3125rem rgba(0,0,0,0.04);
  padding-block-end: var(--space-xs);
  margin-block-end: var(--space-md);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.article__card:last-child {
  margin-block-end: 4rem;
}

.text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
}

.text p {
  color: var(--clr-gray-600);
  font-size: 1.15rem;
}

.text .author {
  font-size: 0.9rem;
}

.article__title {
  text-wrap: wrap;
}

.article__title--link {
  width: 100%;
  color: inherit;
  font-weight: var(--fw-regular);
  text-decoration: none; 
  cursor: pointer;
  transition: color 0.3s ease;
}

.footer {
  width: 100%;
  height: auto;
  background: var(--clr-blue-950);
  color: var(--clr-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding-block: 4rem;
}

.logo__socials--container, .footer__social--links {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.footer__social--links {
  flex-direction: row;
  gap: var(--space-sm);
  list-style: none;
  cursor: pointer;
  margin-block-end: var(--space-md);
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__nav--first, .footer__nav--second {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  list-style: none;
  gap: var(--space-sm);
}

.footer__nav--second {
  margin-block-end: var(--space-xs);
}

.footer__nav--first li a, .footer__nav--second li a {
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: var(--clr-white);
}

.footer--last {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.footer--last .btn3 {
  align-self: center;
  padding: 0.8rem var(--space-md);
  font-size: 1.2em;
  margin-block-end: 0.5rem;
}

@media screen and (min-width:29.375rem) {
  .hero__visual {
    height: 50rem;
  }

  .hero__content {
    margin-block-start: -7rem;
  }

  .hero__content h1 {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }
}

@media screen and (min-width:56.25rem) {

  .hero__content {
    margin-block-start: clamp(-5rem, 6vw, -6rem);
  }
}

@media screen and (min-width:54.375rem) {
  .site__header .nav__bar {
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }

  .btn1 {
    display: block;
    padding: 0.8rem var(--space-md);
    font-size: 1em;
  }

  .menu--btn {
    display: none;
  }

  .btn2 {
    padding: 0.8rem 1.5rem;
    font-size: 1em;
  }

  .offers {
    margin: var(--space-lg);
    border-radius: var(--space-sm);
    padding: var(--space-xlg) var(--space-lg);
  }

  .article__wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    place-items: center;
    align-items: stretch;
  }
}

@media screen and (min-width:64rem) {

  .site__header {
    justify-content: space-around;
    gap: var(--space-xxlg);
  }

  .logo--container {
    margin-inline-start: - var(--space-xxlg);
  }
  
  .site__header .nav__bar {
    gap: var(--space-xlg);
  }

  .hero__container {
    width: 100%;
    grid-template-columns: 1fr 1.8fr;
    align-items: center;
  }

  .hero__visual{
    height: 50rem;
    order: 2;
    overflow: hidden;
  }

  .hero__bg {
    position: absolute;
    background: url('assets/images/bg-intro-desktop.svg') left / cover no-repeat;
    min-width: 100%;
    min-height: 50rem;
    transform: translate(6.25rem, -11.25rem);
    left: 0;
  }

  .hero__mockup {
    width: 70%;
    min-height: 12.5rem;
    top: 50%;
    left: 75%;
    transform: translate(-50%, -50%);
  }

  .hero__content {
    margin-block-start: -10rem;
    margin-inline-start: 7rem;
    padding: var(--space-sm);
    gap: var(--space-lg);
  }

  .hero__content h1 {
    text-align: start;
  }

  .hero__content p {
    width: 100%;
    font-size: 1.2rem;
  }

  .hero__content .btn2 {
    align-self: flex-start;
  }

  .offers {
    align-items: flex-start;
    margin-block: -8rem 4rem;
    padding-inline: 7rem;
  }

  .intro {
    width: 60%;
    align-items: flex-start;
    margin-block: 6rem 4rem;
  }

  .offers__heading {
    margin-block-end: 1.3rem;
  }

  .intro p {
    font-size: 1.3rem;
  }

  .offers .cards {
    display: flex;
    align-items: stretch;
    gap: var(--space-sm);
    margin-block-start: - var(--space-lg);
  }

  .card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-xs);
    gap: 1.8rem;
  }


  .articles__heading {
    align-self: flex-start;
    margin-inline-start: 7rem;
    padding-inline-start: 1.5rem;
  }

  .article__wrapper {
    grid-template-columns: repeat(4, 1fr);
    margin-inline: 7rem;
    gap: 0;
  }

  .article__card {
    margin-block-end: 0;
  }

  .article__card .image--container {
    height: 12.5rem;
  }

  .footer {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    gap: var(--space-xxlg);
    padding: var(--space-xxlg) 5rem;
  }

  .footer--first {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
  }

  .logo__socials--container {
    align-items: center;
    justify-content: center;
    gap: 4rem;
    margin-block-start: 1.3rem;
  }

  .footer__nav {
    flex-direction: row;
    gap: 4rem;
  }

  .footer__nav--first, .footer__nav--second {
    align-items: start;
    margin-block-end: 0;
  }

  .footer__nav--first li a, .footer__nav--second li a {
    font-size: 1.4rem;
    white-space: nowrap;
  }

  .footer--last button {
    align-self: flex-end;
  }

  .footer__nav .footer__nav--links {
    display: flex;
    flex-direction: row;
    gap: 10rem;
  }

  .footer--last .copyright {
    width: 100%;
    color: var(--clr-gray-600);
    white-space: nowrap;
    margin-inline-end: 2rem;
  }
}


