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

:root {
  --Soft-orange: hsl(35, 77%, 62%);
  --Soft-red: hsl(5, 85%, 63%);
  --Off-white: hsl(36, 100%, 99%);
  --Grayish-blue: hsl(233, 8%, 79%);
  --Dark-grayish-blue: hsl(236, 13%, 42%);
  --Very-dark-blue: hsl(240, 100%, 5%);
  --font-size: 15px;
  --font-family: 'Inter', sans-serif;
  --weight-regular: 400;
  --weight-bold: 700;
  --weight-extra-bold: 800;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--Off-white);
  font-family: var(--font-family);
}

.header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 4rem;
  width: 80rem;
  max-width: 80rem;
  padding: 6rem 4rem 0 4rem;
}

nav {
  justify-self: end;
}

nav a {
  margin-left: 2.4rem;
  text-decoration: none;
  color: var(--Dark-grayish-blue);
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: all .5s ease-in-out;
}

nav a:hover,
.new h3:hover {
  color: var(--Soft-orange);
}

main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 34.5rem 12rem;
  margin-bottom: 5rem;
  column-gap: 0rem;
  row-gap: 5.5rem;
  width: 80rem;
  max-width: 80rem;
  padding: 0 4rem 0 4rem;
}

.hero {
  grid-area: 1 / 1 / 1 / span 2;
  display: grid;
  grid-template-columns: 23rem 23rem;
  grid-template-rows: 10rem 10rem 10rem;
  row-gap: 2rem;
}

picture {
  grid-area: 1 / 1 / span 2 / span 2;
  object-fit: contain;
  overflow: hidden;
}

picture img {
  width: 100%;
  height: 100%;
}

.hero-text {
  grid-area: 3 / 1 / 3 / span 2;
  display: grid;
  grid-template-columns: 18rem 21rem;
  column-gap: 5rem;
}

h1 {
  grid-area: 1 / 1 / 1 / 1;
  font-size: 3.5rem;
  font-weight: var(--weight-extra-bold);
  color: var(--Very-dark-blue);
  line-height: 3.2rem;
}

.hero-text p {
  grid-area: 1 / 2 / 1 / 2;
  font-size: var(--font-size);
  color: var(--Dark-grayish-blue);
  line-height: 1.5rem;
}

button {
  width: 11rem;
  height: 3rem;
  letter-spacing: 1.5px;
  font-size: var(--font-size);
  text-transform: uppercase;
  border: none;
  background-color: var(--Soft-red);
  color: var(--Very-dark-blue);
  font-weight: var(--weight-extra-bold);
  margin-block-start: 1.5rem;
  cursor: pointer;
  transition: all .5s ease-in-out;
}

button:hover {
  background-color: var(--Very-dark-blue);
  color: var(--Off-white);
}

.new {
  grid-area: 1 / 3 / 1 / 3;
  display: grid;
  grid-template-rows: 5rem 9rem 9rem 9rem;
  background-color: var(--Very-dark-blue);
  padding: 0.8rem 2rem 0 2rem;
  align-items: center;
}

.new h2 {
  color: var(--Soft-orange);
  font-weight: var(--weight-bold);
  font-size: 2.5rem;
}

.new h3 {
  color: var(--Off-white);
  font-size: 1.4rem;
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: all .5s ease-in-out;
}

.new p {
  margin-block-start: 0.7rem;
  color: var(--Grayish-blue);
  font-size: 1rem;
  line-height: 1.9rem;
}

.downsides {
  border-top: 2px var(--Dark-grayish-blue) solid;
  border-bottom: 2px var(--Dark-grayish-blue) solid;
  padding: 2rem 0;
}

.hydrogen {
  padding-block-end: 2rem;
}

.funding {
  padding-block-start: 2rem;
}

.articles h2{
  display: none;
}

.articles{
  grid-area: 2 / 1 / 2 / span 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
}

.element{
  display: grid;
  grid-template-columns: 8rem 15rem;
  grid-template-rows: 2rem 2rem 4rem ;
  column-gap: 0.7rem;
  row-gap: 0;
  align-items: end;
  margin-inline-start: -0.7rem;
}

.element img{
  grid-area: 1 / 1 / span 3 / 1;
  width: 8rem;
  height: 8rem;
  object-fit: contain;
}

.element span{
  grid-area: 1 / 2 / 1 / 2;
  font-size: 1.8rem;
  font-weight: var(--weight-bold);
  color: var(--Soft-red);
}

.element h3{
  grid-area: 2 / 2 / 2 / 2;
  font-size: 1.1rem;
  font-weight: var(--weight-extra-bold);
  color: var(--Very-dark-blue);
  cursor: pointer;
  transition: all .5s ease-in-out;
}

.element h3:hover{
  color: var(--Soft-red);
}

.element p{
  grid-area: 3 / 2 / 3 / 2;
  font-size: 1rem;
  color: var(--Dark-grayish-blue);
  line-height: 1.7rem;
}

.mobile-menu{
  display: none;
}

footer{
  position: relative;
  margin-block-end: 1rem;
  color: var(--Soft-red)
}

