.hero-topbar,
.hero-menu-button,
.mobile-menu-backdrop,
.mobile-menu-sheet {
  display: none;
}

.hero-topbar__dropdown > summary,
.mobile-menu-group > summary {
  list-style: none;
}

.hero-topbar__dropdown > summary::-webkit-details-marker,
.mobile-menu-group > summary::-webkit-details-marker {
  display: none;
}

@media (min-width: 900px) {
  .hero-logo {
    display: none;
  }

  .hero-topbar {
    position: absolute;
    top: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1180px, calc(100% - 160px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    z-index: 12;
  }

  .hero-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: 18px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -0.18px;
  }

  .hero-topbar__brand img {
    width: 40px;
    height: 38px;
    flex: 0 0 auto;
  }

  .hero-topbar__nav {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(42px, 4.2vw, 64px);
    flex-wrap: wrap;
  }

  .hero-topbar__link,
  .hero-topbar__summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -0.16px;
    cursor: pointer;
    white-space: nowrap;
  }

  .hero-topbar__link:hover,
  .hero-topbar__summary:hover {
    color: #eae8f4;
  }

  .hero-topbar__dropdown {
    position: relative;
  }

  .hero-topbar__caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 0.18s ease;
    flex: 0 0 auto;
  }

  .hero-topbar__dropdown[open] .hero-topbar__caret {
    transform: rotate(225deg) translateY(-1px);
  }

  .hero-topbar__summary--lang {
    min-width: 38px;
    justify-content: center;
  }

  .hero-topbar__locale-flag {
    font-size: 20px;
    line-height: 1;
  }

  .hero-topbar__panel {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    min-width: 232px;
    padding: 12px 0;
    border: 1px solid #e2dff7;
    background: #ffffff;
    box-shadow: 0 26px 60px rgba(141, 155, 170, 0.16);
    display: grid;
    gap: 0;
  }

  .hero-topbar__panel a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 18px;
    color: #4b4476;
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 22px;
    font-weight: 600;
  }

  .hero-topbar__panel a:hover {
    background: #f7f6ff;
    color: #7460e1;
  }

  .hero-topbar__panel--lang {
    min-width: 248px;
  }

  .hero-topbar__panel--lang a {
    justify-content: space-between;
    gap: 12px;
  }

  .hero-topbar__panel-flag {
    font-size: 18px;
    line-height: 1;
    margin-right: 10px;
  }

  .hero-topbar__panel-text {
    flex: 1 1 auto;
  }

  .hero-topbar__panel-tag {
    color: #8c88aa;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

@media (max-width: 899px) {
  .hero-logo {
    top: 24px !important;
    left: 20px !important;
    width: 72px !important;
    height: 72px !important;
    transform: none !important;
    z-index: 4;
  }

  .hero-menu-button {
    position: absolute;
    top: 30px;
    right: 20px;
    min-width: 112px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #e2dff7;
    background: #ffffff;
    box-shadow: 0 26px 60px rgba(141, 155, 170, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    z-index: 24;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 24px;
    font-weight: 700;
    color: #7460e1;
  }

  .hero-menu-button__icon {
    position: relative;
    width: 16px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .hero-menu-button__icon::before,
  .hero-menu-button__icon::after,
  .hero-menu-button__icon span {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    background: #7460e1;
    border-radius: 999px;
    transition: transform 0.18s ease, opacity 0.18s ease, top 0.18s ease;
  }

  .hero-menu-button__icon::before {
    top: 0;
  }

  .hero-menu-button__icon span {
    top: 5px;
  }

  .hero-menu-button__icon::after {
    top: 10px;
  }

  .hero-menu-button.is-open .hero-menu-button__icon::before {
    top: 5px;
    transform: rotate(45deg);
  }

  .hero-menu-button.is-open .hero-menu-button__icon span {
    opacity: 0;
  }

  .hero-menu-button.is-open .hero-menu-button__icon::after {
    top: 5px;
    transform: rotate(-45deg);
  }

  .mobile-menu-backdrop,
  .mobile-menu-sheet {
    display: block;
  }

  .mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 11, 31, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 20;
  }

  .mobile-menu-sheet {
    position: absolute;
    top: 94px;
    left: 20px;
    right: 20px;
    background: #ffffff;
    border: 1px solid #e2dff7;
    box-shadow: 0 26px 60px rgba(141, 155, 170, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 21;
  }

  .mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 14px 20px;
    border-top: 1px solid #ece8fb;
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 24px;
    font-weight: 700;
    color: #7460e1;
    background: #ffffff;
  }

  .mobile-menu-link:first-child,
  .mobile-menu-group:first-child > .mobile-menu-link {
    border-top: 0;
  }

  .mobile-menu-link:hover,
  .mobile-menu-link:focus-visible,
  .mobile-menu-group[open] > .mobile-menu-link {
    background: #f7f6ff;
    outline: none;
  }

  .mobile-menu-link--primary {
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .mobile-menu-link--summary {
    cursor: pointer;
    list-style: none;
  }

  .mobile-menu-group[open] > .mobile-menu-link--summary {
    border-bottom: 1px solid #ece8fb;
  }

  .mobile-menu-caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid #7460e1;
    border-bottom: 2px solid #7460e1;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
    flex: 0 0 auto;
  }

  .mobile-menu-group[open] .mobile-menu-caret {
    transform: rotate(225deg);
  }

  .mobile-menu-submenu {
    display: grid;
  }

  .mobile-menu-link--nested {
    min-height: 48px;
    padding-left: 32px;
    font-weight: 600;
    color: #4b4476;
  }

  .mobile-menu-language-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4b4476;
    font-size: 13px;
    font-weight: 600;
  }

  .mobile-menu-language-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 18px 18px;
    border-top: 1px solid #ece8fb;
    background: #fbfaff;
  }

  .mobile-menu-language-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #e2dff7;
    background: #ffffff;
    box-shadow: 0 26px 60px rgba(141, 155, 170, 0.08);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 20px;
    font-weight: 700;
    color: #7460e1;
    text-align: center;
  }

  .mobile-menu-language-option.is-active {
    border-color: #7460e1;
    color: #4f3fc4;
  }

  .mobile-menu-language-flag {
    font-size: 16px;
    line-height: 1;
  }

  .mobile-menu-divider {
    height: 1px;
    background: #ece8fb;
  }

  .home-artboard.is-menu-open,
  .home-artboard.is-menu-open .home-intro,
  .home-artboard.is-menu-open .hero-stage {
    overflow: visible;
  }

  .home-artboard.is-menu-open .mobile-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .home-artboard.is-menu-open .mobile-menu-sheet {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  .hero-menu-button {
    right: 28px;
  }

  .mobile-menu-sheet {
    left: 50%;
    right: auto;
    width: min(680px, calc(100vw - 56px));
    transform: translateX(-50%) translateY(-10px);
  }

  .mobile-menu-language-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-artboard.is-menu-open .mobile-menu-sheet {
    transform: translateX(-50%) translateY(0);
  }
}
