/*----- yleiset ------*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Metrophobic', sans-serif;
}

p {
  font-size: 17px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 3em;
}

section {
  display: block;
}

.photo {
  width: 25px;
}

/*----- yleiset ------*/


/*----- parallax / taustat ------*/

.background {
  background-image: url("../images/wall.jpg");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.parallax {
  background-image: url("../images/wall.jpg");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  z-index: 3;
}

@media screen and (max-width: 768px) {
  .background {
    background-attachment: scroll;   /* smoother on phones */
    background-position: 70% center; /* move focus horizontally */
  }
}

/*----- parallax / taustat ------*/


/*----- header / navbar ------*/

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 8vh;
  background-color: #252525;
  font-family: 'Metrophobic', sans-serif;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 80%;
  z-index: 100000;
  padding: 0 1rem;
}

.logo {
  color: rgba(255, 255, 255, 0.815);
  letter-spacing: 5px;
  font-size: 30px;
}

/* logo link + image */

.logo a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.815);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.logo a:hover {
  color: rgb(0, 0, 255);
  transition: 0.3s ease;
}

.photo {
  width: 25px;
}

.nav-links {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 1rem;
  width: auto;
}

.nav-links li {
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.815);
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 2px;
  font-size: 19px;
}

a:hover {
  color: rgb(0, 0, 255);
  transition: 0.3s ease;
}

.burger {
  display: none;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.815);
  margin: 5px;
}

/* Desktop tweak */
@media screen and (max-width: 1024px) {
  .nav-links {
    gap: 0.6rem;
  }
}

/* Small phones: shrink logo text & image */
@media screen and (max-width: 450px) {
  .logo {
    font-size: 1rem;
    letter-spacing: 2px;
  }

  .photo {
    width: 22px;
  }
}

/*----- mobile burger menu ------*/

@media screen and (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  nav {
    max-width: 100vw;
  }

  .nav-links {
    position: fixed;
    right: 0;
    top: 8vh;
    height: 92vh;
    background-color: #252525;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2rem;
    width: 60%;
    transform: translateX(100%);
    transition: 0.5s ease-in;
  }

  .nav-links li {
    opacity: 1;
  }

  .burger {
    display: block;
    cursor: pointer;
  }

  .nav-active {
    transform: translateX(0%);
  }
}

@keyframes navLinkFade {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0px);
  }
}

.toggle .line1 {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
  opacity: 0;
}

.toggle .line3 {
  transform: rotate(45deg) translate(-5px, -6px);
}

/*----- header / navbar ------*/


/*----- tiedot (hero) ------*/

.tiedot {
  padding-top: 8vh;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.tiedot_teksti {
  width: 50%;
  max-width: 600px;
  padding: 2em;
  margin: 2em;

  background: rgba(0, 0, 0, 0.45); /* dark glass */
  backdrop-filter: blur(4px);      /* optional, modern browsers */
  -webkit-backdrop-filter: blur(4px);

  border-radius: 0.75em;
}

.tiedot h1 {
  color: aliceblue;
}

.tiedot p {
  color: aliceblue;
  font-size: 1.2em;
}

.tiedot_teksti h1 {
  font-size: 2em;
}

/* hero tags under name */

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}

.hero-tag {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #e5ecff;
  background: rgba(0, 0, 0, 0.25);
}

/* hero CTA buttons */

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* generic button styles */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6em 1.4em;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.18s ease-out,
    color 0.18s ease-out,
    transform 0.12s ease-out,
    box-shadow 0.18s ease-out;
}

.btn-primary {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.55);
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.75);
}

.btn-outline {
  background: transparent;
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}

/* photo side */

.tiedot_photo {
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2em;

  position: relative;
  overflow: hidden; /* required for the fade */
}

.tiedot_photo img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  object-fit: contain;
  border-radius: 0.5em;
}

/* fade + blur at bottom of photo (default / desktop) */
.tiedot_photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 10%; /* how much of the bottom fades */

  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  pointer-events: none;
}

@media screen and (max-width: 768px) {
  .tiedot {
    flex-direction: column;
    align-items: center;
    padding-top: 10vh;
    background-attachment: scroll;
  }

  .tiedot_teksti {
    width: auto;
    max-width: 700px;
    padding: 2em 1.5em 1em;
    margin: 1em;
  }

  .tiedot_photo {
    width: 100%;
    padding: 1em 1.5em 2em;
  }

  .tiedot_photo img {
    max-height: 50vh;
  }

  /* slightly bigger + linear fade on mobile */
  .tiedot_photo::after {
    height: 25%;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.03) 40%,
      rgba(0, 0, 0, 0.2) 70%,
      rgba(0, 0, 0, 0.6) 100%
    );
  }
}

