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

html {
  font-size: 16px;
}

body {
  font-family: 'Karla', sans-serif;
  font-optical-sizing: auto;

  display: grid;
  justify-content: center;
  align-content: center;
  height: 100vh;

  background-color: hsl(204, 43%, 93%);
}

.main-container {
  height: 480px;
  max-width: 640px;

  display: grid;
  grid-template-rows: 1fr 1fr;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    'message message'
    'subscription reason';

  box-shadow: 2px 2px 20px 4px rgba(0, 0, 0, 15%);
  border-radius: 8px;
}

/* message grid area */

.main-container > .message {
  border-radius: 8px 8px 0px 0px;
  background-color: white;
  grid-area: message;

  /* centering the text-box */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.main-container > .message .text-box {
  margin: 40px;

  display: flex;
  flex-direction: column;
  /* take equal space around the y-axis */
  justify-content: center;

  /* content is not equally spaced so */
  /* justify-content: space-around; */

  /* text-box height % of parent */
  /* this is space available for use */
  /* for text-box children */
  height: 70%;
}

.message .text-box .heading {
  color: hsl(179, 62%, 43%);
  font-size: 1.5rem;
  font-weight: 500;

  /* uneven spacing */
  margin-bottom: 30px;
}

.message .text-box .subheading {
  color: hsl(71, 73%, 54%);
  font-size: 1.2rem;
  font-weight: 500;

  /* uneven spacing */
  margin-bottom: 10px;
}

.message .text-box .description {
  line-height: 1.5rem;

  font-weight: 500;
  opacity: 0.3;
}

/* subscription grid area */

.main-container > .subscription {
  border-radius: 0px 0px 0px 8px;
  background-color: hsl(179, 62%, 43%);
  grid-area: subscription;

  /* centering the text-and-button-box */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.subscription > .text-and-button-box {
  height: 70%;
  margin: 40px;

  display: flex;
  flex-direction: column;
}

.subscription .text-box {
  display: flex;
  flex-direction: column;
  align-items: start;
  /* distribute space vertically */
  justify-content: center;

  /* not evenly spaced so not using */
  /* justify-content: space-between; */

  /* total height available for text content */
  /* rest for signup button */
  height: 70%;
}

.subscription .text-box .heading,
.reason .text-content .heading {
  font-size: 1.1rem;
  color: white;
  font-weight: 500;
  letter-spacing: 0.1rem;

  margin-bottom: 20px;
}

.subscription .text-box .pricing {
  margin-bottom: 10px;
}

.subscription .text-box .pricing span:first-of-type {
  font-size: 1.7rem;
  font-weight: 500;
  color: white;
  margin-right: 0.5rem;
}

.subscription .text-box .pricing span:last-of-type {
  color: white;
  font-weight: 300;
  opacity: 0.5;
}

.subscription .text-box .description {
  color: white;
}

.subscription .button {
  height: 45px;
  margin-top: 20px;

  background-color: hsl(71, 73%, 54%);
  border-radius: 5px;

  /* another way to center text :) */
  text-align: center;
  line-height: 45px;

  font-weight: 600;
  color: white;

  box-shadow: 2px 2px 4px rgba(0, 0, 0, 30%);
}

/* reason grid area */

.main-container > .reason {
  border-radius: 0px 0px 8px 0px;
  background-color: hsl(179, 62%, 46%);
  grid-area: reason;

  /* centering the text-content */
  display: flex;
  justify-content: center;
  align-items: center;
}

.reason .text-content {
  margin: 40px;
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
}

/* reason heading styling and spacing same */
/* as subscription heading styling and spacing */

.reason .description {
  color: white;
  opacity: 0.6;
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.2rem;
  letter-spacing: 0.05rem;
}

@media (max-width: 640px) {
  .main-container {
    grid-template: repeat(3, 1fr) / 1fr; /* Shorthand for rows/columns */
    grid-template-areas: none; /* Disable area mapping */

    width: 300px;
    height: 100vh;
  }

  /* it seems this is not required, adding for clarity */
  .message,
  .subscription,
  .reason {
    grid-area: none;
  }

  /* explicity place grid items */

  .main-container > .message {
    grid-row: 1/2;
    grid-column: 1/2;
  }

  .main-container > .subscription {
    grid-row: 2/3;
    grid-column: 1/2;
  }

  .main-container > .reason {
    grid-row: 3/4;
    grid-column: 1/2;
  }

  /* adjust margin */

  .main-container > .message .text-box {
    margin: 25px;
    height: 100%;
  }

  .main-container > .subscription .text-and-button-box {
    margin: 25px;
    width: 100%;
  }

  .main-container > .reason .text-content {
    margin: 25px;
    width: 100%;
  }

  /* adjust typography */

  .message .text-box .heading {
    color: hsl(179, 62%, 43%);
    font-size: 1.2rem;
    font-weight: 500;

    /* uneven spacing */
    margin-bottom: 30px;
  }

  .message .text-box .subheading {
    color: hsl(71, 73%, 54%);
    font-size: 1rem;
    font-weight: 500;

    /* uneven spacing */
    margin-bottom: 10px;
  }

  .message .text-box .description {
    line-height: 1.5rem;

    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.3;
  }

  /* border radius */

  .main-container {
    border-radius: 5px;
  }

  .main-container > .message {
    border-radius: 5px 5px 0px 0px;
  }

  .main-container > .subscription {
    border-radius: 0px;
  }

  .main-container > .reason {
    border-radius: 0px 0px 5px 5px;
  }
}
