/* ================================
   HEADER + NAVIGATION
================================ */

.header-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 12vh;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 2vw;
  z-index: 999;
  transition:
    background 0.3s ease,
    padding 0.3s ease;
}

.header-top.scrolled {
  background: var(--menu-glass-bg-open);
  backdrop-filter: var(--blur-header);
  -webkit-backdrop-filter: var(--blur-header);
  box-shadow: var(--shadow-header);
}

/* Branding */
.site-branding {
  display: flex;
  align-items: center;
}

.branding-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Logga – stor vid start */
.site-branding img {
  height: clamp(160px, 12vh, 180px);
  margin-top: 20vh;
  transform: scale(1.6) translateY(10%);
  transform-origin: left center;
  transition:
    transform 0.5s ease,
    height 0.5s ease,
    margin-top 0.5s ease;
}

/* Logga – liten vid scroll */
.header-top.scrolled .site-branding img {
  margin-top: 0;
  height: clamp(60px, 6vh, 80px);
  transform: scale(1) translateY(0);
}

/* Titel */
.site-title {
  line-height: 4rem;
  margin-top: 14.5rem;
  margin-left: 4rem;
  font-size: clamp(1.4rem, 3.8vw, 20rem);
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
}

.header-top.scrolled .site-title {
  line-height: normal;
  font-size: 1.3rem;
  margin-top: 0;
  margin-left: 0.5rem;
}

.sitewrapper {
  width: 100%;
  overflow-x: hidden;
}

/* ================================
   HAMBURGER-MENY
================================ */

