/* Dynamisk accent (blå-lilla øverst, lilla nederst – settes av JS ved scroll) */
:root {
  --dynamic-accent: rgb(49, 72, 249);
  --dynamic-accent-r: 49;
  --dynamic-accent-g: 72;
  --dynamic-accent-b: 249;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.btn-primary {
  background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0b5ed7 0%, #520dc2 100%);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 90px;
  background: #0b1020;
  color: #d8e6ff;
}

.starfield-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.floating-moon {
  position: fixed;
  top: 32%;
  left: -20%;
  width: 72px;
  height: 72px;
  z-index: 0;
  pointer-events: none;
  animation: moon-drift 40s linear infinite;
  will-change: left, transform;
}

.floating-moon__svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(244, 240, 224, 0.4));
}

@keyframes moon-drift {
  0% { left: -20%; transform: translateY(0) scale(1); }
  8% { left: -10%; transform: translateY(-10px) scale(1.02); }
  25% { left: 35%; transform: translateY(-12px) scale(1.02); }
  48% { left: 98%; transform: translateY(4px) scale(1); }
  52% { left: 108%; transform: translateY(4px) scale(1); }
  58% { left: 108%; transform: translateY(6px) scale(1); }
  65% { left: 92%; transform: translateY(8px) scale(1.02); }
  82% { left: 35%; transform: translateY(10px) scale(1.02); }
  92% { left: -10%; transform: translateY(4px) scale(1); }
  100% { left: -20%; transform: translateY(0) scale(1); }
}

.hamburger-btn {
  position: fixed;
  top: 10px;
  left: 15px;
  z-index: 1050;
  width: 50px;
  height: 50px;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.name-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1040;
  min-height: 70px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(22, 29, 48, 0.88) 0%, rgba(18, 24, 41, 0.88) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(4, 6, 16, 0.35);
  text-align: center;
}

.name-banner__inner {
  max-width: 980px;
  margin: 0 auto;
  color: #d8e6ff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28rem;
  font-size: 1.1rem;
}

