.nav-mobile-actions,
.nav-menu-toggle,
.mobile-menu:not([open]) {
  display: none;
}

html.mobile-menu-open,
html.mobile-menu-open body {
  overflow: hidden;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--sand);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}

.mobile-menu::backdrop {
  background: var(--sand);
  backdrop-filter: none;
}

.mobile-menu-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 16px 6%;
  border-bottom: 1px solid var(--line);
}

.mobile-menu-brand {
  display: block;
  width: 135px;
  flex: 0 0 135px;
}

.mobile-menu-actions,
.nav-mobile-actions {
  align-items: center;
  gap: 20px;
  flex: 0 0 auto;
}

.mobile-menu-actions {
  display: flex;
}

.nav-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 44px;
  padding: 12px 16px;
  background: var(--wine);
  color: var(--sand);
  font: 400 14px/1.3 Inter, Arial, sans-serif;
  white-space: nowrap;
  text-decoration: none;
}

.nav-menu-toggle,
.mobile-menu-close {
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 88px;
  min-height: 44px;
  padding: 8px 0 8px 8px;
  border: 0;
  background: transparent;
  font: 400 14px/1 Inter, Arial, sans-serif;
  color: var(--ink);
}

.mobile-menu-close {
  display: flex;
}

.nav-menu-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 18px;
  flex: 0 0 24px;
}

.nav-menu-icon::before,
.nav-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 1px;
  background: currentColor;
  top: 5px;
}

.nav-menu-icon::after {
  top: 12px;
}

.mobile-menu-close .nav-menu-icon::before,
.mobile-menu-close .nav-menu-icon::after {
  top: 8px;
  transform: rotate(45deg);
}

.mobile-menu-close .nav-menu-icon::after {
  transform: rotate(-45deg);
}

.mobile-menu-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 6% max(26px, env(safe-area-inset-bottom));
}

.mobile-menu-eyebrow {
  margin: 0 0 18px;
  font: 400 10px/1.5 Cutive, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wine);
}

.mobile-menu-links {
  border-top: 1px solid var(--line);
}

.mobile-menu-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font: 400 clamp(30px, 5.8vw, 40px)/1.1 Ancizar, Georgia, serif;
  letter-spacing: -.025em;
  text-decoration: none;
}

.mobile-menu-links a > span:last-child {
  font: 400 17px/1 Inter, Arial, sans-serif;
  color: var(--wine);
}

.mobile-menu-links a[aria-current="page"],
.mobile-menu-links a:hover {
  color: var(--wine);
}

.mobile-menu-links a[aria-current="page"] > span:first-child {
  font-style: italic;
}

.mobile-menu-footer {
  margin-top: auto;
  padding-top: 36px;
}

.mobile-menu-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 60px;
  padding: 18px 22px;
  background: var(--wine);
  color: var(--sand);
  font: 400 17px/1.4 Inter, Arial, sans-serif;
  text-decoration: none;
}

.mobile-menu-footer p {
  margin: 20px 0 0;
  font: 400 10px/1.5 Cutive, monospace;
  letter-spacing: .05em;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .nav[data-menu-ready] {
    flex-wrap: nowrap;
    min-height: 82px;
    padding: 16px 6%;
    gap: 24px;
  }

  .nav[data-menu-ready] .brand {
    width: 135px;
    flex: 0 0 135px;
  }

  .nav[data-menu-ready] > nav {
    display: none;
  }

  .nav[data-menu-ready] .nav-mobile-actions,
  .nav[data-menu-ready] .nav-menu-toggle {
    display: flex;
  }
}

@media (max-width: 540px) {
  .nav[data-menu-ready],
  .mobile-menu-header {
    gap: 12px;
  }

  .nav[data-menu-ready] .brand,
  .mobile-menu-brand {
    width: 110px;
    flex-basis: 110px;
  }

  .nav-mobile-actions,
  .mobile-menu-actions {
    gap: 8px;
  }

  .nav-mobile-cta {
    padding: 12px;
    font-size: 13px;
  }

  .nav-mobile-cta > span,
  .nav-menu-label {
    display: none;
  }

  .nav-menu-toggle,
  .mobile-menu-close {
    min-width: 44px;
    width: 44px;
    padding: 10px;
    gap: 0;
  }
}

@media (max-width: 360px) {
  .nav[data-menu-ready],
  .mobile-menu-header {
    gap: 8px;
  }

  .nav[data-menu-ready] .brand,
  .mobile-menu-brand {
    width: 96px;
    flex-basis: 96px;
  }
}

/* Use the same outer rails as the homepage, Register and public files. */
@media (min-width: 1201px) {
  body > .nav { padding: 14px var(--layout-edge); min-height: 80px; }
  body > .nav .brand { width: 145px; flex-basis: 145px; }
  body > .nav nav { gap: clamp(18px, 1.35vw, 28px); }
  body > .nav nav > a { font-size: 16px; }
  body > .nav .nav-cta { min-height: 48px; padding: 14px 20px; gap: 28px; margin-left: 0; }
  body > .nav .my-files::before { content: none; }
  body > .nav .my-files { color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: clamp(18px, 1.35vw, 28px); }
  body:has(.activation-home) > .nav, body:has(.rg-page) > .nav, body:has(.st-page) > .nav { position: sticky; top: 0; z-index: 30; }
  .mobile-menu { inset: 0 0 0 auto; width: min(580px, 100%); margin: 0 0 0 auto; border-left: 1px solid var(--line); }
  .mobile-menu::backdrop { background: #07090666; }
  .mobile-menu-header { padding: 20px 36px; }
  .mobile-menu-header .nav-mobile-cta { display: none; }
  .mobile-menu-body { padding: 32px 36px; }
  .mobile-menu-links a { font-size: 32px; min-height: 64px; }
}
@media (min-width: 901px) {
  .site-footer { padding: 56px var(--layout-edge); gap: 5%; }
  .site-footer img { width: 160px; }
  .site-footer a { font-size: 16px; }
  .site-footer p { font-size: 15px; line-height: 1.65; }
  .site-footer .footer-links { gap: 16px 28px; }
}

@media (prefers-reduced-motion: no-preference) {
  .mobile-menu[open] .mobile-menu-body {
    animation: mobile-menu-arrive 220ms ease-out;
  }

  @keyframes mobile-menu-arrive {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
