* {
  box-sizing: border-box;
}

* p {
  max-width: 65ch;
}

body {
  margin: 0;
  font-family: "MyCustomFont", sans-serif;
  background-color: #2a4d88;
  background: linear-gradient(to bottom, #d9d9d8, #7c94b8, #2a4d88);
}

@font-face {
  font-family: "HeaderFont";
  src: url("ROYAL-Regular-BF6904912476c15.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MyCustomFont";
  src: url("Jen-Wagner-Essential-Sans-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 0 auto;
  padding: 1rem;
}

aside {
  display: flex;
  flex-direction: column;
  flex: 1 1 100%;
  width: 100%;
  position: static;
  border: 3px solid #d9d9d8;
  padding: 1rem;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: #7c94b8;
  border-radius: 1rem;
  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.5);
}

.image-container {
  position: relative;
  display: inline-block;
  width: fit-content;
}
.image-container::after {
  content: "🐺 Hire me!";
  opacity: 0;
  transition: 1s;
}

.image-container:hover::after {
  opacity: 1;
}

#portrait {
  position: absolute;
  margin-top: 2rem;
  width: 100%;
  max-width: 15rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 2px solid #d9d9d8;
}
#active {
  margin-top: 2rem;
  width: 100%;
  max-width: 15rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 2px solid #d9d9d8;
}

#portrait:hover {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#work {
  position: absolute;
  left: 50%;
  bottom: 25px;
  transform: translateX(-50%) scale(1);
  transform-origin: center;

  background: rgb(34, 87, 145);
  color: white;
  padding: 0.45rem 1rem;
  border-radius: 999px;

  font-size: 0.65rem;
  font-weight: bold;
  white-space: nowrap;

  transition: none;
}

aside h1 {
  font-family: "HeaderFont", sans-serif;
  text-align: center;
  font-weight: bold;
}

aside p {
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}

.links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-flow: row wrap;
  list-style: none;
  margin-left: -2.5rem;
}

.links img {
  height: 2.2rem;
  width: auto;
  max-width: 100%;
}

.links:focus-visible {
  outline: red;
  transform: rotate(360);
}

li:hover {
  transform: scale(1.1);
  transition: 0.3s ease;
}
a[href^="https"] {
  text-decoration: none;
  color: #000000;
}

#EmploymentHistory > h1 {
  font-family: "HeaderFont", sans-serif;
  text-align: center;
  font-weight: bold;
}

#EmploymentHistory {
  position: relative;
  padding-left: 3rem;
}

.section-title {
  font-family: "HeaderFont", sans-serif;
  text-align: center;
  font-weight: bold;
  border: 2px solid #7c94b8;
  background-color: #4a6dab;
  color: aliceblue;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

.section-title2 {
  font-family: "HeaderFont", sans-serif;
  text-align: center;
  font-weight: bold;
  border-bottom: 2px solid #7c94b8;
  background-color: #4a6dab;
  color: aliceblue;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
}

.Employment {
  border: 3px solid #d9d9d8;
  margin: 1rem 0;
  background-color: #7c94b8;
  padding: 1rem;
  border-radius: 1rem;

  opacity: 0;
  transform: translateX(80px);

  transition:
    transform 0.7s ease,
    opacity 0.7s ease;
}

.Employment > h2 {
  font-weight: bold;
}

.timeline-item {
  position: relative;
  margin: 1rem 0;
}

.timeline-item.show .Employment {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item::before {
  content: "";
  position: absolute;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #7c94b8;
  border: 2px solid #c9c9c9;

  left: -2.65rem;
  top: 5rem;

  opacity: 0;
  transform: scale(0);

  transition:
    transform 0.5s ease,
    opacity 0.5s ease;
}

.timeline-item.show::before {
  opacity: 1;
  transform: scale(1);
}

.timeline-item:nth-child(2) {
  transition-delay: 0.2s;
}
.timeline-item:nth-child(3) {
  transition-delay: 0.4s;
}
.timeline-item:nth-child(4) {
  transition-delay: 0.6s;
}

#EmploymentHistory {
  position: relative;
  padding-left: 3rem;
}

#EmploymentHistory::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 12rem;
  bottom: 6rem;
  width: 10px;
  background: #c9c9c9;
  border-radius: 999px;

  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1.2s ease;
}

