/* ==========================================================================
   Navigation
   Sticky nav, logo, links and theme toggle.
   ========================================================================== */

/* nav */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.on {
  border-color: var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 72px;
}
.logo {
  font:
    700 1.5rem Outfit,
    Figtree,
    system-ui,
    sans-serif;
  text-decoration: none;
  letter-spacing: -0.03em;
}
.logo i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pop);
  margin-left: 2px;
}
.links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}
.links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.97rem;
  position: relative;
  transition: color 0.2s;
}
.links a:after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--a);
  transform: scaleX(0);
  transition: transform 0.3s;
}
.links a:hover {
  color: var(--ink);
}
.links a:hover:after {
  transform: scaleX(1);
}
nav .btn {
  padding: 10px 18px;
  font-size: 0.95rem;
}
.tg {
  position: relative;
  width: 64px;
  height: 34px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--soft);
  cursor: pointer;
  padding: 0;
  flex: none;
}
.tg .k {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pop);
  color: #12152b;
  display: grid;
  place-items: center;
  transition:
    transform 0.45s cubic-bezier(0.5, 1.6, 0.4, 1),
    background 0.35s,
    width 0.15s;
}
.tg:active .k {
  width: 32px;
}
[data-theme='dark'] .tg .k {
  transform: translateX(30px);
  background: var(--a);
  color: var(--on-a);
}
[data-theme='dark'] .tg:active .k {
  transform: translateX(24px);
}
.tg svg {
  position: absolute;
  transition:
    transform 0.5s,
    opacity 0.3s;
}
.tg .moon {
  opacity: 0;
  transform: rotate(-80deg) scale(0.4);
}
[data-theme='dark'] .tg .moon {
  opacity: 1;
  transform: none;
}
[data-theme='dark'] .tg .sun {
  opacity: 0;
  transform: rotate(80deg) scale(0.4);
}
