*, *::before, *::after {
  margin: 0;
  box-sizing: border-box;  
  font-family: "Rubik", sans-serif;
  font-size: 18px;
}

:root {
  --blue: hsl(231, 69%, 60%);
  --black: hsl(231, 32%, 21%);
  --text: hsl(232, 7%, 57%);
  --red: hsl(0, 94%, 66%);
  --grey: hsl(0, 0%, 95%);
  --shadow: hsl(0, 0%, 88%);
}

body {
  overflow-x: clip;
}

header, main {
  margin: 2rem auto;
  max-width: 1200px;
  width: 90%;
}

/* styling nav in mobile layout */

@media (max-width: 971px) {
  #header {
    background-color: hsl(231, 32%, 21%, 0.9);
    height: 100%;
    width: 100vw;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 5;
    position: fixed;
    top: -2rem;
    padding: 2rem;
  } 

  #header nav {
    display: flex;
    flex-direction: column;
  }

  #header nav a:first-child {
    border-top: 1px solid var(--grey);
  }

  #header nav a {
    color: var(--grey);
    border-bottom: 1px solid var(--grey);
    padding: 2em;
    margin: 0 auto;
    width: 100%;
    font-size: 1em;
    text-align: center;
  }

  #header nav button {
    width: 100%;
    margin: 2em auto;
    padding: 1.2em;
    font-size: 1em;
    text-transform: uppercase;
    background-color: transparent;
    border: 3px solid var(--grey);
  }

  #header .hover-white:hover {
    background-color: hsl(0, 0%, 95%, 0.3);
  }

  #header nav button:hover {
    background-color: var(--grey);
    color: var(--black);
    outline: none;
  }
} 

/* hiding nav by default on mobile screens */

header nav {
  display: none;
}

/* applying flex to logo and hamburger icon */

#top-logo-nav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#top-logo-nav > :nth-child(2) {
  background: none;
  border: none;
}

.icon-size {
  height: 25px;
}

.logo-size {
  height: 30px;
}

.arrow-size {
  height: 15px;
}

a {
  text-transform: uppercase;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}

header > nav a {
  color: var(--black);
}

/* bottom nav links */

#bottom-nav-links {
  background-color: var(--black);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
  margin: 0;
}

#bottom-logo-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

#bottom-logo-nav > nav a {
  color: var(--grey);
}

#bottom-logo-nav > nav a:hover {
  color: var(--red);
}

#bottom-nav-links nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.icons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
}

.icons svg {
  color: var(--grey);
}

/* added flex layout to buttons in first section */

.button-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

/* tabs styling */

#tabs > :first-child {
  border-top: 1px solid var(--text);
}

#tabs .selected {
  position: relative;
}

/* red underline for selected tab */

#tabs .selected::after {
  content: "";
  position: absolute;
  width: 15em;
  height: 7px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--red);
}

/* shared between section-two tabs and faq 'tabs' */

.tab {
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-size: 18px;
  padding: 1.5em 0;
}

.tab:hover {
  outline: none;
}

.section-2-tab {
  width: 90%;
  border-bottom: 1px solid var(--text);
}

/* aligning text center/left */

section {
  text-align: center;
  margin-top: 6.5rem;
}

#section-two-flex .para button {
  display: none;
}

@media (min-width: 971px) {
  /* applying flex to wide screen layout */
  header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
  /* hiding hamburger icon */
  #top-logo-nav > :nth-child(2) {
    display: none;
  }
  /* stying nav elements */
  header nav, #bottom-logo-nav nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
  }
  .para {
    text-align: left;
  }
  /* displaying more info button only on wide screen */
  #section-two-flex .para button {
    display: block;
  }
  .button-wrap {
    justify-content: start;
  }
  /* paragraph width of features paragraph */
  #features > p:first-of-type, #extension-download > p:first-of-type {
    width: 30em;
    margin: 1.5rem auto;
  }
  /* tab buttons in section-two */
  .section-2-tab {
    width: 15em;
  }
  #tabs > :first-child {
    border-top: none;
  }
  /* red underline for selected tab */
  #tabs .selected::after {
    content: "";
    left: 0;
    transform: none;
  }
  /* nav links at the bottom */
  #bottom-nav-links {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
  }
  #bottom-logo-nav {
    display: flex;
    flex-direction: row;
    gap: 3rem;
  }
}

/* hover styling  */

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

/* setting color, font size and font weight to text */

p {
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 2rem;
}

h2, h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 1.5rem;
}

/* styling the buttons */

button {
  padding: 0.8em 1em;
  border: 1px solid var(--blue);
  border-radius: 0.4rem;
  color: hsl(0, 0%, 97%);
  background-color: var(--blue);
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  background-color: white;
  color: var(--blue);
  outline: 2px solid var(--blue);
}

#section-one-flex .button-wrap button:first-child {
  box-shadow: 0.5rem 0.5rem 0.7rem var(--shadow);
}

