:root {
  --nav-pad: var(--pad, clamp(1.25rem, 4vw, 4rem));
  --nav-shell: var(--shell, 1280px);
  --nav-inset: max(1.25rem, 5.3vw);
  --candle-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 32'%3E%3Cpath fill-rule='evenodd' d='M8 .8C8.4 2.6 9.4 3.9 10.3 5.4C11 6.6 11.4 7.8 11.4 9.1C11.4 11.2 9.9 12.9 8 12.9C6.1 12.9 4.6 11.2 4.6 9.1C4.6 7.2 5.6 5.7 6.7 4.2C7.4 3.2 7.9 2.1 8 .8ZM8 8.4C8.6 9.2 9 9.9 9 10.6C9 11.3 8.6 11.8 8 11.8C7.4 11.8 7 11.3 7 10.6C7 9.9 7.4 9.2 8 8.4Z' fill='%23000'/%3E%3Crect x='7.5' y='12.6' width='1' height='3.4' rx='.5' fill='%23000' fill-opacity='.85'/%3E%3Cpath d='M4.4 17C4.4 16.4 4.9 16 5.5 16H10.5C11.1 16 11.6 16.4 11.6 17V30.2C11.6 30.7 11.2 31 10.7 31H5.3C4.8 31 4.4 30.7 4.4 30.2Z' fill='%23000' fill-opacity='.5'/%3E%3Cpath d='M4.4 17C4.4 16.4 4.9 16 5.5 16H10.5C11.1 16 11.6 16.4 11.6 17V18C11.6 18.5 11.2 18.8 10.7 18.8C10.2 18.8 9.9 19.1 9.9 19.6V22.4C9.9 23 9.5 23.4 9 23.4C8.5 23.4 8.1 23 8.1 22.4V19.7C8.1 19.2 7.7 18.8 7.2 18.8H5.3C4.8 18.8 4.4 18.5 4.4 18Z' fill='%23000' fill-opacity='.85'/%3E%3C/svg%3E");
}

html,
body,
.nav-mobile-panel {
  scrollbar-width: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.nav-mobile-panel::-webkit-scrollbar {
  display: none;
}

[tabindex="-1"]:focus {
  outline: none;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding-inline: var(--nav-inset);
  background: oklch(11.95% 0.004 165 / 0.96);
  backdrop-filter: blur(16px) saturate(1.08);
  border-bottom: 1px solid oklch(100% 0 0 / 0.12);
}

.nav-logo {
  font-family: var(--sans);
  font-size: 1.3125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--pale);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--white); }

.nav-links {
  display: flex;
  flex-shrink: 0;
  align-self: stretch;
  align-items: stretch;
  gap: 2.75rem;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.25;
  white-space: nowrap;
  text-align: center;
  color: oklch(87.97% 0.012 86.8);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }

.nav-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-group-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.035em;
  white-space: nowrap;
  color: oklch(87.97% 0.012 86.8);
  cursor: pointer;
  transition: color 0.2s;
}
.nav-group-label:hover,
.nav-group:not(.is-shut):hover .nav-group-label,
.nav-group-label[aria-expanded="true"] { color: var(--white); }

.nav-group-label svg {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.35rem);
  margin-top: -4px;
  width: 8px;
  height: 8px;
  opacity: 0.45;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-group:not(.is-shut):hover .nav-group-label svg,
.nav-group-label[aria-expanded="true"] svg {
  transform: rotate(180deg);
  opacity: 0.9;
}

.nav-group.is-current > .nav-group-label { color: var(--white); }

