/*
Fontti
"Alumni Sans Pinstripe", sans-serif
*/

@import url('https://fonts.googleapis.com/css2?family=Alumni+Sans+Pinstripe&display=swap');


body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(to right, #0a1628, #005c4d);
}

html {
  scroll-behavior: smooth;
}

/*  ----------
    Header osa
    ----------  */

.header-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 2s ease-in-out;
  background: transparent; /* Lähtötilassa läpinäkyvä */
  width: 70%;
  padding: 2px;
  box-sizing: border-box;
  border-bottom-right-radius: 50px;
  border-bottom-left-radius: 50px;
}


.header-container.scrolled {
  background: linear-gradient(to bottom, #0a1628, #005c4d);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.frontpage-link {
  font-family: "Alumni Sans Pinstripe", sans-serif;
  font-weight: 200;
  text-decoration: none;
  color: white;
  font-size: 40px;
  margin-top: 20px;
  margin-left: 30px;
  text-align: left;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-pic {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

.profile-wrapper {
  position: relative;
  display: inline-block;
}

.icon-panel {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 10px 15px;
  /*background-color: #a7c2bd;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);*/
  opacity: 0;
  transition: all 0.6s ease;
  align-items: center;
  z-index: 10;
}

.icon-panel.show {
  opacity: 1;
  transform: translateY(-50%) scaleX(1);
}

.icon-panel img {
  width: 30px;
  height: 30px;
  transition: transform 0.4s ease;
}

.icon-panel img:hover {
  transform: scale(1.2) rotate(-5deg);
}

.left-icons {
  left: -130px;
  transform-origin: right;
}

.right-icons {
  right: -130px;
  transform-origin: left;
}

.icon-links {
  display: flex;
}

.icon-links:not(.show) {
  display: none;
}




/*  ------------------
    Hampurilaisvalikko
    ------------------  */

.menu-btn {
  position: relative;
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease;
  z-index: 1000;
  margin-right: 20px;
}

.menu-btn__burger,
.menu-btn__burger::before,
.menu-btn__burger::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 3px;
  background-color: #0b192c;
  transition: all 0.2s ease-in-out;
  border-radius: 2px;
}

.menu-btn__burger::before {
  transform: translateY(-8px);
}

.menu-btn__burger::after {
  transform: translateY(8px);
}

.menu-btn.open .menu-btn__burger {
  background-color: transparent;
}

.menu-btn.open .menu-btn__burger::before {
  transform: rotate(45deg);
  background-color: rgb(255, 98, 0);
}

.menu-btn.open .menu-btn__burger::after {
  transform: rotate(-45deg);
  background-color: rgb(255, 98, 0);
}

.nav-menu {
  position: absolute;
  top: 105%;
  right: 60%; /* Sijainti vasemmalle */
  width: 240px; /* Sama leveys kuin aikaisemmin */
  background-color: #12243e;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  padding: 0px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.3s ease-in-out;
  z-index: 999;
  overflow: hidden;
}

.nav-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  padding: 18px;
}

.nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 10px 0;
}

.nav-menu a {
  text-decoration: none;
  font-weight: 400;
  font-size: 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #4dd6cd;
  transition: color 0.2s ease;
}

.nav-menu a:hover {
  color: #FF6500;
}

/*  --------
    Main osa
    --------  */

main {
  display: flex;
  flex-direction: column;
  gap: 60px;
  color: #4dd6cd;
  font-family: "Alumni Sans Pinstripe", sans-serif;
  width: 70%;
  padding: 20px;
  box-sizing: border-box;
  text-align: left;
}

.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
  margin-bottom: 40px;
}

.welcome {
  min-height: calc(100vh - 60px);
  padding-top: 60px;
}

.welcome-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.welcome-text {
  flex: 1;
  padding-right: 20px;
}

.welcome-image {
  flex: 0 0 40%;
}

.welcome-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 2.5s ease-in-out;
}

.welcome-image img.in-view {
  opacity: 1;
}

