/* ===== Site navigation =====
   On the home page the bar is hidden over the hero and slides in once you
   scroll past it (.is-visible, added by scripts/nav.js). On every other page
   it is pinned from the start (.nav--pinned). */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2em;
  padding: 1.1em calc(var(--gap) * 4);
  background: rgba(246, 242, 228, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(18, 46, 51, 0.12);

  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.6s cubic-bezier(0.16, 0.84, 0.44, 1),
    opacity 0.4s ease,
    visibility 0s linear 0.6s;
}

.nav.is-visible,
.nav--pinned {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.6s cubic-bezier(0.16, 0.84, 0.44, 1),
    opacity 0.4s ease,
    visibility 0s;
}

.nav__brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}

/* Solid disc with a cream H, drawn in CSS rather than loaded as artwork.
   Negative margins let it grow past the bar's padding without making the
   bar taller. */
.nav__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin: -5px 0;
  border-radius: 50%;
  background: var(--brown-dark);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1;
  /* Nudged down: the cap sits high in the em box, so optical centring needs
     a shade more space above than below. */
  padding-top: 0.06em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.4em;
  list-style: none;
  margin: 0;
}

.nav__links a {
  position: relative;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brown-dark);
  text-decoration: none;
  padding-bottom: 0.3em;
}

/* Rule wipes in from the left on hover. */
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav__links a:hover::after,
.nav__links a:focus-visible::after { transform: scaleX(1); }

/* The booking link reads as the action.

   The cream wipe is a background layer rather than a ::before at negative
   z-index. Inside the nav's backdrop-filter stacking context that pseudo
   element painted behind the button's own background, so the fill never
   showed and the label just went teal-on-teal and disappeared. A background
   image always paints above background-color and below the text, so this
   cannot break the same way. */
.nav__links .nav__cta {
  /* Border is always present so the box never changes size; at rest it is
     the same teal as the fill and therefore invisible. */
  border: 1px solid var(--brown-dark);
  padding: calc(0.95em - 1px) calc(1.5em - 1px);
  color: var(--cream);
  background-color: var(--brown-dark);
  background-image: linear-gradient(var(--cream), var(--cream));
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 0% 100%;
  transition:
    color 0.5s cubic-bezier(0.65, 0, 0.35, 1),
    background-size 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav__links .nav__cta::after,
.nav__links .nav__cta::before { content: none; }

.nav__links .nav__cta:hover,
.nav__links .nav__cta:focus-visible {
  color: var(--brown-dark);
  background-size: 100% 100%;
}

/* ===== Mobile ===== */

.nav__toggle {
  display: none;
  width: 26px;
  height: 16px;
  position: relative;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.nav__toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--brown-dark);
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.25s ease;
}

.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 50%; }
.nav__toggle span:nth-child(3) { top: 100%; }

.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav { padding: 0.8em calc(var(--gap) * 3); }
  .nav__mark { width: 46px; height: 46px; margin: -4px 0; font-size: 1.4rem; }

  .nav__toggle { display: block; }

  /* Absolute, not fixed: the bar's backdrop-filter and transform make it the
     containing block for fixed children, so `inset: 0` would size the panel
     to the bar itself. Hanging it off the bar's bottom edge and filling the
     rest of the viewport avoids that entirely. */
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 100%);
    height: calc(100svh - 100%);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.6em;
    padding: 0 calc(var(--gap) * 5);
    background: var(--cream);
    border-top: 1px solid rgba(18, 46, 51, 0.12);
    /* Kept in the DOM so the transition can run; pulled out of reach when shut. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1.5em);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 0.84, 0.44, 1), visibility 0s linear 0.45s;
  }

  .nav.is-open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 0.84, 0.44, 1), visibility 0s;
  }

  .nav__links a { font-size: 1rem; letter-spacing: 0.16em; }
  .nav__links .nav__cta { margin-top: 0.6em; }

  /* Keep the brand and toggle above the open panel. */
  .nav__brand,
  .nav__toggle { position: relative; z-index: 2; }
}

/* Anchors land below the fixed bar rather than under it. */
[id] { scroll-margin-top: 90px; }
