html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: black;
    overflow-x: hidden;
    font-family: 'Inter';
}

header {
    height: 110vh;
    min-height: 400px;
    padding: 20px;
    background: transparent;
    position: relative;
    z-index: 10;
}

#backgroundImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.name {
    position: absolute;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
    top: 80%;
    left: 150px; /* Adjust as needed */
    gap: 5px;
    animation: slideInFromLeft 1s ease-out;
}

.otsikko {
    position: absolute;
    display: none;
    justify-content: flex-start;
    align-items: center;
    top: 80%;
    left: 150px; /* Adjust as needed */
    font-family: 'Inter';
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255);
    font-size: 4rem;
}

.name span {
    display: inline-block;
    font-size: 4rem;
    transition: transform 0.3s ease, color 0.3s ease;
    cursor: pointer;
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255);
    font-family: 'Inter';
}

.name span:hover {
    transform: scale(1.4);
    color: white;
    text-shadow: 0 0 15px cyan, 0 0 30px orange;
}

.intro {
    color: white;
    font-size: 1.2rem;
    margin-top: 10px;
    position: absolute;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
    top: 65%;
    left: 200px; /* Adjust as needed */
    gap: 5px;
    text-shadow: 0 0 5px rgba(255, 255, 255);
    animation: slideInFromLeft 1s ease-out;
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100px) translateY(-50%) rotate(-90deg);
        opacity: 0;
    }
    100% {
        transform: translateX(0) translateY(-50%) rotate(-90deg);
        opacity: 1;
    }
}


