.desktop {
  display: none;

  @media (min-width: 768px) {
    display: block;
  }
}

.mobile {
  display: block;

  @media (min-width: 768px) {
    display: none;
  }
}

.nav-container {
  margin: 0 auto;
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  z-index: 11;
  height: 6rem;
  background-color: transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, right 0.3s ease;
  
  &.scrolled,
  &.details-open {
    background-color: hsl(from var(--background-color) h s l / 0.95);
    box-shadow: 0 2px 10px hsl(from var(--background-color) h s l / 0.2);
    backdrop-filter: blur(6px);
  }

  &.sticky-nav {
    background-color: hsl(from var(--background-color) h s l / 0.95);
  }

  @media (min-width: 768px) {
    height: auto;
    padding-top: 2rem;
  }
}

.nav-inner-container {
  position: relative;
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  

  @media (min-width: 768px) {
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
  }
}

.top-bar {
  display: none;

  @media (min-width: 768px) {
    display: flex;
    justify-content: flex-end;
  }

  & a {
    padding: 0 1rem;
  }
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  font-size: 0.875rem;
  text-decoration: none;

  & svg {
    width: 1.5rem;
    height: 1.5rem;
  }
}

.nav-logo-link {
  position: absolute;
  top: var(--hamburger-margin);
  left: var(--hamburger-margin);
  width: 33%;
  max-height: 6rem;
  max-width: 20rem;
  z-index: 11;

  @media (min-width: 572px) {
    width: 25%;
  }

  @media (min-width: 768px) {
    position: initial;
    padding-top: 1rem;
    padding-bottom: 1rem;
    transform: translateY(-40%);
  }

  & img {
    width: auto;
    max-height: 100%;
  }
}

.hamburger-menu {
  display: flex;
  --x-width: calc(var(--hamburger-height) * 1.41421356237);
  position: absolute;
  top: var(--hamburger-margin);
  right: var(--hamburger-margin);
  flex-direction: column;
  width: max-content;
  gap: var(--hamburger-gap);
  cursor: pointer;
  z-index: 11;

  &::has(input:focus-visible)::before,
  &::has(input:focus-visible)::after,
  & input:focus-visible {
    border: 1px solid var(--background-color);
    box-shadow: 0 0 0 1px var(--text-color);
  }

  &::before,
  &::after,
  & input {
    content: '';
    width: var(--bar-width);
    height: var(--bar-height);
    background-color: var(--text-color);
    border-radius: 999px;
    transform-origin: left center;
    transition: opacity var(--animation-timing), width var(--animation-timing), rotate var(--animation-timing), translate var(--animation-timing);
  }

  & input {
    appearance: none;
    outline: none;
    pointer-events: none;
  }

  &:has(input:checked)::before {
    transform: rotate(45deg);
    width: var(--x-width);
    translate: 0 calc((var(--bar-height) / -2));
  }

  &:has(input:checked)::after {
    transform: rotate(-45deg);
    width: var(--x-width);
    translate: 0 calc((var(--bar-height) / 2));
  }

  & input:checked {
    opacity: 0;
    width: 0;
  }

  @media (min-width: 768px) {
    display: none;
  }
}

.main-nav {
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100dvh;
  z-index: 10;
  background-color: var(--background-color);
  display: flex;
  flex-direction: column;

  .hamburger-menu:has(input:checked) + & {
    right: 0;
  }

  @media (min-width: 768px) {
    position: initial;
    width: auto;
    height: auto;
    background-color: transparent;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  & .nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    list-style: none;
    margin-top: calc(var(--hamburger-height) + 3rem);
    flex-grow: 1;

    @media (min-width: 768px) {
      flex-direction: row;
      margin-top: 0;
      height: auto;
      gap: 2rem;
      padding: 0;
    }
  }

  & .nav-details {
    display: flex;
    flex-direction: column;
  }

  & li {
    height: max-content;
  }

  & .nav-link {
    position: relative;
    display: flex;
    padding: 0.5rem 1rem;
    flex-direction: row-reverse;
    justify-content: space-between;
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    text-align: right;
    z-index: 10;

    @media (min-width: 768px) {
      &:hover {
        color: hsl(from var(--accent-color) h s l / 0.5);
      }
    }
  }

  & .nav-sublink {
    margin-right: 2rem;
    margin-top: 0.5rem;
  }

  & .nav-link.highlighted {
    color: var(--accent-color);
    border-bottom: var(--accent-color);
  }

  & .nav-summary {
    @media (min-width: 768px) {
      &:hover {
        color: hsl(from var(--accent-color) h s l / 0.5);
        cursor: pointer;
      }
    }
  }

  .nav-summary-link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
  }

  & .nav-sublinks-container {
    @media (min-width: 768px) {
      position: absolute;
      width: 100%;
      top: 100%;
      left: 0;
      display: flex;
      justify-content: space-around;
      background-color: hsl(from var(--background-color) h s l / 0.95);
      box-shadow: 0 4px 8px hsl(from var(--background-color) h s l / 0.2);
      border-bottom-right-radius: 1rem;
      border-bottom-left-radius: 1rem;
      padding: 1.5rem 2rem;
    }

    @media (min-width: 1440px) {
      transform: translateX(calc(-1 * (100% - 1440px) / 2));
    }

    & .nav-sublinks-image {
      max-height: 33vh;
      width: 33%;
      overflow: hidden;
    }

    & .nav-sublinks-image img {
      height: 100%;
      width: 100%;
      object-fit: cover;
      border-radius: 1rem;
    }
  }

  & .nav-plus::before {
    position: absolute;
    content: '';
    top: 50%;
    left: 1rem;
    width: 1rem;
    height: 1rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform-origin: center;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease;

    @media (min-width: 768px) {
      display: none;
    }
  }

  & .nav-details:open > .nav-link > .nav-plus::before {
    transform: translateY(-50%) rotate(-135deg);
  }

  & .mobile-top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding-bottom: 3rem;

    & .contact-link svg {
      width: 2rem;
      height: 2rem;
    }

    @media (min-width: 768px) {
      display: none;
    }
  }
}