/*----- tiedot ------*/


/*----- heading sectionit ------*/

.heading-section {
  background-color: #252525;
  text-align: center;
  color: rgb(255, 255, 255);
  text-transform: uppercase;
  padding: 20px;
  position: relative;
  font-size: 1.1em;
}

.border {
  border: 0;
  border-top: 5px black solid;
  border-bottom: 5px black solid;
}

.border-up {
  border: 0;
  border-top: 5px black solid;
}

.border-down {
  border: 0;
  border-bottom: 5px black solid;
}

/*----- heading sectionit ------*/


/*----- osiot taustat ------*/

#koulutus,
#sertifikaatit {
  background: lightgray;
  display: flex;
  flex-direction: column;
}

#historia,
#portfolio,
#harrastukset,
#projektit {
  background: lightgray;
  padding-bottom: 4em;
  justify-content: space-around;
  display: flex;
  flex-direction: column;
}

/*----- koulutus (portfolio-tyyli) ------*/

.koulutus_container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
  width: 90%;
  margin: 2em auto;
  height: 100%;
  color: lightgray;
  padding: 1.25em;
}

.koulutus_box {
  padding: 1.5em 1.875em;
  background-color: rgb(255, 255, 255);
  position: relative;
  box-shadow: 0.5em 0.6em 0.6em grey;
  border-radius: 0.3em;
  height: auto;
  text-align: center;
  margin: 1.25em;
  width: 25em;
  flex-grow: 1;
  max-width: 45%;
  min-width: 300px;
}

.koulutus_box h1 {
  text-align: center;
  color: black;
  padding: 0.5em;
}

.koulutus_box h3 {
  text-align: center;
  color: rgb(0, 0, 255);
  padding: 0.5em 0;
}

.koulutus_box h4 {
  text-align: center;
  color: black;
}

.koulutus_box p {
  color: black;
  text-align: left;
}

@media screen and (max-width: 768px) {
  .koulutus_box {
    max-width: 100%;
  }
}

/*----- koulutus (portfolio-tyyli) ------*/


/*----- timeline / historia ------*/

.timeline {
  position: relative;
  max-width: 1200px;
  margin: 1em auto;
  padding: 1.75em 0;
  padding-top: 30px;
}

/* The vertical line */
.timeline::after {
  content: '';
  position: absolute;
  width: 0.5em;
  background-color: white;
  top: 10px;
  bottom: 0;
  left: 50%;
  margin-left: -4px;
  box-shadow: 0.5em 0 0.6em rgb(75, 75, 75);
  z-index: 0;
}

/* Arrow head pointing up */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 25px solid white;
  z-index: 1;
  filter: drop-shadow(0.2em 0.2em 0.2em rgba(75, 75, 75, 0.5));
}

.container {
  padding: 0.5em 2em;
  position: relative;
  width: 50%;
  text-align: center;
  z-index: 2;
}

.container::after {
  content: '';
  position: absolute;
  width: 25px;
  height: 25px;
  right: -17px;
  background-color: white;
  border: 4px solid rgb(0, 0, 255);
  top: 15px;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0.5em 0 0.6em grey;
}

.left {
  left: 0;
}

.right {
  left: 50%;
}

.right::after {
  left: -16px;
}

.left::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  right: 25px;
  border: medium solid white;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent white;
}

.right::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 3;
  left: 25px;
  border: medium solid white;
  border-width: 10px 10px 10px 0;
  border-color: transparent white transparent transparent;
}

.content {
  padding: 1.5em 1.875em;
  background-color: rgb(255, 255, 255);
  position: relative;
  box-shadow: 0.5em 0.6em 0.6em grey;
  border-radius: 0.3em;
  overflow: hidden;
}

.content h1 {
  text-align: center;
  color: black;
}

.content h3 {
  text-align: center;
  color: rgb(0, 0, 255);
  padding-bottom: 1.2em;
  font-size: 1.23em;
}

.content p {
  color: black;
}

/* Mobile timeline */
@media screen and (max-width: 700px) {
  .timeline::after {
    left: 31px;
  }

  .container {
    width: 85%;
    padding-left: 4em;
    padding-right: 0;
  }

  .container::before {
    left: 60px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
  }

  .left::after,
  .right::after {
    left: 15px;
  }

  .right {
    left: 0;
  }
}

/*----- timeline / historia ------*/


/*----- portfolio ------*/

.portfolio_container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-around;
  width: 90%;
  margin: 2em auto;
  height: 100%;
  color: lightgray;
  padding: 1.25em;
}

.portfolio_box {
  padding: 1.5em 1.875em;
  background-color: rgb(255, 255, 255);
  position: relative;
  box-shadow: 0.5em 0.6em 0.6em grey;
  border-radius: 0.3em;
  overflow: hidden;
  height: auto;
  text-align: center;
  margin: 1.25em;
  width: 40vh;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
}

