:root {
  --bg: #0b1020;
  --bg-2: #111733;
  --card: rgba(21, 28, 58, 0.7);
  --card-solid: #151c3a;
  --border: rgba(35, 48, 99, 0.8);
  --text: #e6ebff;
  --muted: #93a0c8;
  --accent: #6c8cff;
  --accent-2: #38d6c5;
  --accent-3: #b06cff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- BAKGRUNNS-BLOBS ---------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bg-blobs::before {
  /* Subtilt grid-overlay for tech-feel */
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(108, 140, 255, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(108, 140, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 30%,
    transparent 75%
  );
}

.bg-blobs::after {
  /* Vignette for å mørkne kantene litt */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(11, 16, 32, 0.6) 100%
  );
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.blob-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: -120px;
  left: -120px;
  animation: drift1 22s ease-in-out infinite;
}

.blob-2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  top: 20%;
  right: -140px;
  animation: drift2 26s ease-in-out infinite;
}

.blob-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-3), transparent 70%);
  bottom: -180px;
  left: 30%;
  opacity: 0.4;
  animation: drift3 30s ease-in-out infinite;
}

.blob-4 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: 55%;
  left: 10%;
  opacity: 0.35;
  animation: drift4 24s ease-in-out infinite;
}

@keyframes drift1 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(80px, 60px) scale(1.1);
  }
  66% {
    transform: translate(40px, 120px) scale(0.95);
  }
}

@keyframes drift2 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-100px, 80px) scale(1.15);
  }
}

@keyframes drift3 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-60px, -90px) scale(1.05);
  }
  66% {
    transform: translate(80px, -40px) scale(0.9);
  }
}

@keyframes drift4 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(120px, -60px) scale(1.2);
  }
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---------- NAV ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(11, 16, 32, 0.55);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.6s ease-out;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.25s ease, filter 0.25s ease;
  flex-shrink: 0;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(108, 140, 255, 0.5));
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ---------- HERO ---------- */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 200% 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #0b1020;
  box-shadow: var(--shadow);
  position: relative;
  animation: gradientShift 8s ease infinite, float 5s ease-in-out infinite;
}

.avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: blur(18px);
  opacity: 0.45;
  z-index: -1;
  animation: pulse 4s ease-in-out infinite;
}

.avatar img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  background: linear-gradient(
    90deg,
    var(--text) 0%,
    var(--accent) 50%,
    var(--text) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

.hero .tagline {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.cta {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    border-color 0.25s ease, background 0.25s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1020;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(108, 140, 255, 0.4);
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
  background: rgba(21, 28, 58, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.12);
  transform: translateY(-2px);
}

/* ---------- SECTIONS ---------- */
section {
  padding: 70px 0;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--muted);
  margin-bottom: 36px;
}

/* ---------- ABOUT ---------- */
.about-card {
  background: var(--card);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.about-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.about-card p {
  color: var(--muted);
}

.about-card p + p {
  margin-top: 14px;
}

/* ---------- EDUCATION ---------- */
.semester {
  margin-bottom: 32px;
}

.semester-title {
  color: var(--accent-2);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.85rem;
  font-weight: 600;
}

.courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.course {
  background: var(--card);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.6s ease forwards;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.course::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(108, 140, 255, 0.12),
    transparent
  );
  transition: left 0.6s ease;
}

.course:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(108, 140, 255, 0.2);
}

.course:hover::before {
  left: 125%;
}

.course-code {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.course-name {
  font-weight: 600;
  font-size: 0.98rem;
}

/* ---------- SKILLS ---------- */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill {
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.5s ease forwards;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.skill:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(108, 140, 255, 0.15);
}
/* ---------- FRITID / PROSJEKTER ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.project {
  background: var(--card);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.project::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(108, 140, 255, 0.12),
    transparent
  );
  transition: left 0.6s ease;
}

.project:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(108, 140, 255, 0.2);
}

.project:hover::before {
  left: 125%;
}

.project-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(108, 140, 255, 0.15),
    rgba(56, 214, 197, 0.15)
  );
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-shrink: 0;
}

.project-content {
  flex: 1;
  min-width: 0;
}

.project-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.project-content p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.project-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-2);
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.project:hover .project-link {
  transform: translateX(4px);
}

/* ---------- FEATURED PROJECT (CODE ISLAND) ---------- */
.featured-project {
  background: linear-gradient(
    135deg,
    rgba(108, 140, 255, 0.08),
    rgba(56, 214, 197, 0.06),
    rgba(176, 108, 255, 0.08)
  );
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.featured-project::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(108, 140, 255, 0.18),
    transparent 70%
  );
  filter: blur(40px);
  z-index: 0;
  animation: drift1 18s ease-in-out infinite;
}

.featured-project > * {
  position: relative;
  z-index: 1;
}

.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 214, 197, 0.12);
  border: 1px solid rgba(56, 214, 197, 0.4);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.featured-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(56, 214, 197, 0.6);
  animation: livePulse 2s ease-in-out infinite;
}

.featured-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  background: linear-gradient(
    90deg,
    var(--text) 0%,
    var(--accent) 50%,
    var(--accent-2) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}

.featured-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 720px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.featured-content {
  margin-bottom: 32px;
}

.featured-content p {
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.7;
  max-width: 800px;
}

.featured-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 24px;
  margin-bottom: 28px;
  background: rgba(11, 16, 32, 0.4);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}

.featured-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.tech-tag {
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(11, 16, 32, 0.5);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.featured-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 600px) {
  .featured-project {
    padding: 28px 24px;
  }
  .featured-stats {
    padding: 18px;
  }
  .stat-number {
    font-size: 1.6rem;
  }
}

/* ---------- CONTACT ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.contact-card {
  background: var(--card);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease;
  display: block;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(108, 140, 255, 0.22);
}

.contact-label {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.contact-value {
  font-weight: 600;
  word-break: break-word;
}

/* ---------- FOOTER ---------- */
footer {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ---------- REVEAL-ANIMASJON ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

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

/* ---------- KEYFRAMES ---------- */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .nav-links {
    gap: 16px;
  }
  .hero {
    padding: 70px 0 50px;
  }
  .blob {
    filter: blur(70px);
  }
}

/* ---------- "PÅGÅR"-BADGE ---------- */
.semester-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.badge-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 214, 197, 0.12);
  border: 1px solid rgba(56, 214, 197, 0.4);
  color: var(--accent-2);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
}

.badge-current::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(56, 214, 197, 0.6);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(56, 214, 197, 0.6);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(56, 214, 197, 0);
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}