/* UFC-style floating nav — compact at top, expands on scroll, grows on hover */
:root {
  --nav-float-gap: 14px;
  --nav-h-compact: 52px;
  --nav-h-expanded: 62px;
  --nav-h: var(--nav-h-compact);
  --nav-float-max-compact: 1160px;
  --nav-float-max: var(--nav-float-max-compact);
  --nav-side-pad: clamp(16px, 3.5vw, 52px);
  --nav-red: #d20a0a;
  --nav-ink: #0a0a0a;
  --nav-offset: calc(var(--nav-float-gap) + var(--nav-h-compact) + env(safe-area-inset-top, 0px));
  --nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding-top: calc(var(--nav-float-gap) + env(safe-area-inset-top, 0px));
  padding-left: var(--nav-side-pad);
  padding-right: var(--nav-side-pad);
  background: transparent;
  pointer-events: none;
  transition:
    padding 0.45s var(--nav-ease),
    padding-top 0.45s var(--nav-ease);
}

.nav.nav-expanded {
  --nav-h: var(--nav-h-expanded);
  --nav-float-max: 100%;
  --nav-float-gap: 0px;
  padding-left: 0;
  padding-right: 0;
  padding-top: env(safe-area-inset-top, 0px);
}

.nav-float {
  max-width: var(--nav-float-max);
  margin: 0 auto;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.14);
  pointer-events: auto;
  contain: layout style;
  transform-origin: center top;
  transition:
    max-width 0.45s var(--nav-ease),
    box-shadow 0.35s ease,
    transform 0.38s var(--nav-ease);
}

.nav.scrolled .nav-float {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.08),
    0 12px 36px rgba(0, 0, 0, 0.18);
}

.nav.nav-at-top .nav-float:hover {
  transform: scale(1.018);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 14px 40px rgba(0, 0, 0, 0.16);
}

.nav.nav-at-top .nav-float:hover .nav-inner {
  height: 56px;
}

.nav.nav-expanded .nav-float {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.06),
    0 10px 32px rgba(0, 0, 0, 0.12);
}

.nav-inner {
  height: var(--nav-h);
  padding: 0 clamp(12px, 2vw, 28px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  transition: height 0.38s var(--nav-ease);
}

.nav.nav-expanded .nav-links a {
  font-size: 13px;
  padding: 0 16px;
}

.nav.nav-expanded .nav-brand-text {
  font-size: clamp(19px, 2vw, 26px);
}

.nav-col-left,
.nav-col-right {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.nav-col-left {
  justify-content: flex-start;
}

.nav-col-right {
  justify-content: flex-end;
  gap: 4px;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 14px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--nav-ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.22s ease, font-size 0.38s var(--nav-ease), padding 0.38s var(--nav-ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 0;
  height: 2px;
  background: var(--nav-red);
  transform: translateX(-50%);
  transition: width 0.28s var(--nav-ease);
}

.nav.nav-expanded .nav-links a::after {
  bottom: 10px;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--nav-red);
  outline: none;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.is-active::after {
  width: calc(100% - 16px);
  max-width: 36px;
}

.nav-links a.is-active {
  color: var(--nav-red);
}

.nav-brand {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
  padding: 2px 8px 0;
  transition: color 0.2s ease;
}

.nav-brand-logo {
  height: 44px;
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.nav-brand-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(17px, 1.85vw, 24px);
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--nav-ink);
  transition: color 0.2s ease, font-size 0.38s var(--nav-ease);
}

.nav-brand-text::after {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 4px;
  background: var(--nav-red);
}

.nav-brand:hover .nav-brand-text,
.nav-brand.is-active .nav-brand-text {
  color: var(--nav-red);
}

.nav-twitter {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 32px;
  height: 32px;
  margin-left: 2px;
  color: var(--nav-ink);
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-twitter:hover {
  color: var(--nav-red);
  transform: translateY(-1px);
}

.nav-twitter.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.nav-twitter svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  align-self: center;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--nav-ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav.nav-mobile-open .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav.nav-mobile-open .nav-hamburger span:nth-child(2) {
  opacity: 0;
}

.nav.nav-mobile-open .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile-panel {
  display: none;
  flex-direction: column;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-mobile-panel a {
  padding: 14px 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--nav-ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.nav-mobile-panel a:hover,
.nav-mobile-panel a:focus-visible {
  color: var(--nav-red);
  padding-left: 24px;
  outline: none;
}

.nav-mobile-panel a.is-active {
  color: var(--nav-red);
}

.nav.nav-mobile-open .nav-mobile-panel {
  display: flex;
}

/* Smooth page transition (Liberty250 navigation) */
html.page-transitioning,
html.page-preenter {
  background: #0a0a0a;
}

body.page-leaving {
  opacity: 0;
  transition: opacity 0.45s ease;
}

body.page-preenter {
  opacity: 0;
}

body.page-enter {
  opacity: 1;
  transition: opacity 0.55s ease;
}

@media (max-width: 960px) {
  :root {
    --nav-float-gap: 10px;
  }

  .nav-col-left {
    display: none;
  }

  .nav-col-right .nav-links,
  .nav-col-right .nav-twitter {
    display: none;
  }

  .nav-inner {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .nav-brand {
    justify-self: start;
  }

  .nav-col-right {
    justify-content: flex-end;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav.nav-at-top .nav-float:hover {
    transform: none;
  }
}

@media (max-width: 420px) {
  .nav-brand-logo {
    height: 30px;
  }

  .nav-brand-text {
    font-size: 14px;
    letter-spacing: 0.3px;
  }

  .nav-inner {
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav-float,
  .nav-inner,
  .nav-links a,
  .nav-brand,
  body.page-leaving,
  body.page-enter {
    transition: none !important;
  }

  .nav.nav-at-top .nav-float:hover {
    transform: none;
  }
}