.skills-card {
  max-width: 420px;
  text-align: left;
}

.skills-card h1 {
  text-align: left;
  margin-bottom: 0.4em;
}

.skills-description {
  margin-bottom: 0.9em;
  color: #4b5563;
  font-size: 0.95rem;
  text-align: center;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.skill-chip {
  font-size: 0.82rem;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition:
    background-color 0.18s ease-out,
    color 0.18s ease-out,
    transform 0.12s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.skill-chip:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

@media screen and (max-width: 768px) {
  .skills-card {
    max-width: 100%;
  }

  .skill-chip {
    font-size: 0.8rem;
  }
}

/* line between skill chips and detailed boxes */
.skills-divider {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  height: 3px;
  background: linear-gradient(
    to right,
    rgba(148, 163, 184, 0),
    rgba(148, 163, 184, 0.9),
    rgba(148, 163, 184, 0)
  );
  opacity: 0.9;
}


/*----- portfolio ------*/


/*----- harrastukset ------*/

.content_box {
  padding: 1.5em 1em;
  background-color: rgb(255, 255, 255);
  position: relative;
  box-shadow: 0.5em 0.6em 0.6em grey;
  border-radius: 0.3em;
  overflow: hidden;
  height: auto;
  text-align: center;
  margin: 1.25em;
  width: 100%;
}

.content_box img {
  width: 175px;
  margin: auto;
  float: left;
  padding-right: 1em;
}

/*----- harrastukset ------*/


/*----- fontit ------*/

.content_box h1,
.portfolio_box h1 {
  text-align: center;
  color: black;
  padding: 0.5em;
}

.content_box h3,
.portfolio_box h3 {
  text-align: center;
  color: rgb(0, 0, 255);
  padding: 0.5em 0;
}

.content_box p,
.portfolio_box {
  color: black;
  text-align: left;
}

/*----- fontit ------*/


/*----- yhteystiedot / footer ------*/

.yhteystiedot_container {
  color: dimgrey;
  background-color: #252525;
  padding: 4em 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* card-style contact box */
.content_yhteystiedot {
  color: #e5e7eb;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
  text-align: center;
  padding: 2.4em 2em;
  border-radius: 1.1rem;
  max-width: 480px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow:
    0 18px 35px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(15, 23, 42, 0.8);
  letter-spacing: normal;
  font-size: 0.95em;
}

.content_yhteystiedot h2 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.contact-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5f5;
}

/* contact rows */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.4rem 0 1.6rem;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #e5e7eb;
  font-size: 1.2rem;
}

.contact-item i {
  font-size: 1.5rem;
  color: #3b82f6;
}

/* social icons */
.social-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
  text-decoration: none;
  transition:
    background-color 0.18s ease-out,
    color 0.18s ease-out,
    transform 0.12s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.social-links a:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #60a5fa;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.85);
}

.contact-cta {
  margin-top: 0.3rem;
}

/* slightly tighter on small screens */
@media screen and (max-width: 480px) {
  .content_yhteystiedot {
    padding: 2em 1.4em;
  }
}

/*----- yhteystiedot / footer ------*/


/*----- icons ------*/

i {
  font-size: 1.2em;
  padding: 0.2em;
  color: rgb(0, 0, 255);
}

.icon {
  font-size: 1.2em;
  padding: 0.2em;
  color: rgb(0, 0, 255);
  -webkit-text-stroke: 0.5px rgb(255, 255, 255);
}

/*----- icons ------*/


/*===== HOVER STATES (cards) =====*/

.portfolio_box,
.content_box,
.koulutus_box,
.timeline .content {
  transition:
    transform 0.4s ease-out,
    box-shadow 0.4s ease-out,
    background-color 0.4s ease-out;
}

.portfolio_box:hover,
.content_box:hover,
.koulutus_box:hover,
.timeline .content:hover {
  transform: translateY(-4px);
  box-shadow: 0.75em 1em 1.2em rgba(0, 0, 0, 0.25);
}

/*===== SCROLL REVEAL ANIMATIONS =====*/

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* =========================================
    GLOBAL MOBILE OVERRIDES (MUST BE AT BOTTOM)
   ========================================= */

@media screen and (max-width: 700px) {
  
  /* Make ALL section containers 99% width on mobile */
  .portfolio_container,
  .koulutus_container {
    width: 100% !important; 
    padding: 0.5em; 
  }

  /* Shrink margins on the boxes themselves so they fit better */
  .portfolio_box,
  .content_box,
  .koulutus_box {
    margin: 1em 0.5em;
  }
}