/* Floating menu: trigger + full-screen overlay */

body.menu-open {
  overflow: hidden;
}

.menu-brand {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.3rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: 0 14px 40px rgba(7, 54, 70, 0.14);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.menu-brand:hover,
.menu-brand:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 55px rgba(7, 54, 70, 0.2);
}

.menu-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3rem;
  padding: 0 0.7rem 0 1.3rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(7, 54, 70, 0.14);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 55px rgba(7, 54, 70, 0.2);
}

.menu-toggle__label {
  font-size: 0.9rem;
  line-height: 1;
}

.menu-toggle__icon {
  display: grid;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  place-content: center;
  border-radius: 50%;
  background: var(--brand-gradient);
}

.menu-toggle__icon span {
  display: block;
  width: 16px;
  height: 1.6px;
  border-radius: 2px;
  background: #ffffff;
  transition: transform 0.35s ease;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  visibility: hidden;
  pointer-events: none;
}

.menu-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 50, 126, 0.45);
  cursor: pointer;
}

.menu-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 100vh;
  max-height: 100dvh;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem) clamp(1rem, 2.5vw, 1.5rem);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(227, 30, 36, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 55% at 0% 100%, rgba(8, 50, 126, 0.1), transparent 50%),
    linear-gradient(165deg, #ffffff 0%, #f8f9fc 55%, #f5f6fa 100%);
  color: var(--ink);
  clip-path: inset(0 0 100% 0);
  will-change: clip-path;
  overflow: hidden;
}

.menu-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
}

