.menu {
  --menu-ease: cubic-bezier(0.43, 0.195, 0.02, 1);
  --label-ease: cubic-bezier(0.5, 0, 0, 1);
}

.menu-labels {
  display: grid;
  overflow: hidden;
  text-align: end;
}
.menu .menu-labels span {
  display: block;
  grid-area: 1 / 1;
  transition: transform 1s var(--label-ease);
}
.menu .close-label {
  transform: translateY(-115%) skewY(3deg);
}
.menu[open] .open-label {
  transform: translateY(115%) skewY(3deg);
}
.menu[open] .close-label {
  transform: none;
}
.menu summary i {
  --bar-gap: 4px;
  position: relative;
  width: 16px;
  height: 16px;
  border: 0;
  transition: transform 1s var(--menu-ease);
}
.menu summary i::before,
.menu summary i::after,
.menu summary i b {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s ease-in-out;
}
.menu summary i::before {
  transform: translateY(calc(-50% - var(--bar-gap)));
}
.menu summary i b {
  transform: translateY(-50%);
}
.menu summary i::after {
  transform: translateY(calc(-50% + var(--bar-gap)));
}
.menu[open] summary i {
  transform: rotate(270deg);
}
.menu[open] summary i::before {
  transform: translateY(-50%) rotate(-45deg);
}
.menu[open] summary i b {
  transform: translateY(-50%) scaleX(0);
}
.menu[open] summary i::after {
  transform: translateY(-50%) rotate(45deg);
}

@media (hover: hover) and (pointer: fine) {
  .menu:not([open]) summary:hover i b {
    transform: translateY(-50%) scaleX(0.5);
  }
}

/* Let the curtain finish its exit after native details removes the open attribute. */
.menu::details-content {
  content-visibility: visible;
}
.menu-panel {
  --cut-closed: polygon(
    evenodd,
    0 0,
    100% 0,
    100% 100%,
    0 100%,
    0 0,
    0 0,
    0 100%,
    100% 100%,
    100% 0,
    0 0
  );
  --cut-open: polygon(
    evenodd,
    0 0,
    100% 0,
    100% 100%,
    0 100%,
    0 0,
    50% 50%,
    50% 50%,
    50% 50%,
    50% 50%,
    50% 50%
  );
  display: block;
  top: 28px;
  z-index: 1;
  isolation: isolate;
  overflow: hidden;
  background: #350709;
  clip-path: var(--cut-closed);
  visibility: hidden;
  transition:
    clip-path 0.8s var(--menu-ease),
    visibility 0s 0.8s;
}
.menu-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #240305;
  mask: url("/brand/simbolo.svg") center / max(120vw, 120vh) auto no-repeat;
}
.menu[open] .menu-panel {
  clip-path: var(--cut-open);
  visibility: visible;
  transition-delay: 0s;
}
.carros .nav-bar .tabs,
.carros .signature {
  position: relative;
  z-index: 2;
}
.menu:not([open]) .menu-panel,
.menu:not([open]) .menu-panel a {
  pointer-events: none;
}
.menu-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
  padding: clamp(75px, 10svh, 110px) var(--gutter)
    max(30px, env(safe-area-inset-bottom));
}
.menu-body .eyebrow {
  margin: auto 0 clamp(10px, 2.8vh, 24px);
}
.menu-body nav {
  align-items: center;
  max-width: 100%;
  margin-bottom: clamp(12px, 3vh, 30px);
}
.menu-body nav a {
  display: block;
  min-height: 44px;
  max-width: 100%;
  color: var(--ivory);
  text-transform: uppercase;
  font-size: clamp(44px, min(6.2vw, 10.7svh), 116px);
  line-height: 1.04;
  transition: opacity 0.3s;
}
.menu-word {
  position: relative;
  display: block;
  overflow: hidden;
}
.menu-word span,
.menu-word::after {
  display: block;
  transition: transform 0.48s var(--label-ease);
}
.menu-word::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  transform: translateY(105%);
}
@media (hover: hover) and (pointer: fine) {
  .menu-body nav:has(a:hover) a:not(:hover) {
    opacity: 0.25;
  }
  .menu-body nav a:hover .menu-word span {
    transform: translateY(-105%);
  }
  .menu-body nav a:hover .menu-word::after {
    transform: translateY(0);
  }
}
.menu-body nav:has(a:focus-visible) a:not(:focus-visible) {
  opacity: 0.35;
}
.menu-body .buy {
  flex: none;
  margin-bottom: auto;
}
.menu-body > * {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.18s,
    transform 0.25s var(--menu-ease);
}
.menu[open] .menu-body > * {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.4s 0.26s,
    transform 0.55s 0.26s var(--menu-ease);
}
@media (max-width: 760px) {
  .menu summary i {
    --bar-gap: 6px;
    width: 24px;
    height: 24px;
  }
  .menu-labels {
    display: none;
  }
  .menu-body {
    padding-left: 12px;
    padding-right: 12px;
  }
  .menu-body nav a {
    font-size: clamp(32px, 9vw, 65px);
    line-height: 1.28;
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu,
  .menu *,
  .menu *::before,
  .menu *::after {
    transition: none !important;
  }
}
