* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
  }
  
  body {
    height: 100vh;
    background: #020617;
    display: flex;
    justify-content: center;
    margin-top: 160px;
  }
  
  .navbar {
    margin-top: 50px;
  }
  
  .nav {
    display: flex;
    gap: 30px;
    padding: 20px 45px;
    background: #020617;
    border-radius: 60px;
    border: 1px solid #1e293b;
    perspective: 800px;
  }
  
  .nav li {
    position: relative;
    width: 80px;
    height: 40px;
    cursor: pointer;
    list-style: none;
    text-align: center;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    outline: none;
  }
  
  /* Text */
  .nav li .text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5f5;
    font-size: 18px;
    backface-visibility: hidden;
    transition: transform 0.6s ease, opacity 0.4s;
  }
  
  /* Icon */
  .nav li .icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    color: #38bdf8;
    transform: translateY(40px) rotateX(-90deg);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.4s;
  }
  
  /* Hover */
  .nav li:hover .text {
    color: #38bdf8;
  }
  
  .nav li:focus-within .text {
    transform: translateY(-40px);
    opacity: 0;
  }
  
  .nav li:focus-within .icon {
    transform: translateY(0) rotateX(0);
    opacity: 1;
  }
  