/* Mobile-first design approach. Media queries for tablet and laptop/desktop are located at the bottom, between mobile styles and keyframes. */

/*  -------- 
Define Color Variables  
-------- */
:root {
  --white: #fff;
  --dark-mauve: #7a5c58;
  --muted-black: #595959;
  /* below color serves as base for site ;*/
  --orange: #e67e22;
  /* From https://www.colorhexa.com/e67e22 -- originally -- but chose my own hues*/
  --almost-white: #fef9f5;
  --orange-tone-1: #fcefe4;
  --orange-tone-2: #ffebdb;
}

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

html {
  /* Adds smooth scrolling for a more user-friendly experience, so users can see where the page is moving */
  scroll-behavior: smooth;
  /*scroll-padding-top where the user lands to view the section header when clicking on nav links */
  /* https://www.w3schools.com/cssref/css_pr_scroll-padding-top.php */
  scroll-padding-top: 1em;
}

main {
  padding-bottom: 2em;
}

body {
  background-color: var(--almost-white);
  font-family: "Poppins", sans-serif;
  color: var(--muted-black);
}

.container {
  width: 90%;
  margin: 0 auto;
}

section {
  max-width: 450px;
  margin: 0 auto;
  padding-bottom: 3em;
}

ul {
  list-style-type: none;
}

a {
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

/*  -------- 
Typography  
--------*/
h1,
h2,
h3,
h4,
.subtitle {
  color: var(--dark-mauve);
}

h1 {
  font-family: "Quicksand", sans-serif;
  font-size: 2rem;
  text-align: center;
  padding: 2.4em 0 0 0;
}

.subtitle {
  margin-top: 6px;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1em;
}

h3 {
  font-size: 1.1rem;
}

h4 {
  font-size: 1rem;
}

p {
  font-size: 0.9rem;
  margin: 1.25em 0;
}

/*  -------- 
Header Section 
--------*/
/* Creating a very subtle hue change effect at top of page: */
.header-container {
  animation: changeHues 100s infinite ease-in-out;
  background-size: 1500% 1500%;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/*  -------- 
Nav Bar 
--------*/
.nav-container {
  padding-top: 2.5em;
}

.nav-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
}

.nav-list li {
  font-size: 1rem;
}

.nav-list li a {
  text-decoration: none;
  color: var(--dark-mauve);
  font-weight: 600;
}

.nav-list li a:hover {
  color: var(--orange);
  border-bottom: 1px solid var(--orange);
}

.paper-plane-icon {
  font-size: 1.2rem;
  font-weight: 500;
}

.art-portrait {
  width: 100%;
  max-width: 450px;
  border-radius: 50%;
  object-fit: contain;
  padding: 4em 0;
}

/*  -------- 
Experience Section 
--------*/

#experience span {
  font-size: 0.9rem;
  color: var(--dark-mauve);
}

.job {
  background-color: var(--white);
  padding: 1em;
  margin: 1em 0;
  border-radius: 20px;
}

.title-year {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#experience a {
  color: var(--dark-mauve);
}

#experience a:hover {
  color: var(--orange);
  border-bottom: 1px solid var(--orange);
}

#experience a:focus,
#experience a:active {
  color: var(--muted-black);
  border-bottom: none;
  opacity: 0.7;
}

/*  -------- 
Projects Section  
--------*/

.project-li {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--dark-mauve);
  background-color: var(--white);
  border: 2px solid transparent;
}

.project-li a {
  display: block;
  color: inherit;
}

.project-li:hover {
  filter: contrast(110%);
  border: 2px solid var(--orange);
}

.project-li a:hover {
  color: var(--orange);
}

/* Projects error modal and overlay */

.error-modal {
  background-color: var(--orange);
  border: 2px solid var(--orange);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.modal-msg {
  max-width: 70%;
  font-size: 1.1rem;
  text-align: center;
  color: var(--white);
  filter: contrast(110%);
}

.modal-close-btn {
  padding: 5px;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  background-color: transparent;
  color: var(--white);
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all 0.3s ease-in;
}

.modal-close-btn:hover {
  border: 2px solid var(--almost-white);
}

.hidden-modal {
  display: none;
}

/*  -------- 
Skills Section 
--------*/
.skills h2 {
  text-align: center;
}

.skills ul {
  background-color: var(--white);
  padding: 0.8em;
  border-radius: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.1rem;
  gap: 0.4em;
}

/* Skills border animation start */

/* CSS border animation on YouTube channel:  Coding2GO: https://www.youtube.com/watch?v=ezP4kbOvs_E */

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.skills ul::after,
.skills ul::before {
  content: "";
  position: absolute;
  height: 100%;
  width: 100%;
  background-image: conic-gradient(from var(--angle), transparent 50%, #ffebdb);
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  padding: 2px;
  border-radius: 10px;
  z-index: -1;
  /* See keyframes spin at bottom of page */
  animation: 3s spin linear infinite;
}

.skills ul::before {
  filter: blur(1.3rem);
  opacity: 0.3;
}
/* Skills border animation end */

/*  -------- 
Connect Section  
--------*/

#connect {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.social-icons {
  display: flex;
  gap: 1.5em;
}

.linkedin-icon,
.github-icon,
.mail-icon {
  /* note have to use font-size instead of width */
  font-size: 2em;
  color: var(--dark-mauve);
}

.linkedin-icon:hover,
.github-icon:hover,
.mail-icon:hover {
  color: var(--orange);
}

/*  -------- 
Leave a Message Section
--------*/
#message-form-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.leave-message {
  width: 100%;
}