.name-banner__link {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.name-banner__link:hover {
  color: #e8eeff;
  opacity: 0.95;
}

@media (min-width: 768px) {
  .name-banner__inner {
    font-size: 1.4rem;
    letter-spacing: 0.38rem;
  }
}

.hamburger-btn:hover { transform: scale(1.08); opacity: 0.9; }
.hamburger-btn:focus {
  box-shadow: none;
  outline: 2px solid rgba(216, 230, 255, 0.4);
  outline-offset: 2px;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  width: 24px;
  height: 18px;
  margin: auto;
}

.hamburger-icon span {
  display: block;
  height: 3px;
  background-color: var(--dynamic-accent);
  border-radius: 4px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 8px rgba(var(--dynamic-accent-r), var(--dynamic-accent-g), var(--dynamic-accent-b), 0.5),
              0 0 12px rgba(var(--dynamic-accent-r), var(--dynamic-accent-g), var(--dynamic-accent-b), 0.25);
}

.hamburger-icon span:nth-child(1) { width: 20px; }
.hamburger-icon span:nth-child(2) { width: 14px; }
.hamburger-icon span:nth-child(3) { width: 24px; }

.menu-close-btn {
  position: fixed;
  top: 10px;
  left: 15px;
  z-index: 1051;
  width: 50px;
  height: 50px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-close-btn:hover { transform: scale(1.08); opacity: 0.9; }
.menu-close-btn:focus {
  box-shadow: none;
  outline: 2px solid rgba(216, 230, 255, 0.4);
  outline-offset: 2px;
}

.menu-close-icon {
  display: block;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23d8e6ff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414 1.707 15.707a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/24px no-repeat;
}

.offcanvas-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(11, 16, 32, 0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
}

.offcanvas-fullscreen-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: transparent;
}

.popover-nav { gap: 0.5rem; }

.popover-link {
  color: #d8e6ff !important;
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.75rem 1rem;
  text-align: center;
  transition: color 0.2s ease, opacity 0.2s ease;
  border: none;
  background: transparent;
}

.popover-link:hover { color: #e8eeff !important; opacity: 0.95; }
.popover-link.active { font-weight: 600; color: #e8eeff !important; }

.main-content {
  position: relative;
  z-index: 1;
  padding-top: 100px;
}

@media (min-width: 768px) {
  .main-content { padding-top: 116px; }
}

.footer-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  padding: 1.25rem 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(180deg, transparent 0%, rgba(11, 16, 32, 0.92) 20%, rgba(18, 24, 41, 0.92) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-banner__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2rem;
}

.footer-banner__link {
  color: rgba(216, 230, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-banner__link:hover { color: #e8eeff; opacity: 1; }
.footer-banner__link.active { color: #e8eeff; font-weight: 600; }
.footer-banner__copy { margin: 0; color: rgba(216, 230, 255, 0.5); font-size: 0.85rem; }

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: linear-gradient(135deg, #161d30 0%, #121829 100%);
  color: #d8e6ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.card .text-muted { color: rgba(216, 230, 255, 0.72); }

.home-features {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.home-features .card {
  background: linear-gradient(135deg, rgba(22, 29, 48, 0.72) 0%, rgba(18, 24, 41, 0.72) 100%);
  border-color: rgba(255, 255, 255, 0.04);
}

.home-feature-card { opacity: 0; transition: transform 0.6s ease-out, opacity 0.5s ease-out; }
.home-feature-card--left { transform: translateX(-80px); }
.home-feature-card--right { transform: translateX(80px); }
.home-feature-card--left.in-view, .home-feature-card--right.in-view { opacity: 1; transform: translateX(0); }

.about-page__blocks {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.about-page__blocks .card {
  background: linear-gradient(135deg, rgba(22, 29, 48, 0.72) 0%, rgba(18, 24, 41, 0.72) 100%);
  border-color: rgba(255, 255, 255, 0.04);
  color: #d8e6ff;
}

.about-page__slide { opacity: 0; transition: transform 0.6s ease-out, opacity 0.5s ease-out; }
.about-page__slide--left { transform: translateX(-80px); }
.about-page__slide--right { transform: translateX(80px); }
.about-page__slide--left.in-view, .about-page__slide--right.in-view { opacity: 1; transform: translateX(0); }

.about-page__header--top {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
}

.about-page__title {
  color: #e8eeff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.35rem;
}

.about-page__ctas { margin-top: 0.5rem; }
.about-page__cta { margin-bottom: 0; }

.about-page__github-btn, .about-page__linkedin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(216, 230, 255, 0.95);
  background: rgba(54, 58, 70, 0.8);
  border: 1px solid rgba(75, 79, 89, 0.8);
  border-radius: 8px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.about-page__github-btn:hover, .about-page__linkedin-btn:hover {
  color: #e8eeff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(216, 230, 255, 0.4);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.about-page__github-icon, .about-page__linkedin-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.about-page__heading {
  color: #d8e6ff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 3px solid rgba(49, 72, 249, 0.7);
}

.about-page__summary { color: rgba(216, 230, 255, 0.92); line-height: 1.7; margin: 0; }
.about-page__highlights { list-style: none; padding: 0; margin: 0; }

.about-page__highlights li {
  color: rgba(216, 230, 255, 0.92);
  line-height: 1.65;
  padding: 0.35rem 0 0.35rem 1.25rem;
  position: relative;
}

.about-page__highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(49, 72, 249, 0.8);
  box-shadow: 0 0 10px rgba(49, 72, 249, 0.4);
}

.projects-page { max-width: 720px; }
.projects-page__header { margin-bottom: 2.5rem; }
.projects-page__title {
  color: #e8eeff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.35rem;
}
.projects-page__intro { color: rgba(216, 230, 255, 0.9); font-size: 1.1rem; margin: 0; }
.projects-page__list { display: flex; flex-direction: column; gap: 1.5rem; }

.project-card {
  background: rgba(216, 230, 255, 0.06);
  border: 1px solid rgba(216, 230, 255, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  border-color: rgba(49, 72, 249, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.project-card__thumb-link {
  display: block;
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.project-card__thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-card__title { color: #e8eeff; font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem 0; }
.project-card__description { color: rgba(216, 230, 255, 0.88); font-size: 0.95rem; line-height: 1.6; margin: 0 0 1rem 0; }
.project-card__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.project-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(216, 230, 255, 0.95);
  background: #363a46;
  border: 1px solid #4b4f59;
  border-radius: 8px;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card__btn:hover {
  color: #e8eeff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(216, 230, 255, 0.4);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.project-detail { max-width: 820px; }
.project-detail__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.project-detail__back-link {
  color: rgba(216, 230, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
}
.project-detail__back-link:hover { color: #e8eeff; text-decoration: underline; }
.project-detail__header { margin-bottom: 2rem; }
.project-detail__title {
  color: #e8eeff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  margin: 0 0 0.5rem 0;
}
.project-detail__description { color: rgba(216, 230, 255, 0.9); font-size: 1.05rem; line-height: 1.7; margin: 0; }
.project-detail__gallery { margin-bottom: 2rem; }

.project-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 100%;
}

.project-gallery__item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(216, 230, 255, 0.12);
  opacity: 0;
  transition: transform 0.6s ease-out, opacity 0.5s ease-out;
}
.project-gallery__item--left { transform: translateX(-80px); }
.project-gallery__item--right { transform: translateX(80px); }
.project-gallery__item--left.in-view, .project-gallery__item--right.in-view { opacity: 1; transform: translateX(0); }

.project-gallery__img { display: block; width: 100%; height: auto; vertical-align: top; }
.project-gallery__caption {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(216, 230, 255, 0.85);
  background: rgba(36, 39, 48, 0.6);
  border-top: 1px solid rgba(216, 230, 255, 0.08);
}

.project-detail__github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(90deg, #4F58FF 0%, #8A4FFF 100%);
  border: none;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.project-detail__github-btn:hover { color: #fff; opacity: 0.92; box-shadow: 0 4px 20px rgba(79, 88, 255, 0.4); }
.project-detail__github-btn--top {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  background: linear-gradient(90deg, #4F58FF 0%, #8A4FFF 100%);
  color: #fff;
  border: none;
}
.project-detail__github-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