.menu-eyebrow {
  color: rgba(8, 50, 126, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.menu-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  align-items: stretch;
  gap: clamp(0.75rem, 1.5vw, 1.1rem);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.menu-nav-wrap {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu-nav-wrap::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.menu-nav-label {
  display: block;
  margin-bottom: 0.85rem;
  color: rgba(7, 54, 70, 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.menu-link {
  display: block;
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
}

.menu-link__text {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.8vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-transform: none;
  opacity: 0.55;
  transform-origin: left center;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.menu-link__text sup {
  font-size: 0.32em;
  vertical-align: super;
  opacity: 0.65;
}

.menu-link:hover .menu-link__text,
.menu-link:focus-visible .menu-link__text {
  opacity: 1;
  color: var(--brand-navy);
  transform: translateX(0.5rem);
}

.menu-link--accent .menu-link__text {
  color: var(--brand-navy);
  opacity: 0.9;
}

.menu-aside {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(1rem, 2vw, 1.25rem);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(7, 54, 70, 0.1);
  box-shadow: 0 18px 50px rgba(7, 54, 70, 0.08);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.menu-aside::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.menu-aside__bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 0;
  margin-top: 0.1rem;
}

.menu-aside__note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  text-transform: none;
  color: rgba(8, 10, 15, 0.58);
}

.menu-aside__dream {
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 2.5rem;
}

.menu-aside__dream img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: left bottom;
}

.menu-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.menu-user--guest {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.menu-user__avatar {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  flex-shrink: 0;
}

.menu-user__info {
  min-width: 0;
}

.menu-user__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-user__email {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.3;
  text-transform: none;
  color: rgba(8, 10, 15, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-user__role {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(227, 30, 36, 0.12);
  color: var(--brand-navy);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.menu-user__welcome {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: none;
  color: var(--ink);
}

.menu-user__hint {
  font-size: 0.82rem;
  line-height: 1.45;
  text-transform: none;
  color: rgba(8, 10, 15, 0.58);
}

.menu-aside__actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.menu-aside__actions--row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.menu-aside__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.menu-aside__actions--row .menu-aside__btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 0;
}

.menu-aside__btn--primary {
  background: var(--brand-gradient);
  color: #fff;
}

.menu-aside__btn--primary:hover {
  background: var(--brand-gradient-hover);
  transform: translateY(-1px);
}

.menu-aside__btn--ghost {
  border: 1px solid rgba(7, 54, 70, 0.18);
  background: #fff;
  color: var(--brand-navy);
}

.menu-aside__btn--ghost:hover {
  border-color: var(--brand-navy);
  transform: translateY(-1px);
}

.menu-aside__contact {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(7, 54, 70, 0.08);
  border-bottom: 1px solid rgba(7, 54, 70, 0.08);
}

.menu-aside__contact-label {
  margin-bottom: 0.15rem;
  color: rgba(7, 54, 70, 0.45);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.menu-aside__contact-link {
  color: var(--brand-navy);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: none;
}

.menu-aside__contact-link:hover {
  text-decoration: underline;
}

.menu-aside__contact-line {
  color: rgba(8, 10, 15, 0.58);
  font-size: 0.78rem;
  line-height: 1.4;
  text-transform: none;
}

.menu-aside__socials {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.menu-aside__socials a {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid rgba(7, 54, 70, 0.14);
  border-radius: 50%;
  color: var(--brand-navy);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.menu-aside__socials a:hover {
  background: var(--brand-gradient);
  border-color: var(--brand-navy);
  color: #fff;
  transform: translateY(-1px);
}

.menu-visual {
  margin-top: 0.25rem;
  height: clamp(6.5rem, 14vh, 8.5rem);
  flex-shrink: 0;
}

.menu-visual__frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 14px;
}

.menu-visual__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-visual__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(7, 54, 70, 0.55));
}

.menu-visual__word {
  position: absolute;
  right: 0.5rem;
  bottom: 0.45rem;
  z-index: 1;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  pointer-events: none;
  max-width: calc(100% - 1rem);
  text-align: right;
}

.menu-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
  margin-top: clamp(0.75rem, 2vw, 1.25rem);
  padding-top: 0.85rem;
  border-top: 1px solid rgba(7, 54, 70, 0.1);
}

.menu-note {
  margin: 0;
  color: rgba(8, 10, 15, 0.48);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: right;
  text-transform: none;
}

.menu-close {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.6rem;
  padding: 0 0.45rem 0 1.1rem;
  border-radius: 999px;
  background: var(--brand-gradient);
  color: #fff;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.menu-close:hover,
.menu-close:focus-visible {
  transform: translateY(-1px);
  background: var(--brand-gradient-hover);
}

.menu-close__icon {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 900px) {
  .menu-panel {
    height: 100%;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .menu-panel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .menu-inner {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    align-items: stretch;
    flex: none;
    gap: 1.15rem;
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .menu-nav-wrap {
    order: 1;
    flex: none;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .menu-aside {
    order: 2;
    flex: none;
    width: 100%;
    overflow: visible;
  }

  .menu-visual {
    display: block;
    height: clamp(5.5rem, 22vw, 7rem);
  }

  .menu-aside__bottom {
    flex: none;
  }

  .menu-aside__dream {
    flex: none;
    min-height: auto;
  }

  .menu-footer {
    flex: none;
    padding-bottom: 1.25rem;
  }
}

@media (max-width: 640px) {
  .menu-brand {
    top: 0.85rem;
    left: 0.85rem;
    max-width: calc(100% - 7.5rem);
    padding: 0 0.85rem;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-toggle {
    top: 0.85rem;
    right: 0.85rem;
  }

  .menu-panel {
    padding: 1rem 1rem 1.5rem;
  }

  .menu-panel__header {
    margin-bottom: 0.75rem;
  }

  .menu-inner {
    gap: 1rem;
  }

  .menu-aside {
    padding: 0.9rem;
    gap: 0.7rem;
  }

  .menu-link__text {
    font-size: clamp(1.35rem, 6.5vw, 1.85rem);
  }

  .menu-footer {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0.75rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .menu-note {
    text-align: left;
    font-size: 0.76rem;
    line-height: 1.45;
  }
}
