/* ==========================================================================
   Site header / navbar
   ========================================================================== */

header {
  width: 100%;
}

/* reserve space so the fixed navbar never overlaps content on desktop */
body {
  padding-top: 68px;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0.75rem clamp(1.5rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 1000;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#site-header.scrolled .navbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px var(--color-line);
}

/* subpages (about/work/contact) always show the solid navbar since their
   content starts right under it, not behind a transparent hero */
#site-header.solid .navbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px var(--color-line);
}

/* ---------- Logo ---------- */

.navbar .logo a {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

.navbar .logo a:hover {
  color: var(--color-accent);
}

/* ---------- Nav links ---------- */

.navbar ul {
  display: flex;
  align-items: center;
  gap: clamp(0.2rem, 1vw, 0.5rem);
}

.navbar ul li a {
  position: relative;
  display: inline-block;
  text-transform: capitalize;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--color-primary);
  padding: 0.45rem 0.85rem;
  transition: color 0.2s ease;
}

.navbar ul li a:hover,
.navbar ul li a.active {
  color: var(--color-accent);
}

/* animated underline instead of a static dot */
.navbar ul li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  width: calc(100% - 1.7rem); /* matches horizontal padding so it aligns to the text */
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.navbar ul li a:hover::after,
.navbar ul li a.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ---------- Resume button ---------- */

.navbar ul li a.nav-resume-btn {
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  text-transform: none;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(26, 168, 201, 0.28);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.navbar ul li a.nav-resume-btn::after {
  display: none;
}

.navbar ul li a.nav-resume-btn:hover {
  filter: brightness(0.95);
  box-shadow: 0 6px 18px rgba(26, 168, 201, 0.35);
}

.navbar ul li a:focus-visible,
.mobile-bottom-nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- MOBILE + TABLET — below 1024px ---------- */
/* top navbar removed entirely, bottom tab bar is the only nav */

@media (max-width: 1024px) {
  #site-header {
    display: none;
  }

  body {
    padding-top: 0;
  }
}

/* ---------- MOBILE BOTTOM TAB BAR ---------- */

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

@media (max-width: 1024px) {
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: stretch;

    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 0.7rem 0.5rem;
    /* max() avoids a brief 0 value while env() resolves on load */
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));

    background: var(--color-primary);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);

    z-index: 1000;
  }

  /* reserve space so page content never sits under the tab bar */
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-bottom-nav a {
    flex: 1 1 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 0;
    min-height: 48px;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.3rem 0.4rem;
    border-radius: 14px;
    transition: color 0.2s ease, transform 0.15s ease;
  }

  .mobile-bottom-nav .material-symbols-outlined {
    font-size: 24px;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
    transition: font-variation-settings 0.25s ease, transform 0.25s ease;
  }

  .mobile-bottom-nav .nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .mobile-bottom-nav a:active {
    transform: scale(0.92);
  }

  /* active tab: accent color + filled icon, no pill/background — matches
     the flat "colored icon + label" look rather than a highlight chip */
  .mobile-bottom-nav a.active {
    color: var(--color-accent);
  }

  .mobile-bottom-nav a.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    transform: translateY(-2px);
  }

  /* small active indicator bar above the tab, like the progress bar
     accent in the reference screenshot */
  .mobile-bottom-nav a.active::before {
    content: "";
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: var(--color-accent);
  }
}

/* extra-small phones: keep 4 labeled icons from wrapping/clipping */
@media (max-width: 360px) {
  .mobile-bottom-nav .nav-label {
    font-size: 0.58rem;
  }

  .mobile-bottom-nav .material-symbols-outlined {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .navbar,
  .navbar ul li a,
  .navbar ul li a::after,
  .navbar ul li a.nav-resume-btn,
  .mobile-bottom-nav a {
    transition: none;
  }
}