.terminal-window {
    position: absolute;
    top: 30px;
    left: 300px;
    background: rgba(30, 30, 30, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
    max-width: 90vw;
    max-height: 90vh;
    min-width: 600px;
    overflow: auto;
    cursor: move;
    z-index: 1000;
}

.terminal-window-small {
  display: block;
  position: absolute;
  width: 300px;
  z-index: 5000;
  font-family: 'Courier New', monospace;
  background: rgba(30, 30, 30, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  top: 170px;
  right: 150px;
}

.terminal-window-small img {
    width: 200px;
    height: auto;
    border-radius: 8px;
    filter: grayscale(100%);
}

.terminal-header {
    background: rgba(45, 45, 45, 0.3);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(68, 68, 68, 0.5);
    cursor: grab; /* Grab cursor for header */
    user-select: none; /* Prevent text selection while dragging */
}

.terminal-header:active {
    cursor: grabbing;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close { background: #ff5f57; }
.minimize { background: #ffbd2e; }
.maximize { background: #28ca42; }

.terminal-title {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.terminal-body {
    padding: 20px;
    background: rgba(30, 30, 30, 0.5);
    color: #00ff00;
    min-height: 200px;
    font-size: 12px;
    line-height: 1.5;
}

.terminal-line {
    margin-bottom: 10px;
}

.prompt {
    color: #00ff00;
    font-weight: bold;
}

.command {
    color: #ffffff;
    margin-left: 5px;
}

.cursor {
    color: #00ff00;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.portfolio-here {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    font-size: 0.8rem;
}


nav ul {
    position: absolute;
    top: 10px;
    right: 130px;
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

nav ul li {
    display: inline;
    margin: 0 5px;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
    border: 1px solid white;
    border-radius: 24px;
    padding: 5px 10px;
    transition: all 0.5s ease;
}

nav ul li a:hover {
  letter-spacing: 3px;
  background-color: transparent;
  color: hsl(0, 0%, 100%);
  box-shadow: white;
}

nav ul li a:active {
    letter-spacing: 3px;
    background-color: transparent;
    color: hsl(0, 0%, 100%);
    box-shadow: white;
}

.logo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

.logo a:hover {
    box-shadow: white 0 0 10px;
}

.button {
  padding: 5px 10px;
  border-radius: 50px;
  cursor: pointer;
  border: 1px solid white;
  background-color: transparent;
  color: white;
  box-shadow: rgb(0 0 0 / 5%) 0 0 8px;
  letter-spacing: 1.5px;
  font-size: 12px;
  transition: all 0.5s ease;
  position: absolute;
  top: 20px;
  left: 20px;
}

.button:hover {
  letter-spacing: 3px;
  background-color: transparent;
  color: hsl(0, 0%, 100%);
  box-shadow: white;
}

.button:active {
  letter-spacing: 3px;
  background-color: transparent;
  color: hsl(0, 0%, 100%);
  box-shadow: white;
  transform: translateY(10px);
  transition: 100ms;
}

#portfolio {
    min-height: 100vh;
}

#portfolio-header{
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: white;
    margin-left: 50px;
    font-family: 'Inter';
}

.project-grid {
  display: flex;
  flex-direction: row;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-left: 50px;
  margin-top: 30px;
}

.project-card {
  width: 300px;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
  overflow: hidden;
  transition: transform 0.2s;
}

.project-card:hover {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  width: 100%;
  padding: 16px;
  border-radius: 0 0 16px 16px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #222;
  color: white;
  padding: 32px;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 16px; right: 24px;
  font-size: 2rem;
  cursor: pointer;
}

#modal-carousel img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Carousel button styles */
.carousel-btn {
  background: rgba(30,30,30,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.carousel-btn:hover {
  background: #fff;
  color: #222;
  transform: scale(1.1) translateY(-50%);
}

#carousel-prev {
  left: 10px;
}

#carousel-next {
  right: 10px;
}

.visit-site-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 24px;
  background: #fff;
  color: #222;
  border-radius: 24px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}

.visit-site-btn:hover {
  background: #222;
  color: #fff;
}

.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  border: none;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 200000;
}

.burger-btn span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 1);
  z-index: 19999;
  padding-top: 100px;
}

.mobile-nav li {
  list-style: none;
  padding: 0;
  margin: 0;
  margin: 24px 0;
  text-align: left;
  box-shadow: -2px 0 12px rgba(0,0,0,0.3);
}

.mobile-nav a {
  color: #fff;
  font-size: 3rem;
  text-decoration: none;
  font-weight: bold;
  font-family: 'Inter';
  padding: 12px 24px;
  display: block;
  border-radius: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s;
  z-index: 29999;
}

.mobile-nav a:hover {
  background: #222;
}

@media (max-width: 1400px) {

    html, body {
        overflow-x: hidden;
    }

    #portfolio-header {
        font-size: 2rem;
        margin-left: 20px;
    }

    .project-card {
        width: 250px;
        height: 150px;
    }

    .project-overlay {
        padding: 12px;
    }

    .terminal-body {
        font-size: 10px;
    }

    .terminal-window-small {
        right: 100px;
    }

    .terminal-window {
        max-width: 300px;
        left: 250px;
    }
    

}

@media (max-width: 1200px) {

    .otsikko {
      display: block;
      transform: rotate(0deg);
      top: 30px;
      left: 60px;
      animation: none;
    }
    .name {
      display: none;
    }
    .intro {
      transform:rotate(0deg);
      top: 135px;
      left: 100px;
      animation: none;
    }
    .terminal-window-small {
        right: 150px;
        top: 300px;
    }
    .terminal-window {
        top: 200px;
        left: 60px;
    }
    nav ul {
    display: none;
    }
    .button {
    display: none;
    }
    .burger-btn {
    display: flex;
    flex-direction: column;
    } 
    .logo {
        position: relative;
        top: 0px;
        left: 0px;
        right: auto;
        margin: 0;
    }
}

@media (max-width: 1100px) {


  .terminal-window {
    left: 50px;
  }

  .terminal-window-small {
    right: 50px;
    top: 250px;
    width: 200px;
    height: 200px;
  }

  .terminal-window-small img {
    width: 150px;
    height: auto;
  }
}

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

    .otsikko {
      top: 30px;
      left: 40px;
    }
    .intro {
      top: 140px;
      left: 100px;
    }

    .terminal-window {
      left: 20px;
      min-width: unset;
      max-width: 90vw;
    }

    .terminal-window-small {
      display: none !important;
    }

}

@media (max-width: 480px) {

   html, body {
        overflow-x: hidden;
    }

    .otsikko {
      top: 40px;
      left: 50px;
      font-size: 2.5rem;
    }
    .intro {
      top: 110px;
      left: 80px;
      font-size: 0.7rem;
    }

    .terminal-window {
      left: 20px;
      top: 160px;
      min-width: unset;
      max-width: 90vw;
    }
    .logo {
      width: 60px;
      height: auto;
    }

}