* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #0b0b0b;
  color: #ddd;
  line-height: 1.6;
}

.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 11, 0.9);
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
}

.nav-logo {
  color: #b26cff;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-menu {
  list-style: none;
  display: flex;
}

.nav-item {
  margin-left: 2rem;
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #b26cff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.nav-toggle .bar {
  height: 3px;
  width: 25px;
  background-color: #fff;
  margin: 4px 0;
  transition: 0.3s;
}

.section {
  padding: 100px 20px;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

h2 {
  color: #b26cff;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border: 2px solid #b26cff;
  color: #b26cff;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}

.btn:hover {
  background-color: #b26cff;
  color: #0b0b0b;
}

.home-section {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.home-content .btn {
  margin-top: 1rem;
}

.name-highlight {
  color: #b26cff;
}

.about-content {
  display: flex; /* Plasserer elementene på en linje */
  align-items: center; /* Vertikalt sentrerer innholdet */
  gap: 3rem; /* Legger til luft mellom tekst og bilde (juster etter ønske) */
  flex-wrap: wrap; /* Lar elementene stables på små skjermer */
}

.about-text {
  flex: 1; /* Forteller teksten at den skal fylle all tilgjengelig plass */
  margin-bottom: 1.5rem; /* Gir luft under hvert avsnitt */
}

.about-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-img img {
  width: 280px; /* Litt større bilde for bedre balanse */
  height: 280px; /* Sørger for at bildet er en perfekt sirkel */
  object-fit: cover; /* Hindrer at bildet strekkes */
  border-radius: 50%;
  border: 3px solid #b26cff;
  transition: transform 0.4s ease;
}

.about-img img:hover {
  transform: scale(1.1);
}

#experience {
  color: #d1b3ff;
  background-color: #0d0d0d;
  padding: 50px;
  font-family: Arial, sans-serif;
}

h2 {
  font-size: 2em;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.5em;
  margin-top: 30px;
  margin-bottom: 15px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 20px;
}

.skill {
  text-align: center;
  background-color: #1a1a1a;
  padding: 15px;
  border-radius: 15px;
  transition: transform 0.4s ease, background-color 0.3s;
}

.skill img {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
}

.skill:hover {
  transform: scale(1.1);
  background-color: #393939;
}

.projects-section {
  text-align: center;
  padding: 4rem 2rem;
}

.projects-section h2 {
  font-size: 2.5rem;
  color: #b26cff;
  margin-bottom: 3rem;
}

.projects-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.project-card {
  background-color: #151515;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  width: 350px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.project-card:hover {
  background-color: #1d1d1d;
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 30px rgba(178, 108, 255, 0.2);
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: transform 0.4s ease;
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-card h3 {
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.5rem;
  margin-top: 1px;
}

.project-card p {
  color: #ccc;
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tags span {
  background-color: #2a2a2a;
  color: #b26cff;
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  transition: all 0.3s ease;
  cursor: default;
}

.tags span:hover {
  background-color: #b26cff;
  color: #fff;
  transform: scale(1.05);
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.2rem;
  padding: 0.5rem 1rem;
  border: 2px solid #b26cff;
  color: #b26cff;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.github-btn:hover {
  background-color: #b26cff;
  color: #fff;
  transform: translateY(-2px);
}

#resume .btn {
  margin-top: 20px;
  justify-content: center;
  align-items: center;
}

.footer {
  text-align: center;
  padding: 2rem 0;
  color: #666;
}

/* --- Animations --- */
.fade-in,
.slide-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.show {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .nav-menu {
    position: absolute;
    top: 100%;
    left: -100%;
    flex-direction: column;
    background: #0b0b0b;
    width: 100%;
    transition: left 0.3s;
  }
  .nav-menu.active {
    left: 0;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-item {
    margin: 1.5rem 0;
    text-align: center;
  }

  .about-content {
    flex-direction: column; /* Stabler tekst og bilde vertikalt */
    text-align: center; /* Sentrerer teksten på mobil */
  }
}

.typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid #b26cff;
  width: 0;
  animation: typing 3s steps(30, end) forwards, blink 0.8s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}