.nav-submenu {
  position: absolute;
  top: calc(50% + 1.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 220px;
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background: oklch(21.95% 0.004 165 / 0.97);
  border: 1px solid oklch(100% 0 0 / 0.1);
  border-radius: 4px;
  box-shadow: 0 14px 34px oklch(3.95% 0.004 165 / 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.nav-group:not(.is-shut):hover .nav-submenu,
.nav-group.open .nav-submenu,
.nav-group:not(.is-shut):focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-submenu a {
  display: block;
  min-height: 0;
  padding: 0.55rem 1.25rem;
  text-align: left;
}
.nav-submenu a:hover {
  background: oklch(100% 0 0 / 0.07);
  color: var(--white);
}
.nav-submenu a[aria-current="page"] {
  color: var(--white);
  background: oklch(100% 0 0 / 0.06);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-candle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 -0.5rem 0 2.25rem;
  padding: 0.55rem 0.5rem;
  background: none;
  border: 0;
  border-radius: 3px;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  color: var(--gold);
  transition: color 0.25s;
}

.nav-candle::before,
.nav-mobile-candle::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 1.25rem;
  background: currentColor;
  -webkit-mask: var(--candle-mark) center / contain no-repeat;
  mask: var(--candle-mark) center / contain no-repeat;
  filter: drop-shadow(0 0 6px oklch(74% 0.08 78 / 0.38));
}

.nav-candle::after {
  content: "";
  position: absolute;
  inset: -5px -1.35rem;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(
    ellipse closest-side at 50% 50%,
    oklch(90% 0.1 78 / 0.26) 0%,
    oklch(88% 0.09 78 / 0.14) 48%,
    oklch(88% 0.09 78 / 0) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.nav-candle:hover,
.nav-links > li > a:focus-visible,
.nav-group-label:focus-visible {
  outline: none;
}
.nav-links > li > a:focus-visible::after,
.nav-group-label:focus-visible::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -0.5rem;
  right: -0.5rem;
  height: 2.25rem;
  margin-top: -1.125rem;
  border-radius: 3px;
  outline: 2px solid var(--accent);
  pointer-events: none;
}
.nav-group-label:focus-visible::after {
  right: -1.35rem;
}
.nav-links > li > a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

@media (min-width: 769px) {
  .nav-candle::before {
    position: absolute;
    top: 50%;
    right: calc(100% + 0.45rem);
    margin-top: -0.625rem;
  }
  .nav-candle:focus-visible {
    outline-offset: 0;
  }
}

.nav-candle:focus-visible {
  color: oklch(95% 0.08 82);
}
.nav-candle:hover::after,
.nav-candle:focus-visible::after {
  opacity: 1;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid oklch(100% 0 0 / 0.14);
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.04);
  color: var(--white);
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

.nav-mobile-panel { display: none; }

html.nav-open { overflow: hidden; }

@media (max-width: 860px) {
  :root { --nav-inset: max(1.25rem, 5.75vw); }
  .site-nav { padding-inline: var(--nav-inset); gap: 0.75rem; }
  .nav-logo {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 100%;
    line-height: 1;
  }
  .nav-links { display: none; }
  .nav-candle { display: inline-flex; padding-block: 0.85rem; }
  .nav-toggle { display: inline-flex; }

  .nav-mobile-panel {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem var(--nav-inset) 1.25rem;
    background: oklch(14.95% 0.004 165 / 0.98);
    border-bottom: 1px solid oklch(100% 0 0 / 0.08);
    backdrop-filter: blur(12px);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .nav-mobile-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-mobile-links {
    list-style: none;
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0;
  }
  .nav-mobile-group {
    margin-top: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .nav-mobile-links li:first-child .nav-mobile-group { margin-top: 0; }
  .nav-mobile-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    color: var(--white);
    background: oklch(100% 0 0 / 0.05);
    border: 1px solid oklch(100% 0 0 / 0.08);
  }
  .nav-mobile-links a[aria-current="page"] {
    color: var(--white);
    border-color: oklch(97% 0.01 86.8 / 0.45);
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .nav-mobile-candle {
    order: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1.25rem;
    padding: 0.95rem 1rem;
    border: 0;
    border-radius: 4px;
    background: linear-gradient(
      180deg,
      oklch(88% 0.08 78 / 0.14),
      oklch(88% 0.08 78 / 0.05)
    );
    box-shadow: inset 0 0 0 1px oklch(88% 0.08 78 / 0.3);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    color: var(--gold);
  }
}

@media (max-width: 768px) {
  .nav-candle {
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 0;
    padding: 0;
    gap: 0;
    font-size: 0;
    letter-spacing: 0;
  }
  .nav-candle::after { inset: -0.2rem; }
}

@media (max-width: 560px) {
  .nav-logo { font-size: 1.0625rem; letter-spacing: 0.05em; }
}

@media (max-width: 1199px) {
  .nav-here-tag { display: none; }
}
