/* Phone and small tablet menu. Larger screens keep the normal row of links.
   Everything that hides the links sits under .js, so they stay visible if scripts fail. */
.nav-wrap{display:contents}
.nav-btn{display:none}

@media (max-width:820px){
  .js .nav-wrap{display:block;position:relative;z-index:40;flex:none}

  /* Menu button */
  .js .nav-btn{
    display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:5px;
    position:relative;width:44px;height:44px;margin:0;padding:0 11px;box-sizing:border-box;
    background:#fff;border:1px solid #E5E5E5;border-radius:10px;
    box-shadow:0 2px 8px rgba(17,17,17,.06);
    cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
    transition:border-color .18s ease,box-shadow .18s ease
  }
  .js .nav-btn:focus-visible{outline:2px solid #C2410C;outline-offset:2px}
  .js .nav-btn[aria-expanded="true"]{border-color:#E1472D;box-shadow:0 2px 10px rgba(225,71,45,.18)}
  .js .nav-btn span{
    display:block;width:20px;height:2px;border-radius:2px;background:#E1472D;
    transform-origin:center;transition:transform .2s ease,opacity .15s ease,width .2s ease
  }
  .js .nav-btn span:nth-child(2){width:13px}
  .js .nav-btn[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  .js .nav-btn[aria-expanded="true"] span:nth-child(2){opacity:0}
  .js .nav-btn[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

  /* Pointer joining the button to the card */
  .js .nav-btn::after{
    content:"";position:absolute;z-index:2;left:50%;top:calc(100% + 7px);
    width:12px;height:12px;margin-left:-6px;box-sizing:border-box;
    background:#fff;border:1px solid #EAEAEA;border-right:0;border-bottom:0;border-radius:2px 0 0 0;
    transform:rotate(45deg);opacity:0;visibility:hidden;
    transition:opacity .16s ease,visibility 0s linear .16s
  }
  .js .nav-btn[aria-expanded="true"]::after{opacity:1;visibility:visible;transition:opacity .16s ease}

  /* Menu card */
  .js .nav{
    display:block!important;position:absolute;z-index:1;top:calc(100% + 13px);right:0;
    width:min(264px,calc(100vw - 32px));max-height:calc(100vh - 110px);max-height:calc(100dvh - 110px);
    box-sizing:border-box;padding:6px 0;overflow-y:auto;overscroll-behavior:contain;
    background:#fff;border:1px solid #EAEAEA;border-radius:12px;
    box-shadow:0 20px 48px rgba(17,17,17,.18),0 2px 8px rgba(17,17,17,.06);
    opacity:0;visibility:hidden;transform:translateY(-6px);transform-origin:top right;
    transition:opacity .16s ease,transform .18s ease,visibility 0s linear .18s
  }
  .js .nav-btn[aria-expanded="true"] + .nav{
    opacity:1;visibility:visible;transform:none;
    transition:opacity .16s ease,transform .18s ease
  }

  /* Menu rows: label on the left, icon on the right */
  .js .nav a{
    display:flex;align-items:center;justify-content:space-between;gap:16px;position:relative;
    min-height:50px;padding:0 18px 0 20px;box-sizing:border-box;
    color:#111;font:500 15px Montserrat,sans-serif;text-decoration:none;
    -webkit-tap-highlight-color:transparent;transition:background-color .15s ease
  }
  .js .nav a:active{background:#FFF1EA}
  .js .nav a:focus-visible{outline:2px solid #C2410C;outline-offset:-2px;border-radius:8px}
  .js .nav a::after{
    content:"";flex:none;width:22px;height:22px;background:linear-gradient(135deg,#FF6300,#E1472D);
    -webkit-mask:var(--i) center/contain no-repeat;mask:var(--i) center/contain no-repeat
  }

  /* Current page */
  .js .nav a[aria-current="page"]{background:#FFF1EA;color:#B23A0A!important;font-weight:600}
  .js .nav a[aria-current="page"]::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#111}

  .js .nav a[href="about"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E")}
  .js .nav a[href="team"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6M16 4.8a3.5 3.5 0 0 1 0 6.4M18 14.5c1.8.8 3 2.6 3 4.7'/%3E%3C/svg%3E")}
  .js .nav a[href="work"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7.5' width='18' height='12.5' rx='2.5'/%3E%3Cpath d='M8.5 7.5V6a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v1.5M3 13h18'/%3E%3C/svg%3E")}
  .js .nav a[href="services"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 5-9 5-9-5z'/%3E%3Cpath d='M3 13l9 5 9-5M3 17.5l9 3.5 9-3.5'/%3E%3C/svg%3E")}
  .js .nav a[href="ideas"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 17h6M10 20.5h4M12 3a6.5 6.5 0 0 0-3.8 11.8c.5.4.8 1 .8 1.7v.5h6v-.5c0-.7.3-1.3.8-1.7A6.5 6.5 0 0 0 12 3z'/%3E%3C/svg%3E")}
  .js .nav a[href="contact"]{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5.5' width='18' height='13' rx='2.5'/%3E%3Cpath d='M3.5 7.5L12 13l8.5-5.5'/%3E%3C/svg%3E")}
}

@media (max-width:820px) and (hover:hover){
  .js .nav a:hover{background:#FAFAFA;color:#C2410C}
  .js .nav a[aria-current="page"]:hover{background:#FFF1EA}
}

@media (max-width:820px) and (prefers-reduced-motion:reduce){
  .js .nav,.js .nav-btn,.js .nav-btn span,.js .nav-btn::after,.js .nav a{transition:none!important}
  .js .nav{transform:none}
}
