* {
  margin: 0;
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
}

:root {
  --ff-primary: 'Staatliches', cursive;
  --ff-secondary: 'Epilogue', sans-serif;
  
  --fc-white: #FFFFFF;
  --fc-paragraph: hsl(274, 84%, 12%);
  --fc-heading: hsl(232, 17%, 35%);

  --bg-header: hsl(218, 17%, 62%);
  --bg-logo: hsl(275, 18%, 79%);
  --bg-page: hsl(233, 100%, 97%);
  --bg-heading: hsl(312, 91%, 96%);


  --fz-secondary: 1.4rem;
  --fz-tertiary: 2rem;

  font-size: 62.5%;
}

.page {
  background: var(--bg-page);

  margin: 0 auto;
  min-width: 38.4rem;
}

header  {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;

  background: var(--bg-header);
  width: 100%;
  height: 28rem;
  margin-bottom: 2.5rem;
}

header svg {
  width: fit-content;
  height: 13rem;
}

header h1 {
  font-family: var(--ff-primary);
  color: var(--fc-white);
  font-weight: 400;
  font-size: 4rem;
  background-color: var(--bg-logo);
  width: 100%;
  text-align: center;
}

.wrapper {
  margin: 2rem 0 5rem;
  padding: 2rem;
}

p {
  color: var(--fc-paragraph);
  font-size: var(--fz-secondary);
  font-family: var(--ff-secondary);
  line-height: 1.5rem;
  text-align: center;
  font-weight: 400;

  /* margin-bottom: 4.5rem;  */
}

main {
  padding: 0 3.2rem;
  display: grid;
  gap: 3rem;
}

.card:nth-child(eve) img {
  height: 45rem;
}

.card {
  position: relative;
  /* border-radius: 2rem; */
  animation: downtop;
  animation-duration: 700ms;
}

.card img {
  width: 100%;
  height: 25rem;
  object-fit: cover;
  transition: all 200ms;
  border-radius: 2rem;
}

.card img:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

h2 {
  font-size: var(--fz-tertiary);
  font-family: var(--ff-primary);
  color: var(--fc-heading);

  line-height: 34px;
  letter-spacing: 0.07em;
  line-height: 3.5rem;
  text-transform: uppercase;

  position: absolute;
  right: 1.6rem;
  top: 1.6rem;

  background-color: var(--bg-heading);

  width: fit-content;
  height: 3.5rem;
  border-radius: 2rem;
  padding: 1px 2rem;

  animation: topdown;
  animation-duration: 2000ms;
}

span {
  display: none;
}

@keyframes downtop {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }

  100% {
    opacity: 1;
    transform: rotateY(0);
  }
}

@keyframes topdown {
  0% {
    opacity: 0;
    transform: translateY(-15px);
  }

  100% {
    opacity: 1;
    transform: rotateY(0);
  }
}

@media (min-width: 600px) {
  .page {
    height: 100%;
    width: 100%;
    max-width: 128rem;
    display: grid;
    grid-template-columns: 4fr 6fr;
    grid-template-rows: 1fr 12rem;
    grid-template-areas:
    "tdesk main"
    "footer footer"
  }

  .tdesk {
    background-color: var(--bg-header);
    grid-area: tdesk;
  }

  p {
    color: var(--fc-white);
    font-size: 1.5rem;
    line-height: 2rem;
  }

  main {
    width: 100%;
    padding: 3rem;
    display: grid;
    grid-area: main;
    gap: 2rem
  }

  .card:nth-child(even) img {
    height: 25rem;
  }

  footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  footer p {
    font-family: var(--ff-secondary);
    font-size: 1.4rem;
    color: #4A4E69;
  }

  footer a {
    text-decoration: none;
    color: #4A4E69;
    font-weight: bold;
  }

  span {
    display: initial;
  }
}

@media (min-width: 900px) {
  .page {
    width: 100%;
    max-width: 128rem;
    display: grid;
    grid-template-columns: 3fr 7fr;
    grid-template-rows: 1fr 10rem;
    grid-template-areas: 
    "tdesk main"
    "tdesk footer"
  }

  main {
    grid: 15rem 16.8rem 20rem / 1fr 1fr 1fr;
    grid-template-areas: 
      "a b c"
      "d b f"
      "d e f";
    gap: 3rem;
  }

  header {
    margin-bottom: 0;
  }

  .wrapper {
    margin: 0;
  }

  .card:nth-child(even) img {
    height: 350px;
  }

  .card:nth-child(odd) img {
    height: 150px;
  }

  .card:nth-child(1) { 
     grid-area: a; 
   } 

   .card:nth-child(2) { 
     grid-area: b; 
   } 

   .card:nth-child(3) { 
     grid-area: c; 
   } 

   .card:nth-child(4) { 
     grid-area: d; 
   } 

   .card:nth-child(5) { 
     grid-area: e; 
   } 

   .card:nth-child(6) { 
     grid-area: f; 
   } 

  .card h2 {
    animation: none;
    transition: opacity 700ms ease-in;
    opacity: 0;
    background-color: var(--bg-heading);
    color: var(--fc-heading);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .card img {
    transition: all 200ms;
  }

  .card:hover img {
    transform: scale(1.05);
  }

  .card:hover h2 {
    opacity: 0.9;
  }
}