.white {
  color: hsl(240, 1%, 53%);
  background-color: var(--grey);
  border: 1px solid var(--grey);
  box-shadow: 0.5rem 0.5rem 0.7rem var(--shadow);
}

.white:hover {
  background-color: white;
  color: var(--black);
  outline: 2px solid var(--black);
}

.red {
  background-color: var(--red);
  border: 1px solid var(--red);
}

.red:hover {
  background-color: white;
  color: var(--red);
  outline: 2px solid var(--red);
}

/* applying flex layout to image and paragraph in first two sections */

#section-one-flex {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
}

.image-wrapper, .para {
  flex: 1 1 400px;
  max-width: 100%;
}

.image-wrapper {
  position: relative;
}

.illustration {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;    
}

/* blue shapes */

.blue-design-element {
  background-color: var(--blue);
  position: absolute;
  z-index: -1;
  height: 57vw;
  width: 85vw;
  top: 20%;
}

#design-1 {
  right: -11vw;
  border-radius: 150px 0 0 150px;
} 

#section-two-flex {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
  margin-top: 3rem;
}

/* styling margin-top for h3 because increasing the gap instead in section-two-flex messes up its layout */

#section-two-flex h3 {
  margin-top: 1.5em;
}

#design-2 {
  left: -12vw;
  border-radius: 0 150px 150px 0;
} 

/* all the media queries for blue shapes */

@media (min-width: 711px) {
  #design-1 {
    height: 57vw;
    width: 84vw;
    border-radius: 200px 0 0 200px;
 }
 #design-2 {
    height: 55vw;
    width: 88vw;
    border-radius: 0 200px 200px 0;
 }
} 

@media (min-width: 971px) {
  #design-1 {
    height: 26vw;
    width: 45vw;
    border-radius: 200px 0 0 200px;
  }
  #design-2 {
    height: 26vw;
    width: 47vw;
    border-radius: 0 200px 200px 0;
  }
}

@media (min-width: 1330px) {
  #design-1 {
    height: 360px;
    width: 600px;
    border-radius: 200px 0 0 200px;
 }
 #design-2 {
    height: 350px;
    width: 600px;
    border-radius: 0 200px 200px 0;
  }
}

/* extensions cards and layouts */

#extensions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(90%, 300px), 1fr));
  max-width: 1000px;
  min-height: 600px;
  margin: 0 auto;
  gap: 30px;
}

.extension-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  border: 1px solid var(--grey);
  box-shadow: 0.1rem 0.1rem 0.8rem var(--shadow);
}

.extension-logo {
  margin: 2rem;
}

.dots {
  width: 100%;  
}

.extension-container p {
  margin-top: -1rem;
}

.extension-container button {
  width: 80%;
  margin-top: 1.5rem;
}

#extensions > .extension-container:nth-child(2) {
  align-self: center;
}

#extensions > .extension-container:nth-child(3) {
  align-self: end;
}

/* faq section */

#faqs {
  width: 90%;
  margin: 5rem auto;
}

#faq-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 3rem;
}

.faq {
  text-align: left;
  color: var(--black);
  font-weight: 450;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.faq-answer {
  text-align: left;
  display: none;
}

.faq-answer.open {
  display: block;
}

.bottom-border {
  border-bottom: 1px solid var(--text);
}

@media (min-width: 833px) {
  #faqs {
    width: 50%;
  }
}

/* contact us section */

#contact {
  background-color: var(--blue);
  padding: 4rem 2rem;
}

#contact p, #contact h2 {
  color: var(--grey);
}

input {
  width: 20rem;
  padding: 0.7rem;
  border: 1px solid white;
  border-radius: 0.4rem;
}

.wrapper {
  position: relative;
  
}

/* error icon */

.wrapper img {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

.error-msg {
  position: absolute;
  background-color: var(--red);
  color: var(--grey);
  font-size: 0.7rem;
  font-style: italic;
  top: 47px;
  width: 20rem;
  text-align: left;
  padding: 5px 10px;
  border-radius: 0 0 0.4rem 0.4rem;
}

input.error {
  border: 3px solid var(--red);
  border-radius: 0.4rem;
}

/* label input and contact us button flex layout */

label {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

@media (max-width: 590px) {
  label button {
    width: 20rem;
  }
  .error-msg {
    position: static;
    background-color: var(--red);
    color: var(--grey);
    font-size: 0.7rem;
    font-style: italic;
    margin-top: -5px;
    width: 20rem;
    text-align: left;
    padding: 5px 10px;
    border-radius: 0 0 0.4rem 0.4rem;
  }
  /* error icon */
  .wrapper img {
    position: absolute;
    right: 12px;
    top: 28%;
    transform: translateY(-28%);
    display: none;
  }
}

/* credits */

.attribution { 
  font-size: 11px; 
  text-align: center; 
  margin: 0.1rem;
}
    
.attribution a { 
  color: hsl(228, 45%, 44%); 
  text-transform: none;
}