.background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;

  &.active {
    opacity: 1;
  }

  @media (min-ascpect-ratio: 16/9) {
    width: 100%;
    height: auto;
  }

  @media (max-ascpect-ratio: 16/9) {
    width: auto;
    height: 100%;
  }
}

.main-header {
  position: relative;
  width: 100%;
  height: 100dvh;
  background-color: hsl(from var(--background-color) h s l / 0.5);
}

.main-header-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding-inline: 1rem;
  text-align: center;
  color: var(--text-color);
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  z-index: -1;

  &.active {
    z-index: 1;
    opacity: 1;
  }
}

.main-header-title {
  font-size: 2rem;
  margin-bottom: 1rem;

  @media (min-width: 768px) {
    font-size: 3rem;
  }
}

.main-header-subtitle {
  font-size: 1.125rem;
  margin-bottom: 2rem;

  @media (min-width: 768px) {
    font-size: 1.5rem;
  }
}

.btn-outline {
  position: relative;
  display: inline-block;
  padding: 0.75rem 1.75rem;
  color: var(--text-color);
  border: 2px solid var(--text-color);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.5px;
  overflow: hidden;
  transition: color 0.4s ease;

  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--text-color);
    z-index: 0;
    transition: width 0.4s ease;
  }

  & span {
    position: relative;
    z-index: 1;
  }

  &:hover::before {
    width: 100%;
  }

  &:hover span {
    color: hsl(from var(--background-color) h s l);
  }
}

.cta:hover {
  background-color: var(--accent-color);
}

.scroll-btn {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(156,102,68,0.9), rgba(156,102,68,0.6));
  box-shadow: 0 6px 15px rgba(0,0,0,0.3), inset 0 -3px 8px rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 9;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.scroll-btn:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 -3px 10px rgba(255,255,255,0.3);
}

.arrow-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fall 1.2s infinite ease-in-out;
}

.arrow-wrapper:nth-child(2) {
  animation-delay: 0.2s;
}
.arrow-wrapper:nth-child(3) {
  animation-delay: 0.4s;
}

.arrow {
  width: 10px;
  height: 10px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
}

@keyframes fall {
  0% {
    transform: translateY(-12px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(12px);
    opacity: 0;
  }
}

.limited-width-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.section-description {
  font-size: 1.125rem;
  line-height: 1.5;
  text-align: center;
}

.site-footer {
  background-color: var(--text-color);
  color: var(--background-color);
  text-align: center;
  padding: 20px 15px;
  font-size: 0.9rem;
}

.site-footer strong {
  color: var(--accent-color);
}

.section {
  background: var(--background-color);
  color: var(--text-color);
  padding: 80px 20px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.section-description {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 40px;
  color: hsl(0, 0%, 40%);
}

.gallery-masonry {
  column-count: 1;
  column-gap: 10px;
}

.gallery-masonry img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-masonry img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 10px hsl(0, 0%, 70%);
}

@media (min-width: 768px) {
  .gallery-masonry { column-count: 2; }
  .hero h1 { font-size: 2.5rem; }
}

/* Desktop */
@media (min-width: 1200px) {
  .gallery-masonry { column-count: 3; }
  .balustrady { padding: 200px 20px; }
  .balustrady h1 { font-size: 3rem; }
}

