:root {
  --bg-dark: rgb(22, 22, 22);
  --bg-black: rgba(0, 0, 0, 0.8);
  --bg-light-grey: #dfdede;
  --text-white: white;
  --highlight-color: #776cd8;
  --gradient-light-gray: rgb(82, 81, 81);
  --gradient-white: white;
  --gradient-black: black;
  --animation-color1: #00EFF6;
  --animation-color2: #FF507D;
  --dark-blue: #121831;
}


*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: none;
  outline: none;
  font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
  text-decoration: none;
}

html{
  font-size: 62.5%;
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
  
}

body{
  background-color: var(--dark-blue);
  color: var(--text-white);
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  color: white;
}

/*Header*/

header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 5%;
  background-color: var(--bg-black);
  filter: drop-shadow(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.finnish-flag, .english-flag {
  background-size: cover;
  border: 1px solid black;
  height: 40px;
  width: auto;
  opacity: 1;
  z-index: 11;
}

.finnish-flag {
  width: 60px;
  margin-right: 10px;
}

.finnish-flag:hover, .english-flag:hover {
  scale: 1.05;
}

nav a{
  font-size: 1.8rem;
  color: var(--text-white);
  margin-left: 4rem;
  font-weight: 500;
  transition: 0.3s ease;
  border-bottom: 3px solid transparent;
}

nav a:hover {
  color: var(--highlight-color);
  border-bottom: 3px solid var(--highlight-color);
}

/*Hero Section*/

.profile-img {
  margin-right: 75px;
  width: 300px;
  height: auto;
  max-width: 100%;
  border-radius: 50%;
  z-index: 1;
  border: 2px black solid;
  transition: transform 0.3s ease;
}

.profile-img:hover {
  transform: perspective(1000px) rotateY(10deg) rotateX(10deg);
}


.UniOulu {
  width: 200px;
  height: auto;
  object-fit: cover;
  margin-top: 20px;
  border: 2px black solid;
  z-index: 1;
  transition: transform 0.3s ease;
}

.UniOulu:hover {
  transform: scale(1.05);
}

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 5%;
}

.gradient {
  position: relative;
}

.gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dark-blue) url('./img/hexagon-bg.jpg') no-repeat center center;
  background-size: cover;
  background-position: center;
  mask-image: linear-gradient(to bottom, black 80%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent);
  z-index: 0;
}

.gradient {
  background: linear-gradient(to bottom, var(--dark-blue) 30%, var(--bg-dark) 100%);
}

.intro {
  position: relative;
  z-index: 1;
  width: 70%;
  height: auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 50px;
  font-size: 20px;
  margin: 0 auto;
}

.intro-content {
  margin-right: 8em;
  margin-top: -30px;
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(119, 108, 216, 0.3);
  transition: all 0.3s ease;
}

.intro-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(119, 108, 216, 0.5);
  border-color: rgba(119, 108, 216, 0.4);
}

.intro h1 {
  font-size: 50px;
  position: relative;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
  filter: drop-shadow(0 0 20px rgba(119, 108, 216, 0.6));
  margin-bottom: 15px;
  letter-spacing: 2px;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.intro p {
  font-size: 22px;
  width: 100%; 
  max-width: 600px;
  min-height: 40px;
  justify-content: center;
  display: flex;
  flex-direction: column;
  font-weight: 500;
  color: #e0e0e0;
  text-shadow: 0 0 10px rgba(119, 108, 216, 0.5),
               0 0 20px rgba(119, 108, 216, 0.3);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.intro p::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--highlight-color), transparent);
  animation: underlineGlow 2s ease-in-out infinite;
}

@keyframes underlineGlow {
  0%, 100% {
    opacity: 0.5;
    width: 60%;
  }
  50% {
    opacity: 1;
    width: 80%;
  }
}

/*Skills Section*/

.skills{
  position: relative;
  z-index: 1;
  background-color: transparent;
  padding-bottom: 50px;
  font-size: 20px;
}


.skills-title {
  font-size: 4rem;
  text-align: center;
  margin: 50px auto;
  font-weight: 700;
  border-bottom: 3px solid var(--highlight-color);
  display: block;
  width: fit-content;
}

.skills-categories {
  display: flex;
  gap: 3rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 5%;
}

.skill-category {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
}

.category-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
  color: var(--text-white);
  font-weight: 600;
}

.skills-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  justify-items: center;
}

.distinct-skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.distinct-skill h3 {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 10px;
  
}

.distinct-skill img {
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.13);
  padding: 10px;
  border: 1.5px solid #e0e0e0;
  width: 100px;
  height: 100px;
  object-fit: contain;
}
/*About Section*/

.about {
  padding: 50px 0 200px 0;
  font-size: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(119, 108, 216, 0.3);
  background-color: var(--bg-dark);
}

.about span {
  font-size: 100%;
  font-weight: 700;
  color: var(--highlight-color);
}

.about h2 {
  font-size: 3rem;
  margin-bottom: 50px;
  font-weight: 700;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
}

