/* ==========================================================================
   Navigation Component
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--z-nav);
  padding: 1.25rem var(--site-padding);
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: padding var(--duration-medium) var(--ease-cinematic),
              background var(--duration-medium) var(--ease-cinematic);
  pointer-events: none;
}

.site-nav.scrolled {
  padding: 0.9rem var(--site-padding);
  background: rgba(5, 5, 5, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-nav-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  pointer-events: auto;
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  transition: transform var(--duration-fast) var(--ease-cinematic),
              filter var(--duration-fast) ease;
}

.nav-brand:hover .brand-logo-img {
  transform: scale(1.1) rotate(-4deg);
  filter: drop-shadow(0 0 10px rgba(142, 15, 22, 0.6));
}

.brand-symbol {
  width: 6px;
  height: 6px;
  background-color: var(--accent-red);
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-cinematic),
              background-color var(--duration-fast) ease;
}

.brand-symbol.active-pulse {
  animation: symbolPulse 3.5s infinite ease-in-out;
}

@keyframes symbolPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--duration-fast) ease;
}

.nav-brand:hover .brand-symbol {
  transform: rotate(45deg) scale(1.25);
  background-color: var(--accent-red-bright);
}

/* Nav Links Group */
.nav-links-wrapper {
  display: flex;
  align-items: center;
  gap: 3rem;
  pointer-events: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--duration-fast) ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 1px;
  background: var(--accent-red);
  transition: width var(--duration-medium) var(--ease-cinematic);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link .nav-indicator {
  font-size: 0.65rem;
  color: var(--accent-red);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.nav-link:hover .nav-indicator,
.nav-link.active .nav-indicator {
  opacity: 1;
  transform: translateX(0);
}

/* Editorial Projects Hover Drawer */
.projects-dropdown-container {
  position: relative;
}

.projects-editorial-drawer {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: -1rem;
  width: 320px;
  background: rgba(8, 8, 10, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: opacity var(--duration-medium) var(--ease-cinematic),
              transform var(--duration-medium) var(--ease-cinematic),
              visibility var(--duration-medium);
  transition-delay: 0.12s;
  pointer-events: none;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(142, 15, 22, 0.08);
  z-index: 1000;
}

/* Invisible hover bridge connecting nav link and drawer */
.projects-editorial-drawer::before {
  content: '';
  position: absolute;
  top: -1.2rem;
  left: -0.5rem;
  right: -0.5rem;
  height: 1.2rem;
  background: transparent;
  display: block;
}

.projects-dropdown-container:hover .projects-editorial-drawer,
.projects-editorial-drawer:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition-delay: 0s;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.drawer-header .drawer-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.drawer-header .drawer-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent-red-bright);
}

.drawer-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-project-item {
  display: block;
  padding: 0.85rem 1rem;
  background: transparent;
  border-left: 2px solid transparent;
  transition: background var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              transform var(--duration-fast) var(--ease-cinematic);
}

.drawer-project-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-left-color: var(--accent-red);
  transform: translateX(4px);
}

.drawer-project-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-red);
  margin-bottom: 0.2rem;
  display: block;
}

.drawer-project-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  display: block;
}

.drawer-project-desc {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  line-height: 1.4;
  display: block;
}

/* Audio Atmospheric Toggle */
.audio-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--duration-fast) ease,
              background var(--duration-fast) ease;
}

.audio-toggle-btn:hover {
  border-color: var(--accent-red-hairline);
  background: rgba(142, 15, 22, 0.08);
}

.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.audio-bars span {
  width: 2px;
  height: 3px;
  background-color: var(--text-secondary);
  transition: height 0.2s ease, background-color 0.2s ease;
}

.audio-toggle-btn.is-playing .audio-bars span {
  background-color: var(--accent-red-bright);
}

.audio-toggle-btn.is-playing .audio-bars span:nth-child(1) {
  animation: audioAnim 1.2s infinite ease-in-out;
}
.audio-toggle-btn.is-playing .audio-bars span:nth-child(2) {
  animation: audioAnim 0.9s infinite ease-in-out 0.2s;
}
.audio-toggle-btn.is-playing .audio-bars span:nth-child(3) {
  animation: audioAnim 1.4s infinite ease-in-out 0.4s;
}

@keyframes audioAnim {
  0%, 100% { height: 3px; }
  50% { height: 10px; }
}