@media (max-width: 850px){

  body{
    display: block;
    margin: 0;
    padding: 0;
  }

  nav {
    display: none;
  }

  .mobile-menu{
    display: block;
  }

  .overlay {
    height: 100%;
    width: 0;
    position: fixed; 
    z-index: 1; 
    top: 0;
    left: 0;
    background-color: rgba(0,0,0, 0.4); 
    overflow-x: hidden;
    opacity: 0;
}

.overlay.active {
    width: 100%;
    opacity: 1;
}

 
 /* Mobile Navigation GOT IT FROM W3SCHOOLS */
 
  .container {
  position: absolute;
  top: 4rem;
  right: 1.7rem;
  display: inline-block;
  cursor: pointer;
  z-index: 5;
}

.bar1, .bar2, .bar3 {
  width: 60px;
  height: 4px;
  background-color: #333;
  margin: 6px 0;
  transition: 0.4s;
  
}

.change .bar1 {
  transform: translate(0, 11px) rotate(-45deg);
}

.change .bar2 {opacity: 0;}

.change .bar3 {
  transform: translate(0, -11px) rotate(45deg);
}

/* Mobile Navigation GOT IT FROM W3SCHOOLS */


.mobile-menu-content{
  width: 0;
  position: fixed;
  height: 100%;
  top: 0;
  right: 0;
  background-color: #ffffff;
  overflow-x: hidden;
  transition: 0.5s;
  padding-block-start: 11rem;
  z-index: 3;
}

.mobile-menu-content a {
  padding: 0.9rem 1.5rem;
  text-decoration: none;
  font-size: 1.5rem;
  color: var(--Very-dark-blue);
  display: block;
  transition: 0.3s;
}

.mobile-menu-content a:hover {
  color: var(--Soft-orange);
}

.mobile-menu-content.open {
  width: 26rem;
}


  .header{
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    padding: 4rem 1.5rem;
    margin-block-end: 0;
  }

  main{
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    padding: 0 1.5rem;
    row-gap: 2rem;
    column-gap: 1.5rem;
  }

  .hero{
    grid-area: 1 / 1 / 1 / span 2;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  picture{
    grid-area: 1 / 1 / 1 / span 2;
  }

  .hero-text{
    grid-area: 2 / 1 / 2 /span 2;
    display: grid;
    grid-template-columns: 20rem 1fr;
    grid-template-rows: auto;
    column-gap: 2rem;
  }

  .new{
    grid-area: 3 / 1 / 3 / 1;
    grid-template-rows: auto;
    padding: 1.5rem 1.2rem 1.5rem 1.5rem;
  }

  .new h3{
    font-size: 1.3rem;
    line-height: 1.9rem;
  }

  .downsides{
    padding: 1.7rem 0;
  }

  .hydrogen{
    padding-block-start: 2rem;
    padding-block-end: 1.5rem;
  }

  .new p{
    font-size: 0.9rem;
  }

  .articles{
    grid-area: 3 / 2 / 3 / 2;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-content: space-between;
    padding: 0 0.5rem 0 0;
  }

  .element img{
    width: 9rem;
    height: 10rem;
  }

  .element{
    grid-template-columns: auto;
    grid-template-rows: auto;
  }

  .element h3{
    line-height: 1.9rem;
  }


}

@media (max-width: 600px){
   

  /* Mobile Navigation GOT IT FROM W3SCHOOLS */
  .container {
  top: 2rem;
  right: 1rem;
}
  .bar1, .bar2, .bar3 {
  width: 40px;
  height: 3px;
  margin: 5px 0;
}

.change .bar1 {
  transform: translate(0, 8.5px) rotate(-45deg);
}

.change .bar3 {
  transform: translate(0, -8.5px) rotate(45deg);
}

.header{
  padding: 2rem 1rem 2rem 1rem;
}

.header img{
  width: 2.5rem;
  height: 2rem;
  object-fit: contain;
}

.mobile-menu-content a{
  padding: 0.7rem 1.2rem;
  font-size: 1.1rem;
}

.mobile-menu-content.open {
  width: 18rem;
}

main{
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 0 1rem;
    row-gap: 4.5rem;
    column-gap: 0;
}

.hero{
  grid-area: 1 / 1 / span 2 / 1;
}

h1{
  font-size: 3rem;
  margin-block-end: 1rem;
}

picture{
  grid-area: 1 / 1 / 1 / 1;
}

.hero-text{
  grid-area: 2 / 1 / 2 / 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}

button{
  letter-spacing: 3px;
}

.new{
  grid-area: 3 / 1 / 3 / 1;
  grid-template-rows: auto;
  padding: 1.5rem 1.2rem 1.5rem 1.5rem;
}

.element img{
  width: 7rem;
  height: 9rem;
  object-fit: contain;
}

.articles{
  grid-area: 4 / 1 / 4 / 1;
  padding: 0 0 0 0.8rem;
  row-gap: 2rem;
}

.element{
  column-gap: 1.5rem;
}

.element p{
  font-size: 0.9rem;
}

}