/* Site nav – the glass pill from stefanseegerer.de (assets/css/custom.css).
   Top: icon + label; data-scrolled="true" (set in site-nav.js): compact, icons only. */
@import url('https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/regular/style.css');

/* Content starts below the floating pill */
body:has(> #nav) {
  padding-top: 96px;
}

#nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  transition: all .5s cubic-bezier(.2, .8, .2, 1);
}

#nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 16px;
  border-radius: 999px;
  border-bottom: 0;
  font: 500 15px 'Inter', sans-serif;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: #6e6e6e;
  transition: all .5s cubic-bezier(.2, .8, .2, 1);
}

#nav a:hover {
  background: rgba(0, 0, 0, 0.04);
}

#nav a.active {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}

#nav a:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

#nav .nav-icon {
  font-size: 22px;
  line-height: 1;
  flex: none;
  transition: all .5s cubic-bezier(.2, .8, .2, 1);
}

#nav .nav-label {
  display: inline-block;
  overflow: hidden;
  max-width: 200px;
  text-overflow: ellipsis;
  opacity: 1;
  transition: all .5s cubic-bezier(.2, .8, .2, 1);
}

/* Thin divider between the main site and the tools section */
#nav .nav-sep {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: rgba(0, 0, 0, 0.12);
  flex: none;
}

/* Compact pill once scrolled */
#nav[data-scrolled="true"] {
  top: 12px;
  padding: 6px;
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#nav[data-scrolled="true"] a {
  gap: 0;
  height: 40px;
  padding: 0 11px;
  font-size: 13px;
}

#nav[data-scrolled="true"] .nav-icon {
  font-size: 20px;
}

#nav[data-scrolled="true"] .nav-label {
  max-width: 0;
  opacity: 0;
}

/* Small screens: full-width tab bar (icon above label), compact icon pill once scrolled */
@media (max-width: 639px) {
  body:has(> #nav) {
    padding-top: 100px;
  }

  #nav {
    top: 16px;
    justify-content: center;
    gap: 2px;
    box-sizing: border-box;
    width: calc(100vw - 32px);
    padding: 6px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2), inset 0 1px 0 #fff;
  }

  #nav[data-scrolled="true"] {
    top: 12px;
    width: auto;
    padding: 5px;
    border-radius: 999px;
    border-color: rgba(0, 0, 0, 0.09);
    box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.26), inset 0 1px 0 #fff;
  }

  #nav a {
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: 52px;
    padding: 0 4px;
    border-radius: 18px;
    font: 500 10.5px 'Inter', sans-serif;
    color: #3a3a3a;
  }

  #nav[data-scrolled="true"] a {
    flex: none;
    flex-direction: row;
    gap: 0;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 999px;
    font-size: 10.5px;
  }

  #nav a.active {
    color: #111;
    background: rgba(0, 0, 0, 0.08);
  }

  #nav .nav-icon,
  #nav[data-scrolled="true"] .nav-icon {
    font-size: 20px;
    flex-shrink: 0;
  }

  #nav .nav-label {
    display: block;
    max-width: 120px;
    max-height: 14px;
    line-height: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 1;
  }

  #nav[data-scrolled="true"] .nav-label {
    max-width: 0;
    max-height: 0;
    opacity: 0;
  }

  #nav .nav-sep {
    height: 32px;
    margin: 0 2px;
  }
}

/* Hover label below the icon in the compact pill (text comes from aria-label) */
#nav a::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font: 500 11px 'Inter', sans-serif;
  color: #1a1a1a;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  transition: opacity .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1), visibility .2s;
}

@media (hover: hover) {
  #nav[data-scrolled="true"] a:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #nav,
  #nav a,
  #nav a::after,
  #nav .nav-icon,
  #nav .nav-label {
    transition-duration: 0s;
  }
}

/* Breadcrumb under the nav: stefanseegerer.de / Tools */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  font: 500 12px 'Inter', sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #999;
}

.breadcrumb a {
  color: #666;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #1c1c1c;
}

.breadcrumb [aria-current] {
  color: #1c1c1c;
}

@media print {
  #nav { display: none; }
  body:has(> #nav) { padding-top: 0; }
}