.input {
  width: 100%;
  padding: 12px 6px;
  font-size: inherit;
  font-family: inherit;
  margin-bottom: 10px;
  border: 1px solid var(--dark-mauve);
  border-radius: 5px;
}

.submit-btn {
  width: 100%;
  background-color: var(--orange);
  border-radius: 5px;
  padding: 10px 0;
  cursor: pointer;
  color: var(--white);
  filter: contrast(110%);
  font-size: 1.1rem;
  font-family: inherit;
  border: 2px solid transparent;
}

.submit-btn:hover,
.submit-btn:focus {
  border: 2px solid var(--dark-mauve);
  background-color: var(--dark-mauve);
  color: var(--almost-white);
  opacity: 0.9;
}

/*  -------- 
Messages Section (displaying messages from users)
--------*/

.hidden {
  display: none;
}

.message-ul {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  background-color: var(--almost-white);
}

/* prevent users from resizing the textarea input field */
textarea {
  resize: none;
}

.user-msg-li {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 20px;
  padding: 10px;
}

.user-email {
  display: block;
  color: var(--orange);
  margin-bottom: 10px;
}

.user-msg {
  display: block;
  /* word-wrap: break-word key to fixing the overflow */
  word-wrap: break-word;
  margin-bottom: 15px;
}

.remove-btn {
  width: 100%;
  border-radius: 5px;
  background-color: var(--orange);
  padding: 5px 0;
  cursor: pointer;
  color: var(--white);
  filter: contrast(110%);
  font-family: inherit;
  border: 2px solid transparent;
}

.remove-btn:hover,
.remove-btn:focus {
  background-color: var(--dark-mauve);
  opacity: 0.9;
}

/*  -------- 
Footer  
--------*/
footer {
  padding: 2em 0;
  background-color: var(--dark-mauve);
  color: var(--white);
  text-align: center;
}

/* -------- 
Media Queries
-------- */

/* Tablets */
@media (min-width: 767px) {
  /* Typography */
  h1 {
    font-size: 2.6rem;
    color: var(--orange);
  }

  .subtitle {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.6rem;
    color: var(--orange);
    filter: contrast(101%);
  }

  h3 {
    font-size: 1.2rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  p {
    font-size: 1rem;
  }

  /* Nav Bar */
  .nav-list {
    gap: 0.9em;
  }

  .nav-list li {
    font-size: 1.1rem;
  }

  .nav-list {
    flex-direction: row;
    justify-content: flex-end;
  }

  /* Experience Section */
  .title-year {
    flex-direction: row;
  }

  #experience span {
    font-size: 1.1rem;
  }

  /* Projects Section */
  #projects ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Skills Section */

  .skills ul {
    flex-direction: row;
    justify-content: space-between;
    color: var(--dark-mauve);
    font-weight: 600;
    padding: 2em;
  }

  /* Connect Section */
  .social-icons {
    gap: 2.5em;
  }

  .linkedin-icon,
  .github-icon,
  .mail-icon {
    font-size: 2.4em;
  }

  /*  -------- 
Messages Section (displaying messages from users)
--------*/

  .user-msg-li {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .user-info {
    display: flex;
    flex-direction: column;

    max-width: 80%;
  }

  .user-email,
  .user-msg {
    margin-bottom: 0;
  }

  .remove-btn {
    width: 5em;
    height: 5em;
    border-radius: 50%;
  }
}

/* Laptops/Desktops */
@media (min-width: 1023px) {
  /* General Styles */
  section {
    max-width: 600px;
    /* animation: fade-in 20s ease-in forwards; */
  }

  /* Typography */
  h1 {
    font-size: 2.8rem;
    padding: 0;
  }

  .subtitle {
    font-size: 1.7rem;
    text-align: left;
  }

  h2 {
    font-size: 1.7rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  h4 {
    font-size: 1.2rem;
  }

  p {
    font-size: 1.1rem;
  }

  /* Header Section */
  .header-content {
    flex-direction: row;
    justify-content: space-around;
    width: 900px;
    margin: 0 auto;
  }

  .title-container {
    order: 2;
  }

  .social-icons {
    width: 200px;
  }

  .art-portrait {
    padding: 5em 0;
    order: 1;
  }

  /* Connect Section */
  .linkedin-icon,
  .github-icon,
  .mail-icon {
    font-size: 2.8em;
  }
}

/* -------- 
Keyframes 
-------- */

/* Gradient animation for header-container*/
/* https://www.w3schools.com/cssref/atrule_keyframes.php */
@keyframes changeHues {
  0% {
    background: linear-gradient(
      to bottom,
      var(--orange-tone-1),
      var(--almost-white)
    );
    background-position: 0% 0%;
  }
  20% {
    background: linear-gradient(
      to bottom,
      var(--orange-tone-2),
      var(--almost-white)
    );
    background-position: 20% 20%;
  }
  40% {
    background: linear-gradient(
      to bottom,
      var(--orange-tone-1),
      var(--almost-white)
    );
    background-position: 40% 40%;
  }
  60% {
    background: linear-gradient(
      to bottom,
      var(--orange-tone-2),
      var(--almost-white)
    );
    background-position: 60% 60%;
  }
  80% {
    background: linear-gradient(
      to bottom,
      var(--orange-tone-1),
      var(--almost-white)
    );
    background-position: 80% 80%;
  }
  100% {
    background: linear-gradient(
      to bottom,
      var(--orange-tone-2),
      var(--almost-white)
    );
    background-position: 100% 100%;
  }
}

@keyframes spin {
  from {
    --angle: 0deg;
  }
  to {
    --angle: 360deg;
  }
}