.about p {
  padding: 20px 50px;
  text-align: left;
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 50px;
  max-width: 55%;
  border-width: 3px;
  border-style: solid;
  border-image:
    linear-gradient(
      to bottom, 
      rgb(157, 148, 180), 
      rgba(0, 0, 0, 0)
    ) 1 100%;
}

/*Projects Section*/

.projects {
  padding: 50px 0;
  font-size: 20px;
  text-align: center;
  background-color: var(--bg-dark);
}

.projects h2 {
  margin-bottom: 50px;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
}

.projects-categories {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 10%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Category accordion */
.project-category {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease-out, transform 0.3s ease-out;
  flex: 1 1 calc(50% - 10px);
  min-width: 400px;
  position: relative;
  z-index: 1;
}

.project-category.show {
  opacity: 1;
  transform: translateY(0);
}

.project-category:has(.project-list-item:hover) {
  z-index: 100;
}

.category-btn {
  width: 100%;
  padding: 20px 30px;
  background: linear-gradient(135deg, var(--highlight-color), #5a4fcf);
  color: white;
  font-size: 2rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(119, 108, 216, 0.3);
}

.project-category.open .category-btn {
  border-radius: 12px 12px 0 0;
}

.category-btn:hover {
  background: linear-gradient(135deg, #8a7fe0, var(--highlight-color));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(119, 108, 216, 0.4);
}

.project-category.open .category-btn:hover {
  transform: translateY(0);
}

.category-btn i {
  transition: transform 0.3s ease;
}

.project-category.open .category-btn i {
  transform: rotate(180deg);
}

/* Category content (project list) */
.category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  background: linear-gradient(135deg, rgba(151, 162, 204, 0.95), rgba(178, 140, 204, 0.95));
  border-radius: 0 0 12px 12px;
  border: none;
}

.project-category.open .category-content {
  max-height: 1000px;
  overflow: visible;
  transition: max-height 0.6s ease-in;
  border: 2px solid rgba(119, 108, 216, 0.5);
  border-top: none;
}

.project-category.open .project-list-item {
  opacity: 1;
  transform: translateY(0);
}

/* Project list items */
.project-list-item {
  display: block;
  position: relative;
  padding: 15px 25px;
  border-bottom: 1px solid rgba(119, 108, 216, 0.2);
  transition: all 0.3s ease;
  text-align: left;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s, background 0.3s ease, padding-left 0.3s ease;
}

.project-list-item:last-child {
  border-bottom: none;
}

.project-list-item:hover {
  background: rgba(119, 108, 216, 0.25);
  padding-left: 30px;
  z-index: 1001;
}

.project-name {
  color: var(--bg-light-grey);
  font-size: 1.6rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.project-list-item:hover .project-name {
  color: white;
}

/* Project preview image on hover */
.project-preview {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(-20px);
  opacity: 0;
  width: 400px;
  height: auto;
  max-height: 600px;
  margin-left: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 1000;
  border: 3px solid rgba(119, 108, 216, 0.5);
  background-color: white;
  display: flex;
  flex-direction: column;
}

.project-preview img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.project-description {
  padding: 12px 16px;
  font-size: 1.25rem;
  line-height: 1.6;
  color: #333;
  margin: 0;
  text-align: left;
}

.project-list-item:hover .project-preview {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}
/*Color transition*/

.gradient.show {
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}



/*Footer*/

.footer {
  background-color: var(--bg-black);
  color: var(--text-white);
  padding: 7em 0;
  text-align: center;
  min-height: 200px;
  padding-bottom: 50px;
  text-shadow: 1px 1px 3px rgba(119, 108, 216, 0.3);
}

.footer h2 {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: 700;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
}
.footer h3 {
  font-size: 2rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.social-icon {
  font-size: 4rem;
  margin: 0 10px;
  color: var(--text-white);
  transition: 0.3s ease;
  height: 40px;
}
.social-icon:hover {
  color: var(--highlight-color);
  scale: 1.2;
}

/*Media Queries*/

/*For screens between 1200px and 1600px*/
@media (min-width: 1200px) and (max-width: 1600px) {
  .profile-img {
    margin-left: -5vw;
  }
  
  .UniOulu {
    margin-right: -5vw;
  }

  .intro p {
    width: 100%;
    max-width: 450px;
  }
}

/*For screens between 800px and 1200px*/
@media (min-width: 800px) and (max-width: 1200px) {
  .profile-img {
    margin-left: 0;
    margin-right: 40px;
    width: 250px;
  }
  
  .UniOulu {
    margin-right: 0;
    width: 150px;
  }

  .intro {
    width: 85%;
    padding: 30px;
  }

  .intro-content {
    margin-right: 3em;
    padding: 25px 35px;
  }

  .intro h1 {
    font-size: 40px;
    letter-spacing: 1px;
  }

  .intro p {
    width: 100%;
    max-width: 380px;
    font-size: 18px;
  }

  .skills-categories {
    gap: 2rem;
    padding: 0 3%;
  }

  .skill-category {
    min-width: 220px;
    max-width: 280px;
  }

  .skills-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .distinct-skill img {
    width: 80px;
    height: 80px;
    padding: 8px;
  }

  .category-title {
    font-size: 2.2rem;
  }

  .projects-categories {
    padding: 0 5%;
    max-width: 900px;
  }

  .category-btn {
    font-size: 1.8rem;
    padding: 18px 25px;
  }

  .project-list-item:hover .project-preview {
    width: 300px;
  }

  .project-preview img {
    height: 180px;
  }
}

/*For screens between 600px and 800px*/
@media (min-width: 600px) and (max-width: 800px) {
  body {
    font-size: 1rem;
  }
  
  header {
    padding: 1rem 3%;
  }

  .finnish-flag, .english-flag {
    height: 30px;
  }

  .finnish-flag {
    width: 45px;
    margin-right: 8px;
  }

  nav a {
    font-size: 1.6rem;
    margin-left: 1.5rem;
  }

  .hero {
    min-height: 60vh;
  }

  .intro {
    flex-direction: column;
    width: 90%;
    padding: 30px;
  }

  .profile-img {
    margin-right: 0;
    margin-bottom: 20px;
    width: 220px;
  }

  .intro-content {
    margin-right: 0;
    margin-top: 0;
    padding: 20px 30px;
  }

  .intro h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
  }

  .intro p {
    font-size: 1.8rem;
    width: 100%;
    max-width: 300px;
  }
  
  .UniOulu {
    margin: 20px 0 0 0;
    width: 140px;
  }

  .skills-categories {
    gap: 2rem;
    padding: 0 3%;
  }

  .skill-category {
    min-width: 200px;
    flex: 1 1 calc(50% - 1rem);
  }

  .skills-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .distinct-skill img {
    width: 70px;
    height: 70px;
    padding: 8px;
  }

  .category-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .about-content {
    max-width: 90%;
    padding: 30px;
  }

  .projects-categories {
    padding: 0 5%;
  }

  .project-category {
    min-width: unset;
  }

  .category-btn {
    font-size: 1.6rem;
    padding: 15px 20px;
  }

  .project-name {
    font-size: 1.5rem;
  }

  .project-preview {
    display: none;
  }
}


/*For screens less than 600px*/
@media (max-width: 600px) {
  body {
    font-size: 1rem;
  }
  
  header {
    padding: 1rem 2%;
  }

  .finnish-flag, .english-flag {
    height: 25px;
  }

  .finnish-flag {
    width: 38px;
    margin-right: 5px;
  }

  nav a {
    font-size: 1.3rem;
    margin-left: 0.8rem;
    font-weight: 400;
  }

  .hero {
    min-height: auto;
    padding-top: 60px;
  }

  .intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 95%;
    padding: 20px;
    margin-top: 20px;
  }

  .profile-img {
    margin-right: 0;
    margin-bottom: 15px;
    width: 180px;
  }

  .intro-content {
    margin: 0;
    margin-top: 0;
    width: 100%;
    padding: 20px 25px;
  }

  .intro h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    width: 100%;
    max-width: 400px;
  }

  .intro p {
    font-size: 1.4rem;
    width: 100%;
    max-width: 280px;
    height: auto;
    padding: 8px 0;
  }
  
  .UniOulu {
    margin: 15px 0 0 0;
    width: 100px;
  }

  .skills {
    padding-bottom: 30px;
  }

  .skills-title {
    font-size: 3rem;
    margin: 30px auto;
  }

  .skills-categories {
    gap: 2.5rem;
    padding: 0 5%;
    flex-direction: column;
    align-items: center;
  }

  .skill-category {
    width: 100%;
    max-width: 400px;
    min-width: unset;
  }

  .category-title {
    font-size: 2rem;
    margin-bottom: 1.2rem;
  }

  .skills-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 0;
  }

  .distinct-skill img {
    width: 65px;
    height: 65px;
    padding: 6px;
    border-radius: 12px;
  }

  .about {
    padding: 30px 0 150px 0;
  }

  .about h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
  }

  .about-content {
    max-width: 95%;
    padding: 20px;
  }

  .about-content p {
    padding: 10px 5px;
    font-size: 95%;
  }

  .projects {
    padding: 30px 0;
  }

  .projects h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
  }

  .projects-categories {
    padding: 0 5%;
    flex-direction: column;
  }

  .project-category {
    min-width: unset;
  }

  .category-btn {
    font-size: 1.4rem;
    padding: 15px 18px;
  }

  .project-name {
    font-size: 1.3rem;
  }

  .project-preview {
    display: none;
  }

  .project-list-item {
    padding: 12px 18px;
  }

  .footer {
    padding: 4em 0 2em 0;
  }

  .footer h2 {
    font-size: 2.5rem;
  }

  .footer h3 {
    font-size: 1.6rem;
  }

  .social-icon {
    font-size: 3rem;
  }
}