/* ============================================================
   THE THIRD NARRATIVE — Centered 3-Line Brand Logo Morph Menu
   Exact stepped logo proportions (28px / 44px / 60px) centered
   ============================================================ */

/* ─── Centered Morph Menu Wrapper (Hidden for now) ─── */
.morph-nav-wrapper {
  display: none !important;
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9100;
  pointer-events: auto;
}

/* ─── Transparent Backdrop Overlay (Spans entire screen) ─── */
.morph-nav-backdrop {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 250vw;
  height: 250vh;
  transform: translate(-50%, -50%);
  background: rgba(6, 6, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 9050;
  cursor: pointer;
}
.morph-nav-wrapper.is-open .morph-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ─── The Menu Container / Box ─── */
.morph-nav-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9100;
}

/* ─── Stack of 3 Morphing Bars ─── */
.morph-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── Individual Morphing Bar / Button ─── */
.morph-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  box-sizing: border-box;
  margin: 3px 0;
  padding: 0;
  border-radius: 999px;
  background-color: var(--white, #ffffff);
  border: 1px solid transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  
  /* Smooth Morph Transition */
  transition: 
    width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Closed State: Exact stepped brand logo lines */
.morph-bar--1 {
  width: 28px;
  height: 3.5px;
}
.morph-bar--2 {
  width: 44px;
  height: 3.5px;
}
.morph-bar--3 {
  width: 60px;
  height: 4.5px;
}

/* ─── Inner Content of Each Bar (Text & Badge) ─── */
.morph-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.96);
  transition: 
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
  pointer-events: none;
}

.morph-bar-text {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffffff;
}

.morph-bar-badge {
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted, #777777);
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Open State (Morphing all 3 into Centered Full Buttons) ─── */
.morph-nav-wrapper.is-open .morph-bar {
  width: 260px;
  height: 52px;
  margin: 6px 0;
  padding: 0;
  border-radius: 6px;
  background-color: rgba(16, 16, 16, 0.96);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.morph-nav-wrapper.is-open .morph-bar-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: 
    opacity 0.3s ease 0.12s,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
  pointer-events: auto;
}

/* ─── Hover & Focus States on Open Buttons ─── */
.morph-nav-wrapper.is-open .morph-bar:hover {
  background-color: rgba(28, 28, 28, 0.98);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
  box-shadow: 
    0 20px 48px rgba(0, 0, 0, 0.9),
    0 0 16px rgba(255, 255, 255, 0.12);
}

.morph-nav-wrapper.is-open .morph-bar:hover .morph-bar-badge {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.morph-nav-wrapper.is-open .morph-bar:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* ─── Closed State Hit Trigger ─── */
.morph-hit-trigger {
  position: absolute;
  inset: -10px -16px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 9200;
  padding: 0;
  display: block;
}
.morph-nav-wrapper.is-open .morph-hit-trigger {
  display: none;
  pointer-events: none;
}

/* ─── Close Bar Indicator below Open Stack ─── */
.morph-close-bar {
  margin-top: 10px;
  font-family: var(--font-mono, 'Space Mono', monospace);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted, #666666);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.morph-nav-wrapper.is-open .morph-close-bar {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.18s;
  pointer-events: auto;
  cursor: pointer;
}
.morph-close-bar:hover {
  color: #ffffff;
}

/* ─── Responsive adjustments ─── */
@media (max-width: 480px) {
  .morph-nav-wrapper {
    top: 20px;
  }
  .morph-nav-wrapper.is-open .morph-bar {
    width: min(240px, 80vw);
    height: 48px;
    margin: 5px 0;
  }
  .morph-bar-text {
    font-size: 12px;
  }
  .morph-bar-badge {
    font-size: 8.5px;
    padding: 2px 6px;
  }
}
