/* ==========================================================================
   Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid transparent;
  transition: background-color var(--duration), border-color var(--duration);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--max-width);
  margin-inline: auto;
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav__logo:hover { opacity: 1; }

.nav__logo-text {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-light);
  transition: color var(--duration);
}

.nav__logo-suffix {
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

/* Scrolled */
.nav--scrolled {
  background-color: rgba(250, 249, 247, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.nav--scrolled .nav__logo-text {
  color: var(--text-primary);
}

.nav--scrolled .nav__link {
  color: var(--text-primary);
}

/* Nav Menu */
.nav__menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav__link {
  font-size: var(--text-xxs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color var(--duration), opacity var(--duration);
}

.nav__link:hover {
  opacity: 0.7;
}

.nav__link--active {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* Mobile Toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 28px;
  padding: 4px 0;
  z-index: 101;
}

.nav__toggle-bar {
  width: 100%;
  height: 1px;
  background-color: var(--text-light);
  transition: all var(--duration);
}

.nav--scrolled .nav__toggle-bar {
  background-color: var(--text-primary);
}

.nav__toggle--active .nav__toggle-bar:nth-child(1) {
  transform: rotate(30deg) translate(4px, 4px);
}
.nav__toggle--active .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav__toggle--active .nav__toggle-bar:nth-child(3) {
  transform: rotate(-30deg) translate(4px, -4px);
}

@media (max-width: 767px) {
  .nav__toggle { display: flex; }

  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background-color: var(--off-white);
    transition: right var(--duration-slow) var(--ease);
    z-index: 100;
  }

  .nav__menu--open { right: 0; }

  .nav__menu--open .nav__link {
    color: var(--text-primary);
    font-size: var(--text-sm);
  }

  .nav__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration);
  }

  .nav__overlay--visible {
    opacity: 1;
    visibility: visible;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 2rem;
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid;
  transition: all var(--duration);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { opacity: 1; }

.btn--navy {
  background: var(--navy);
  color: var(--text-light);
  border-color: var(--navy);
}

.btn--navy:hover {
  background: transparent;
  color: var(--navy);
}

.btn--outline {
  background: transparent;
  color: var(--text-light);
  border-color: var(--text-light);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn--outline-dark {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn--outline-dark:hover {
  background: var(--navy);
  color: var(--text-light);
}

.btn--accent {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
}

.btn--accent:hover {
  background: var(--coral-hover);
  border-color: var(--coral-hover);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-group--center {
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  position: relative;
  z-index: 1;
  background-color: rgba(10, 36, 99, 0.9);
  color: var(--text-light);
  padding-block: 4rem 2rem;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer__logo {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  margin-bottom: 1.25rem;
}

.footer__logo-suffix {
  font-weight: 300;
  opacity: 0.5;
}

.footer__text {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
  max-width: 320px;
}

.footer__heading {
  font-family: var(--font-sans);
  font-size: var(--text-xxs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1.25rem;
}

.footer__link {
  display: block;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
  transition: opacity var(--duration);
}

.footer__link:hover {
  opacity: 1;
  color: var(--text-light);
}

.footer__bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  font-size: var(--text-xxs);
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Back to Top
   -------------------------------------------------------------------------- */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration);
  z-index: 90;
  text-decoration: none;
  color: var(--navy);
}

.back-to-top:hover {
  opacity: 1;
  background: var(--navy);
  color: var(--text-light);
  border-color: var(--navy);
}

.back-to-top--visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
