/* navbar.css — floating glass "pill" menu: inline SVG logo, links with a yellow underline on the active one, theme switch, Resume button, mobile dropdown */

/* .nav is an invisible full-width strip; clicks pass through it except on the menu itself */
.nav {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}

/* .nav__inner is a normal .container (same width and edges as the hero),
   so the logo starts exactly where "Hello, I'm" starts and Resume ends where the photo area ends */
.nav__inner {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 8px;
  pointer-events: auto;
}

/* The pill shape is drawn BEHIND the container and reaches --nav-pad outside it on both sides */
.nav__inner::before {
  content: '';
  position: absolute;
  inset: 0 calc(-1 * var(--nav-pad));
  z-index: -1;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.nav--scrolled .nav__inner::before,
.nav:has(.nav__links.is-open) .nav__inner::before {
  background: var(--nav-glass-bg);
  border-color: var(--nav-glass-border);
  box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.nav__logo { display: block; }
.nav__logo .logo { height: 36px; }

.nav__links { display: flex; align-items: center; gap: 4px; }

/* Links: no background. Inactive links are a bit dimmer; the active one gets a yellow line under the text */
.nav__link {
  --pad-x: 16px;
  --pad-y: 9px;
  position: relative;
  padding: var(--pad-y) var(--pad-x);
  font-size: 15px;
  font-weight: 500;
  color: var(--heading);
  opacity: 0.75;
  transition: opacity 0.25s ease;
}

/* The line: as wide as the text (it stops at the padding), 6px below it, grows from the center */
.nav__link::after {
  content: '';
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: calc(var(--pad-y) - 6px - 3px);
  height: 3px;
  border-radius: 3px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__link:hover { opacity: 1; }
.nav__link:hover::after { transform: scaleX(1); opacity: 0.5; }

.nav__link.is-active { opacity: 1; }
.nav__link.is-active::after { transform: scaleX(1); opacity: 1; }

.nav__actions { display: flex; align-items: center; gap: 8px; }

.nav__theme {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--heading);
  background: var(--nav-button-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.2s ease, background 0.2s ease;
}
.nav__theme:hover { transform: rotate(15deg); }
.nav__theme svg { width: 19px; height: 19px; }

[data-theme="dark"] .nav__theme-icon--moon,
[data-theme="light"] .nav__theme-icon--sun { display: none; }

.nav__resume { padding: 11px 22px; font-size: 15px; }
.nav__resume svg { width: 16px; height: 16px; }

.nav__resume--mobile,
.nav__toggle { display: none; }

.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded="true"] .icon-open { display: none; }
.nav__toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 900px) {
  .nav__toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--heading);
    background: var(--nav-button-bg);
  }
  .nav__resume { display: none; }

  .nav__links {
    position: absolute;
    top: calc(100% + 10px);
    left: calc(-1 * var(--nav-pad));
    right: calc(-1 * var(--nav-pad));
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px;
    border-radius: 24px;
    border: 1px solid var(--nav-glass-border);
    background: var(--nav-dropdown-bg);
    box-shadow: var(--nav-shadow);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__link { --pad-y: 12px; align-self: flex-start; }   /* only as wide as its text, so the line matches the word */
  .nav__resume--mobile { display: inline-flex; justify-content: center; margin-top: 8px; }
}

@media (max-width: 760px) {
  .nav__logo .logo { height: 32px; }
}