/* Mobile Menu Toggle */
.mobile-nav-toggle {
  display: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 7px;
  width: 36px;
  height: 36px;
  pointer-events: auto;
  cursor: pointer;
}

.mobile-nav-toggle span {
  width: 26px;
  height: 2px;
  background-color: #F1EEE7;
  display: block;
  transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

/* ==========================================================================
   Custom Minimalist Cursor
   ========================================================================== */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background-color: var(--text-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(241, 238, 231, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: calc(var(--z-cursor) - 1);
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease-cinematic),
              height 0.35s var(--ease-cinematic),
              border-color 0.35s var(--ease-cinematic),
              background 0.35s var(--ease-cinematic);
}

.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

/* Cursor State Variations */
body.cursor-hover .cursor-dot {
  background-color: var(--accent-red-bright);
  transform: translate(-50%, -50%) scale(1.5);
}

body.cursor-hover .cursor-ring {
  width: 54px;
  height: 54px;
  border-color: var(--accent-red);
  background: rgba(142, 15, 22, 0.06);
}

body.cursor-view .cursor-ring {
  width: 80px;
  height: 80px;
  border-color: var(--text-primary);
  background: rgba(241, 238, 231, 0.08);
}

body.cursor-view .cursor-label {
  opacity: 1;
}

body.cursor-hidden .cursor-dot,
body.cursor-hidden .cursor-ring,
body.cursor-hidden .cursor-label {
  opacity: 0;
}

/* ==========================================================================
   Telemetry & Metadata Badges
   ========================================================================== */
.telemetry-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.015);
}

.telemetry-tag .dot {
  width: 5px;
  height: 5px;
  background: var(--accent-red);
  border-radius: 50%;
}

/* Studio Precision Buttons */
.studio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.1rem 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.studio-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent-red);
  transition: transform var(--duration-medium) var(--ease-cinematic);
  z-index: -1;
}

.studio-btn:hover {
  border-color: var(--accent-red);
  color: #FFFFFF;
}

.studio-btn:hover::before {
  transform: translateX(100%);
}

.studio-btn .btn-arrow {
  transition: transform var(--duration-fast) ease;
}

.studio-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Responsive Navigation Breakpoint */
@media (max-width: 900px) {
  .site-nav {
    padding: max(0.85rem, env(safe-area-inset-top)) var(--site-padding) 0.85rem;
  }

  .site-nav-container {
    flex-wrap: nowrap;
  }

  .nav-brand {
    gap: 0.65rem;
    flex-shrink: 0;
  }

  .brand-logo-img {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
  }

  .brand-symbol {
    display: none;
  }

  .brand-wordmark {
    font-size: clamp(1.05rem, 4.8vw, 1.30rem) !important;
    letter-spacing: 0.04em !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    flex-shrink: 0;
    line-height: 1;
  }

  .mobile-nav-toggle {
    flex-shrink: 0;
  }

  .nav-links-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    width: 90vw;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: rgba(8, 8, 11, 0.98);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border-left: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.8), -1px 0 20px rgba(142, 15, 22, 0.2);
    padding: 5rem 1.75rem 2.5rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform var(--duration-medium) var(--ease-cinematic);
    pointer-events: auto;
    z-index: var(--z-nav);
  }

  .nav-links-wrapper.is-open {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    width: 100%;
  }

  .nav-link {
    font-size: 1.05rem;
    letter-spacing: 0.12em;
  }

  .projects-editorial-drawer {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    width: 100%;
    margin-top: 0.75rem;
    padding: 1.15rem;
    background: rgba(14, 14, 18, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 2px solid var(--accent-red);
    box-shadow: none;
    transition-delay: 0s;
  }

  .projects-editorial-drawer::before {
    display: none;
  }

  .drawer-header {
    padding-bottom: 0.65rem;
    margin-bottom: 0.75rem;
  }

  .drawer-items {
    gap: 0.5rem;
  }

  .drawer-project-item {
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 2px solid transparent;
  }

  .drawer-project-num {
    font-size: 0.60rem;
    margin-bottom: 0.15rem;
  }

  .drawer-project-name {
    font-size: 0.95rem;
  }

  .drawer-project-desc {
    font-size: 0.70rem;
    line-height: 1.35;
    margin-top: 0.25rem;
    opacity: 0.75;
  }

  .audio-toggle-btn {
    margin-top: auto;
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-toggle {
    display: flex;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    z-index: 1001;
  }

  .mobile-nav-toggle.is-active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  .mobile-nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}