.hamburger-menu {
  position: relative;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-toggle {
  background: transparent;
  backdrop-filter: var(--blur-menu-button);
  -webkit-backdrop-filter: var(--blur-menu-button);
  border: none;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.3s;
}

.menu-toggle span {
  width: 34px;
  height: 3px;
  background-color: var(--color-primary);
  transition:
    transform 0.4s ease,
    opacity 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ================================
   NAV-DRAWER
================================ */

.nav-drawer {
  position: fixed;
  top: 0;
  right: -100vw;
  width: 120vw;
  max-width: 350px;
  height: 100vh;
  padding: 120px 60px 60px;
  background: var(--menu-glass-bg);
  backdrop-filter: var(--blur-drawer);
  -webkit-backdrop-filter: var(--blur-drawer);
  box-shadow: var(--shadow-drawer);
  border-left: 1px solid var(--menu-border);
  opacity: 0;
  visibility: hidden;
  transform: translateX(40px);
  transition:
    transform 0.6s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.5s ease,
    visibility 0s linear 0.3s;
  z-index: 9999;
}

/* Drawer öppen */
.nav-drawer.open {
  right: 0;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    transform 0.6s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.5s ease,
    visibility 0s;
  background: var(--menu-glass-bg-open);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

/* Menylänkar */
.nav-drawer a {
  display: block;
  color: var(--menu-text-color);
  font-family: var(--font-main);
  text-transform: uppercase;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  transition:
    color 0.3s,
    transform 0.3s;
}

/* Fade-in animation */
.nav-drawer.open a {
  opacity: 0;
  transform: translateX(15px);
  animation: menuFadeIn 0.5s forwards;
}

.nav-drawer.open a:nth-child(1) {
  animation-delay: 0.1s;
}
.nav-drawer.open a:nth-child(2) {
  animation-delay: 0.2s;
}
.nav-drawer.open a:nth-child(3) {
  animation-delay: 0.3s;
}
.nav-drawer.open a:nth-child(4) {
  animation-delay: 0.4s;
}
.nav-drawer.open a:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateX(15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================================
   CLOSE-KNAPP
================================ */

.close-menu {
  position: absolute;
  top: 35px;
  right: 35px;
  width: 48px;
  height: 48px;
  border: none;
  background: var(--menu-close-bg);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  color: var(--menu-close-color);
  cursor: pointer;
  transition:
    background 0.3s ease,
    transform 0.3s ease;
  z-index: 10000;
}

/* ================================
   MOBIL
================================ */

@media (max-width: 768px) {
  .nav-drawer {
    width: 100vw;
    max-width: 500px;
    padding: 80px 30px;
    background: var(--menu-mobile-bg);
    box-shadow: none;
  }

  .nav-drawer a {
    font-size: 1.5rem;
    text-align: center;
  }

  .menu-toggle {
    width: 50px;
    height: 50px;
  }

  .header-top .site-branding img {
    margin-top: 7vh;
    height: clamp(80px, 10vh, 100px);
    transform: scale(1) translateY(0);
  }

  .site-title {
    margin-top: 2.4rem !important;
    line-height: normal;
    text-align: left;
    margin: 0;
  }

  .header-top.scrolled .site-title {
    line-height: 1;
    text-align: left;
    margin-top: 0.2rem !important;
  }
}

/* Laptops 14 and 15 inch */
@media (min-width: 1024px) and (max-width: 1700px) and (orientation: landscape) {
  .site-branding img {
    height: clamp(140px, 12vh, 160px);
  }
  .site-title {
    line-height: 4rem;
    margin-top: 11.7rem;
  }
}

@media (min-width: 1180px) and (max-width: 1320px) and (orientation: landscape) {
  .site-title {
    line-height: 3.3rem;
    margin-top: 11.7rem;
  }
}

@media (min-width: 1180px) and (max-width: 1320px) and (max-height: 640px) and (orientation: landscape) {
  .site-title {
    line-height: 3rem;
    margin-top: 9.7rem;
  }
}

/* ================================
   DESKTOP HOVER LOOK
================================ */

@media (hover: hover) and (pointer: fine) {
  .hamburger-menu {
    position: relative;
  }
  .nav-drawer {
    background: var(--menu-glass-bg-hover);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--menu-border-strong);
    box-shadow: var(--shadow-drawer-hover);
    pointer-events: auto;
  }
  .menu-toggle:hover {
    transform: scale(1.15);
  }

  .menu-toggle:hover span {
    background-color: var(--color-secondary);
  }

  .nav-drawer a:hover {
    color: var(--color-primary);
    transform: translateX(6px);
  }

  .close-menu:hover {
    background: var(--menu-close-bg-hover);
    transform: rotate(90deg);
  }
  .close-menu {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .site-branding img {
    height: clamp(150px, 12vh, 160px);
    margin-top: 10vh;
  }
  .site-title {
    margin-top: 9.5rem;
    line-height: 3.2rem;
    text-align: left;
    font-size: clamp(1.4rem, 4.5vw, 20rem);
  }
  .menu-toggle span {
    width: 50px;
    height: 4px;
  }
  .hamburger-menu {
    right: 2rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .site-branding img {
    height: clamp(100px, 12vh, 160px);
    margin-top: 30vh;
  }
  .site-title {
    line-height: 2.5rem;
    margin-top: 9rem;
    margin-left: 3.5rem;
  }
}

@media (min-width: 2000px) {
  .site-title {
    line-height: 4.5rem;
  }
}

@media (min-width: 2400px) {
  .site-title {
    font-size: 5.5rem;
    margin-left: 5rem;
    margin-top: 17.5rem;
    line-height: 5.5rem;
  }
}

@media (min-width: 768px) and (max-width: 819px) and (orientation: portrait) {
  .header-top .site-branding img {
    margin-top: 12vh;
    height: clamp(80px, 12vh, 150px);
    transform: scale(1) translateY(0);
  }

  .site-title {
    margin-top: 9rem;
    line-height: 3.2rem;
    margin-left: 0rem;
    text-align: left;
    font-size: clamp(1.4rem, 4.5vw, 20rem);
  }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .header-top {
    height: 15vh;
  }
}

@media (max-width: 800px) and (max-height: 500px) and (orientation: landscape) {
  .header-top {
    height: 25vh;
  }
}