/* --- Slide-in-efektin perustyylit --- */
.slide-in-left,
.slide-in-right {
  opacity: 0;
  transform: translateX(var(--slide-offset));
  transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

/* Alkutila: vasemmalta */
.slide-in-left {
  --slide-offset: -50px;
}

/* Alkutila: oikealta, pieni viive hr:lle */
.slide-in-right {
  --slide-offset: 50px;
  transition-delay: 0.5s; /* hr liukuu hieman h3:n jälkeen */
}

/* Kun elementti tulee viewportiin */
.in-view {
  opacity: 1;
  transform: translateX(0);
}

h2 {
  font-size: 70px;
  margin-bottom: 10px;
}

h3 {
  font-size: 25px;
  color: #deb998;
  margin-bottom: 1px;
}

hr {
  width: 50%;
  background-color: #FF6500;
  height: 1px;
  border: 0;
  margin: 2px 0;
}

p {
  font-size: 30px;
  font-weight: 400;
  margin-top: 3px;
}



@keyframes slideUp {
from {
  opacity: 0;
  transform: translateY(50px);
  }
to {
  opacity: 1;
  transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 1s ease-out forwards;
}

/*  ---------------------------  
    Mediasisältö  Video / Kuva  
    ---------------------------  */

.media-container2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* sarakkeet */
  gap: 20px;
  margin-top: 20px;
}

.media-item {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s ease-out, transform 1s ease-out;
  border-radius: 7px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-item video {
  width: 100%;
  height: 120%;
  object-fit: cover;
}

.media-item-large {
  grid-column: span 2; /* Isommat kuvat vievät kaksi saraketta */
}

.media-item-horizontal {
  grid-column: span 2; /* Vaakasuora video vie kaksi saraketta */
}

.media-item-horizontal video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Piilota selaimen oma "Kuva kuvassa" -painike */
video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

/*  -----------------------------
    Sosiaalisen median painikkeet
    -----------------------------  */

.social-icons {
  display: flex;
  justify-content: flex-start;
  gap: 65px; /* ikonien väli */
  margin-left: 60px;
  margin-top: 30px;
}

.social-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.social-icon img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
}

.social-icon-white {
  opacity: 1;
}

.social-icon-color {
  opacity: 0;
}

.social-icon:hover .social-icon-white {
  opacity: 0;
}
.social-icon:hover .social-icon-color {
  opacity: 1;
}

.social-icon:hover {
  transform: scale(1.3) rotate(-6deg);
}

/*  ------------
    Software osa
    ------------  */

.software-icons {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 30px;
  padding: 20px;
  margin-top: 30px;
  justify-items: center;
  justify-content: center;
}

.software-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.software-item:hover {
  transform: scale(1.1);
}

.software-name {
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.6s ease;
  font-size: 1.3rem;
  color: #ffffff;
  margin-top: 13px;
}

.software-item:hover .software-name {
  opacity: 1;
  transform: translateY(0);
}

.software-item.active .software-name {
  opacity: 1;
  transform: translateY(0);
}

.software-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

.software-item img {
  max-width: 60px;
  height: auto;
}

/*  ------------
    Sivun alaosa
    ------------  */

footer {
  color: lightsteelblue;
}

h4 {
  font-size: 18px;
  text-align: center;
  margin-bottom: 8px;
}

.email {
  color: #4dd6cd;
}

.copyright {
  font-size: 16px;
}

.icons {
  font-size: 14px;
  text-align: center;
}

.icons8-link {
  font-size: 14px;
  color: #1fb141;
}

.iconpacks-link {
  font-size: 14px;
  color: #28a745;
}

/* -----------------------------------
   Responsiivisuus
   ----------------------------------- */

/* 1) Isommat tabletit ja pienemmät näytöt (~1024px asti) */
@media (max-width: 1024px) {
  .header-container,
  main {
    width: 90%;
    padding: 15px;
  }
  .header-title {
    font-size: 3rem;
  }
  .profile-pic {
    width: 60px;
    height: 60px;
  }
  .menu-btn {
    width: 50px;
    height: 50px;
  }

  .nav-menu {
    display: none;
  }
  
  .nav-menu.open {
    display: block;
  }
  
  h2 {
    font-size: 2.5rem;
  }
  h3 {
    font-size: 1.8rem;
  }
  p {
    font-size: 1.2rem;
  }
  .media-container2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 2) Tabletit ja isommat puhelimet (~768px asti) */
@media (max-width: 768px) {
  .header-container,
  main {
    width: 93%;
    padding: 4px;
    border-bottom-right-radius: 30px;
    border-bottom-left-radius: 30px;
  }
  
  /*header {
    flex-direction: column;
    align-items: flex-start;
  }
*/

.frontpage-link{
  font-size: 28px;
  margin-left: 8px;
  margin-top: 20px;
}
  .header-title {
    text-align: center;
    width: 80%;
  }

  .profile-pic {
    width: 30px;
    height: 30px;
    margin-top: 12px;
  }

  .icon-panel {
    gap: 7px;
    padding: 6px 10px;
  }

  .right-icons {
    right: -65px;
    margin-top: 8px;
  }

  .left-icons {
    left: -65px;
    margin-top: 8px;
  }

  .icon-panel img {
    width: 18px;
    height: 18px;
  }

  .menu-btn {
    position: relative;
    width: 20px;
    height: 20px;
    margin-right: 13px;
    align-self: flex-end;
    top: -12px;
  }

  .nav-menu {
    display: none;
  }
  
  .nav-menu.open {
    display: block;
  }

  .welcome-content {
    flex-wrap: wrap;
  }
  #about-text {
    font-size: 22px;
  }
  
  .welcome-content,
  .media-container2 {
    flex-direction: column;
    align-items: center;
  }
  .welcome-text,
  .welcome-image {
    width: 100%;
    padding: 0;
  }
  .welcome-image {
    margin-top: 15px;
  }
  .media-container2 {
    grid-template-columns: 1fr;
  }
  .nav-menu {
    display: none;
    right: 60%; 
  }
  
  
  .nav-menu.open {
    display: block;
  }
  
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.6rem;
  }
  p {
    font-size: 1rem;
  }
  hr {
    width: 70%;
  }

  .social-icons {
    justify-content: center;
    margin-left: 0;
    gap: 28px;
    flex-wrap: wrap;
  }

  .social-icon-white {
    display: none;
  }

  .social-icon-color {
    opacity: 1;
    display: block;
  }
  
  .section {
    min-height: auto; /* estää liian pitkät lohkot mobiilissa */
    padding: 20px 0;
  }
}

/* 3) Pienet puhelimet (~480px asti) */
@media (max-width: 480px) {
  .header-title {
    font-size: 1.8rem;
  }
  .profile-pic {
    width: 50px;
    height: 50px;
  }

  .frontpage-link {
    font-size: 28px;
  }

  .welcome-image {
    margin-top: 15px;
  }

  #about-text {
    font-size: 22px;
  }

  .nav-menu {
    display: none;
  }
  
  .nav-menu.open {
    display: block;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.3rem;
  }
  p {
    font-size: 0.9rem;
  }
  hr {
    width: 80%;
  }
  .menu-btn {
    width: 45px;
    height: 45px;
  }
}