#EmploymentHistory.show-line::before {
  transform: scaleY(1);
}
#Projects {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 2px solid #d9d9d8;
  height: 25rem;
  border-radius: 1rem;
  overflow-x: auto;
  overflow-y: visible;
  background-color: #7c94b8;
  margin-top: 2rem;
}

#Projects > h1 {
  font-family: "HeaderFont", sans-serif;
  text-align: center;
  font-weight: bold;
}

.projectlist {
  display: flex;
  flex-flow: row;
  gap: 2rem;
  padding: 2rem;
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-width: none;

  margin-top: -1rem;

  justify-content: flex-start;
}

.projectlist::-webkit-scrollbar {
  height: 10px;
}
.projectlist::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.projectlist::-webkit-scrollbar-thumb {
  background: #888;
}

.projectlist::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.Project {
  width: 250px;
  height: 250px;
  flex-shrink: 0;

  border: 2px solid #d9d9d8;
  background-color: hsl(218, 42%, 57%);
  padding: 1rem;
  box-shadow: 5px 5px rgba(61, 60, 60, 0.5);

  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  cursor: pointer;
  overflow-y: scroll;
  scrollbar-width: none;

  transition: transform 0.3s ease;
}

.title {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.details {
  max-height: 0;
  opacity: 0;
  text-align: justify;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
}

.Project:hover {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}
.Project:hover .details {
  max-height: 200px;
  opacity: 1;
}

#Hobby {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-flow: row wrap;
  border: 2px solid #d9d9d8;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#Hobbies {
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  margin: 2rem 0;
}

#hobbytitle {
  display: flex;
  font-size: xx-large;
  color: #c9c9c9;
  font-family: "HeaderFont", sans-serif;
  font-weight: bolder;
  flex: 1 1 100px;
  letter-spacing: 1.2rem;
  writing-mode: sideways-lr;
  margin-right: -30px;
  margin-left: -30px;
  transition: letter-spacing 1s ease;
}

#Hobbies:hover #hobbytitle {
  letter-spacing: 1.5rem;
}

#Hobby > h2 {
  font-size: x-large;
  font-weight: bolder;
  letter-spacing: 0.3rem;
  margin-bottom: 0rem;
  justify-content: flex-start;
  color: aliceblue;
}

.explain {
  border: 1px solid #c9c9c9;
  background-color: #7c94b8;
  border-radius: 1rem;
  padding: 0.5rem;
  margin: 1rem;

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.explain:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

footer nav {
  background-color: #4a6dab;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding: 1rem;
  justify-content: space-between;
}

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;

  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;

  background: #4a6dab;
  color: white;
  cursor: pointer;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.2s ease,
    top 0.2s ease,
    left 0.2s ease;
}

#theme-toggle:hover {
  transform: scale(1.05);
}

body.dark-mode {
  background: linear-gradient(to bottom, #131b31, #1f2c47, #2d394d);
  color: #f3f6ff;
}

body.dark-mode aside,
body.dark-mode .Employment,
body.dark-mode .Project,
body.dark-mode #Hobby,
body.dark-mode .explain,
body.dark-mode .section-title,
body.dark-mode .section-title2 {
  background-color: #172033;
  border-color: #5b8cff;
  color: #f3f6ff;
}

body.dark-mode .projectlist {
  border-color: #5b8cff;
  background-color: #141f38;
}

body.dark-mode a > h1 {
  color: #f3f6ff;
}

body.dark-mode a {
  color: #c7d8ff;
}

body.dark-mode #work {
  background: #5b8cff;
}

body.dark-mode .links img {
  filter: brightness(0) invert(1);
}

@media (min-width: 768px) {
  main {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
    margin-right: 2rem;
  }

  aside {
    flex: 1 0 30%;
    width: 30%;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
  }

  article {
    flex: 2 1 70%;
    width: 70%;
  }
}
