:root {
  --nav-font:   "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --nav-h:      68px;
  --dd-bg:      rgba(22, 20, 18, 0.97);
  --dd-border:  rgba(255, 255, 255, 0.07);
  --dd-radius:  14px;

  --spring:   cubic-bezier(0.34, 1.22, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.55, 0, 1, 0.45);
}

/* Navbar wrapper */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 36px;
  background: linear-gradient(to bottom, rgba(0,0,0,.28) 0%, transparent 100%);
}

/* Brand logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  z-index: 2;
  transition: opacity 0.2s ease;
}
.brand-logo:hover {
  opacity: 0.85;
}
.brand-text {
  font-family: var(--nav-font);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

/* Nav links */
.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-item { position: relative; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--nav-font);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  border-radius: 8px;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.22s ease, background 0.22s ease;
}
.nav-btn:hover,
.nav-btn--plain:hover,
.nav-item.open > .nav-btn {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.nav-btn--plain { color: rgba(255,255,255,0.72); }

.chevron {
  width: 10px; height: 10px;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-out);
}
.nav-item.open > .nav-btn .chevron { transform: rotate(180deg); }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 2;
}

.btn-text {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-family: var(--nav-font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 10px;
  text-decoration: none;
  transition: color 0.2s ease;
}
.btn-text:hover {
  color: #ffffff;
}

.header-actions .btn-glass-action {
  text-decoration: none !important;
  transform: none !important;
}

.header-actions .btn-glass-action:hover,
.header-actions .btn-glass-action:focus,
.header-actions .btn-glass-action:active,
.header-actions .btn-glass-action:visited {
  text-decoration: none !important;
  transform: none !important;
  color: #ffffff;
}

/* Morphing shell */
.shell {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 10px;
  pointer-events: none;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);

  transition:
    opacity    0.22s var(--ease-in),
    transform  0.22s var(--ease-in),
    visibility 0.22s step-end;
}

.shell.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;

  transition:
    left       0.44s var(--spring),
    opacity    0.36s var(--ease-out),
    transform  0.44s var(--spring),
    visibility 0s    step-start;
}

.shell-body {
  position: relative;
  background: var(--dd-bg);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow:
    0 2px 4px  rgba(0,0,0,.12),
    0 12px 40px rgba(0,0,0,.48),
    0 28px 72px rgba(0,0,0,.24);
  overflow: hidden;
  will-change: width, height;

  width:  300px;
  height: 200px;
  transition:
    width  0.44s var(--spring),
    height 0.44s var(--spring);
}

/* Panels */
.panel {
  position: absolute;
  top: 0; left: 0;
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  font-family: var(--nav-font);
  transition: opacity 0.16s ease;
}
.panel.active {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.28s ease 0.16s;
}

#panel-install,
#panel-skills,
#panel-showcase,
#panel-docs {
  padding: 6px;
}

/* Dropdown list */
.dropdown-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 270px;
  position: relative;
}

/* Highlight indicator */
.hl {
  position: absolute;
  left: 0; right: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  opacity: 0;
  transition:
    top    0.3s var(--spring),
    height 0.3s var(--spring),
    opacity 0.18s ease;
}
.dropdown-list:hover .hl { opacity: 1; }

.dropdown-link--rich {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.item-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.25;
  transition: color 0.22s ease;
}
.item-desc {
  font-size: 0.71rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.35;
  transition: color 0.22s ease;
}
.dropdown-item.active .item-title { color: #fff; }
.dropdown-item.active .item-desc  { color: rgba(255, 255, 255, 0.65); }

/* Backdrop */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: none;
}
.nav-backdrop.active { display: block; }

/* Mobile navigation */
.nav-mobile-toggle {
  display: none;
}

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

@media (max-width: 880px) {
  .nav-inner {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 0 16px;
  }

  .nav-links {
    display: none !important;
  }

  .shell {
    display: none !important;
    pointer-events: none !important;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn-text {
    display: none;
  }

  .header-actions .btn-glass-action {
    height: 38px;
    min-height: 44px;
    padding: 0 14px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
  }

  /* Mobile menu toggle */
  .nav-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    min-height: 44px;
    min-width: 44px;
    padding: 0 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-family: var(--nav-font);
    font-size: 0.82rem;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
  }

  .nav-mobile-toggle:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.2);
  }

  .nav-mobile-toggle-icon {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    flex-shrink: 0;
  }

  /* Mobile drawer */
  .nav-mobile-drawer {
    --origin-x: calc(100% - 46px);
    --origin-y: 34px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #09070c;
    z-index: 999999 !important;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, -10px, 0);
    transition:
      opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0.28s ease;
    will-change: opacity, transform;
  }

  .nav-mobile-drawer.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    transition:
      opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .drawer-header-icon,
  .drawer-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: color 0.18s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    padding: 0;
  }

  .drawer-header-icon:hover,
  .drawer-close-btn:hover,
  .drawer-header-icon:active,
  .drawer-close-btn:active {
    color: #ffffff;
    background: transparent;
  }

  .drawer-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px 18px 120px;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .drawer-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Drawer accordion */
  .drawer-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    transition: border-color 0.2s ease;
  }

  .drawer-section:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .drawer-section.is-open {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.14);
  }

  .drawer-section-btn {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 2px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-family: var(--nav-font);
    text-align: left;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease;
  }

  .drawer-section-btn:active {
    background: transparent;
  }

  .drawer-section-title {
    font-size: 0.96rem;
    font-weight: 550;
    text-transform: none;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.3;
    transition: color 0.18s ease;
  }

  .drawer-section.is-open .drawer-section-title {
    color: #ffffff;
    font-weight: 600;
  }

  .drawer-chevron {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease;
  }

  .drawer-section.is-open .drawer-chevron {
    transform: rotate(180deg);
    stroke: #ffffff;
  }

  .drawer-collapse {
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: height 0.38s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: height, opacity;
  }

  .drawer-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0 20px 0;
  }

  .drawer-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 50px;
    padding: 11px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid rgba(255, 255, 255, 0.055);
    text-decoration: none;
    color: #ffffff;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .drawer-link:active {
    transform: scale(0.985);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .drawer-link-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.25;
  }

  .drawer-link-desc {
    font-size: 0.74rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.35;
  }
}

/* Scroll lock */
html.nav-drawer-active,
body.nav-drawer-active {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

