/* ==========================================================================
   NAVBAR — Glass sticky navigation with scroll progress
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  transition: background var(--duration-normal) ease,
              backdrop-filter var(--duration-normal) ease,
              transform var(--duration-normal) var(--ease-out-expo);
}

.navbar.is-scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--color-border);
}

.navbar.is-hidden {
  transform: translateY(-100%);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  z-index: 2;
}

.navbar__logo-mark {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.navbar__link {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--duration-fast) ease;
  padding: 0.25rem 0;
}

.navbar__link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-gradient-start), var(--color-gradient-end));
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out-expo);
}

.navbar__link:hover,
.navbar__link.is-active {
  color: var(--color-text);
}

.navbar__link:hover::after,
.navbar__link.is-active::after {
  width: 100%;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar__cta {
  padding: 0.65rem 1.5rem;
  font-size: var(--text-sm);
}

/* Hamburger */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  z-index: 2;
}

.navbar__hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: var(--radius-full);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              opacity var(--duration-fast) ease;
  transform-origin: center;
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar__hamburger.is-active .navbar__hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-sticky) - 1);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  clip-path: circle(0% at calc(100% - 2rem) 2rem);
  transition: opacity var(--duration-normal) ease,
              visibility var(--duration-normal) ease,
              clip-path 0.7s var(--ease-out-expo);
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  clip-path: circle(150% at calc(100% - 2rem) 2rem);
}

.mobile-menu__link {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) ease;
}

.mobile-menu__link:hover {
  color: var(--color-accent);
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  gap: 2rem;
}

.preloader__logo {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  overflow: hidden;
}

.preloader__logo-char {
  display: inline-block;
  transform: translateY(100%);
}

.preloader__progress-wrap {
  width: 200px;
  text-align: center;
}

.preloader__progress-bar {
  width: 100%;
  height: 2px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.preloader__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gradient-start), var(--color-gradient-end));
  border-radius: inherit;
  transition: width 0.1s linear;
}

.preloader__percent {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Custom cursor */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  mix-blend-mode: var(--cursor-blend);
}

.cursor__dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              background 0.3s ease;
}

.cursor__ring {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out-expo),
              height 0.4s var(--ease-out-expo),
              border-color 0.3s ease,
              background 0.3s ease;
}

.cursor.is-hovering .cursor__dot {
  width: 0;
  height: 0;
}

.cursor.is-hovering .cursor__ring {
  width: 60px;
  height: 60px;
  background: var(--color-accent-muted);
}

.cursor.is-clicking .cursor__ring {
  width: 30px;
  height: 30px;
}

.cursor__label {
  position: fixed;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.cursor.is-hovering .cursor__label {
  opacity: 1;
}

.cursor__preview {
  position: fixed;
  width: 200px;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.cursor__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cursor.is-preview .cursor__preview {
  opacity: 1;
}

.cursor__ripple {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--color-accent);
  transform: translate(-50%, -50%);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .navbar__nav,
  .navbar__cta {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
  }
}

@media (max-width: 768px) {
  .social-dock,
  .scroll-indicator {
    display: none;
  }
}
